diff --git a/.gitignore b/.gitignore index 8e4b700fd..5a8cef2e2 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ .settings/ bin/target/ target -/src/main/resources/dc-config.properties \ No newline at end of file +/src/main/resources/personium-unit-config.properties \ No newline at end of file diff --git a/checkstyle-suppressions.xml b/checkstyle-suppressions.xml index 82f7cbda5..77fe82ff1 100644 --- a/checkstyle-suppressions.xml +++ b/checkstyle-suppressions.xml @@ -6,7 +6,7 @@ - + diff --git a/findbugs-exclude.xml b/findbugs-exclude.xml index 1dbfc5528..ce64fcc10 100644 --- a/findbugs-exclude.xml +++ b/findbugs-exclude.xml @@ -1,12 +1,12 @@ - + - + - + \ No newline at end of file diff --git a/dc-checks.xml b/personium-checkstyle.xml similarity index 100% rename from dc-checks.xml rename to personium-checkstyle.xml diff --git a/pom.xml b/pom.xml index 270a54777..db7b6f9ce 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ personium-core war 1.4.2-SNAPSHOT - personiu-core Maven Webapp + personium-core Maven Webapp http://maven.apache.org @@ -20,25 +20,23 @@ 1.8 1.0.12 1.7.6 - com.fujitsu.* - + io.personium.* - io.personium - personium-lib-es-adaptor - 1.4.1 + personium-lib-es-adapter + 1.4.2 io.personium personium-lib-common - 1.4.1 + 1.4.2 io.personium personium-client-java - 1.4.1 + 1.4.2 test @@ -372,13 +370,13 @@ com.mycila license-maven-plugin -
../copyright.txt
+
copyright.txt
.checkstyle checkstyle.header checkstyle_maven.properties checkstyle-suppressions.xml - dc-checks.xml + personium-checkstyle.xml findbugs-exclude.xml pom.xml NOTICE.txt @@ -442,7 +440,7 @@ maven-checkstyle-plugin UTF-8 - dc-checks.xml + personium-checkstyle.xml checkstyle_maven.properties diff --git a/src/main/java/com/fujitsu/dc/core/DcCoreAuthnException.java b/src/main/java/io/personium/core/PersoniumCoreAuthnException.java similarity index 55% rename from src/main/java/com/fujitsu/dc/core/DcCoreAuthnException.java rename to src/main/java/io/personium/core/PersoniumCoreAuthnException.java index 914da220c..a8b294c10 100644 --- a/src/main/java/com/fujitsu/dc/core/DcCoreAuthnException.java +++ b/src/main/java/io/personium/core/PersoniumCoreAuthnException.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core; +package io.personium.core; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.MediaType; @@ -24,10 +24,10 @@ import org.apache.http.HttpStatus; import org.json.simple.JSONObject; -import com.fujitsu.dc.core.DcCoreMessageUtils.Severity; -import com.fujitsu.dc.core.auth.OAuth2Helper.Error; -import com.fujitsu.dc.core.auth.OAuth2Helper.Key; -import com.fujitsu.dc.core.auth.OAuth2Helper.Scheme; +import io.personium.core.PersoniumCoreMessageUtils.Severity; +import io.personium.core.auth.OAuth2Helper.Error; +import io.personium.core.auth.OAuth2Helper.Key; +import io.personium.core.auth.OAuth2Helper.Scheme; /** * ログメッセージ作成クラス. @@ -36,108 +36,108 @@ * @author naoki */ @SuppressWarnings("serial") -public final class DcCoreAuthnException extends DcCoreException { +public final class PersoniumCoreAuthnException extends PersoniumCoreException { /** * Grant-Typeの値が異常. */ - public static final DcCoreAuthnException UNSUPPORTED_GRANT_TYPE = + public static final PersoniumCoreAuthnException UNSUPPORTED_GRANT_TYPE = create("PR400-AN-0001", Error.UNSUPPORTED_GRANT_TYPE); /** - * dc_targetの値異常. + * p_targetの値異常. */ - public static final DcCoreAuthnException INVALID_TARGET = create("PR400-AN-0002", Error.INVALID_REQUEST); + public static final PersoniumCoreAuthnException INVALID_TARGET = create("PR400-AN-0002", Error.INVALID_REQUEST); /** - * Client Sercret パースエラー. + * Client Secret パースエラー. */ - public static final DcCoreAuthnException CLIENT_SERCRET_PARSE_ERROR = create("PR400-AN-0003", Error.INVALID_CLIENT); + public static final PersoniumCoreAuthnException CLIENT_SECRET_PARSE_ERROR = create("PR400-AN-0003", Error.INVALID_CLIENT); /** - * Client Sercret 有効期限チェック. + * Client Secret 有効期限チェック. */ - public static final DcCoreAuthnException CLIENT_SERCRET_EXPIRED = create("PR400-AN-0004", Error.INVALID_CLIENT); + public static final PersoniumCoreAuthnException CLIENT_SECRET_EXPIRED = create("PR400-AN-0004", Error.INVALID_CLIENT); /** - * Client Sercret 署名検証をエラー. + * Client Secret 署名検証をエラー. */ - public static final DcCoreAuthnException CLIENT_SERCRET_DSIG_INVALID = + public static final PersoniumCoreAuthnException CLIENT_SECRET_DSIG_INVALID = create("PR400-AN-0005", Error.INVALID_CLIENT); /** - * Client Sercret のIssuerがIDと等しくない. + * Client Secret のIssuerがIDと等しくない. */ - public static final DcCoreAuthnException CLIENT_SERCRET_ISSUER_MISMATCH = + public static final PersoniumCoreAuthnException CLIENT_SECRET_ISSUER_MISMATCH = create("PR400-AN-0006", Error.INVALID_CLIENT); /** - * Client Sercret のターゲットが自分でない. + * Client Secret のターゲットが自分でない. */ - public static final DcCoreAuthnException CLIENT_SERCRET_TARGET_WRONG = + public static final PersoniumCoreAuthnException CLIENT_SECRET_TARGET_WRONG = create("PR400-AN-0007", Error.INVALID_CLIENT); /** * トランスセルトークン認証ではユニットユーザ昇格はできない. */ - public static final DcCoreAuthnException TC_ACCESS_REPRESENTING_OWNER = + public static final PersoniumCoreAuthnException TC_ACCESS_REPRESENTING_OWNER = create("PR400-AN-0008", Error.INVALID_GRANT); /** * トークンパースエラー. */ - public static final DcCoreAuthnException TOKEN_PARSE_ERROR = create("PR400-AN-0009", Error.INVALID_GRANT); + public static final PersoniumCoreAuthnException TOKEN_PARSE_ERROR = create("PR400-AN-0009", Error.INVALID_GRANT); /** * 有効期限切れ. */ - public static final DcCoreAuthnException TOKEN_EXPIRED = create("PR400-AN-0010", Error.INVALID_GRANT); + public static final PersoniumCoreAuthnException TOKEN_EXPIRED = create("PR400-AN-0010", Error.INVALID_GRANT); /** * 署名検証をエラー. */ - public static final DcCoreAuthnException TOKEN_DSIG_INVALID = create("PR400-AN-0011", Error.INVALID_GRANT); + public static final PersoniumCoreAuthnException TOKEN_DSIG_INVALID = create("PR400-AN-0011", Error.INVALID_GRANT); /** * トークン のターゲットが自分でない. * {0}:トークンのターゲットURL */ - public static final DcCoreAuthnException TOKEN_TARGET_WRONG = create("PR400-AN-0012", Error.INVALID_GRANT); + public static final PersoniumCoreAuthnException TOKEN_TARGET_WRONG = create("PR400-AN-0012", Error.INVALID_GRANT); /** * リフレッシュトークンでない. */ - public static final DcCoreAuthnException NOT_REFRESH_TOKEN = create("PR400-AN-0013", Error.INVALID_GRANT); + public static final PersoniumCoreAuthnException NOT_REFRESH_TOKEN = create("PR400-AN-0013", Error.INVALID_GRANT); /** * 権限がないから昇格できない. */ - public static final DcCoreAuthnException NOT_ALLOWED_REPRESENT_OWNER = create("PR400-AN-0014", Error.INVALID_GRANT); + public static final PersoniumCoreAuthnException NOT_ALLOWED_REPRESENT_OWNER = create("PR400-AN-0014", Error.INVALID_GRANT); /** * オーナーがいないセルは昇格できない. */ - public static final DcCoreAuthnException NO_CELL_OWNER = create("PR400-AN-0015", Error.INVALID_GRANT); + public static final PersoniumCoreAuthnException NO_CELL_OWNER = create("PR400-AN-0015", Error.INVALID_GRANT); /** * 必須パラメータが無い. * {0}:パラメータキー名 */ - public static final DcCoreAuthnException REQUIRED_PARAM_MISSING = create("PR400-AN-0016", Error.INVALID_REQUEST); + public static final PersoniumCoreAuthnException REQUIRED_PARAM_MISSING = create("PR400-AN-0016", Error.INVALID_REQUEST); /** * 認証エラー. */ - public static final DcCoreAuthnException AUTHN_FAILED = create("PR400-AN-0017", Error.INVALID_GRANT); + public static final PersoniumCoreAuthnException AUTHN_FAILED = create("PR400-AN-0017", Error.INVALID_GRANT); /** * 認証ヘッダの指定誤り. */ - public static final DcCoreAuthnException AUTH_HEADER_IS_INVALID = create("PR400-AN-0018", Error.INVALID_CLIENT); + public static final PersoniumCoreAuthnException AUTH_HEADER_IS_INVALID = create("PR400-AN-0018", Error.INVALID_CLIENT); /** * Accountロック中. */ - public static final DcCoreAuthnException ACCOUNT_LOCK_ERROR = create("PR400-AN-0019", Error.INVALID_GRANT); + public static final PersoniumCoreAuthnException ACCOUNT_LOCK_ERROR = create("PR400-AN-0019", Error.INVALID_GRANT); /** * IDTokenの検証の中で、受け取ったIdTokenのAudienceが信頼するClientIDのリストに無かった. */ - public static final DcCoreAuthnException OIDC_WRONG_AUDIENCE = create("PR400-AN-0030", Error.INVALID_GRANT); + public static final PersoniumCoreAuthnException OIDC_WRONG_AUDIENCE = create("PR400-AN-0030", Error.INVALID_GRANT); /** * OIDCの認証エラー. */ - public static final DcCoreAuthnException OIDC_AUTHN_FAILED = create("PR400-AN-0031", Error.INVALID_GRANT); + public static final PersoniumCoreAuthnException OIDC_AUTHN_FAILED = create("PR400-AN-0031", Error.INVALID_GRANT); /** * 無効なIDToken. */ - public static final DcCoreAuthnException OIDC_INVALID_ID_TOKEN = create("PR400-AN-0032", Error.INVALID_GRANT); + public static final PersoniumCoreAuthnException OIDC_INVALID_ID_TOKEN = create("PR400-AN-0032", Error.INVALID_GRANT); /** * IDTokenの有効期限切れ. */ - public static final DcCoreAuthnException OIDC_EXPIRED_ID_TOKEN = create("PR400-AN-0033", Error.INVALID_GRANT); + public static final PersoniumCoreAuthnException OIDC_EXPIRED_ID_TOKEN = create("PR400-AN-0033", Error.INVALID_GRANT); /** * インナークラスを強制的にロードする. @@ -157,7 +157,7 @@ public static void loadConfig() { * @param error OAuth認証エラーのエラーコード * @param realm WWWW-Authenticateヘッダを返す場合はここにrealm値を設定する */ - DcCoreAuthnException(final String code, + PersoniumCoreAuthnException(final String code, final Severity severity, final String message, final int status, @@ -173,9 +173,9 @@ public static void loadConfig() { * @param realm2set realm * @return CoreAuthnException */ - public DcCoreAuthnException realm(String realm2set) { + public PersoniumCoreAuthnException realm(String realm2set) { // クローンを作成 - return new DcCoreAuthnException(this.code, this.severity, this.message, this.status, this.error, realm2set); + return new PersoniumCoreAuthnException(this.code, this.severity, this.message, this.status, this.error, realm2set); } @SuppressWarnings("unchecked") @@ -204,11 +204,11 @@ public Response createResponse() { /** * 原因例外を追加したものを作成して返します. * @param t 原因例外 - * @return DcCoreException + * @return PersoniumCoreException */ - public DcCoreException reason(final Throwable t) { + public PersoniumCoreException reason(final Throwable t) { // クローンを作成して - DcCoreException ret = new DcCoreAuthnException( + PersoniumCoreException ret = new PersoniumCoreAuthnException( this.code, this.severity, this.message, this.status, this.error, this.realm); // スタックトレースをセット ret.setStackTrace(t.getStackTrace()); @@ -217,23 +217,23 @@ public DcCoreException reason(final Throwable t) { /** * ファクトリーメソッド. - * @param code DCメッセージコード + * @param code Personiumメッセージコード * @param error OAuth2エラーコード - * @return DcCoreException + * @return PersoniumCoreException */ - public static DcCoreAuthnException create(String code, String error) { - int statusCode = DcCoreException.parseCode(code); + public static PersoniumCoreAuthnException create(String code, String error) { + int statusCode = PersoniumCoreException.parseCode(code); // ログレベルの取得 - Severity severity = DcCoreMessageUtils.getSeverity(code); + Severity severity = PersoniumCoreMessageUtils.getSeverity(code); if (severity == null) { // ログレベルが設定されていなかったらレスポンスコードから自動的に判定する。 severity = decideSeverity(statusCode); } // ログメッセージの取得 - String message = DcCoreMessageUtils.getMessage(code); + String message = PersoniumCoreMessageUtils.getMessage(code); - return new DcCoreAuthnException(code, severity, message, statusCode, error, null); + return new PersoniumCoreAuthnException(code, severity, message, statusCode, error, null); } } diff --git a/src/main/java/com/fujitsu/dc/core/DcCoreAuthzException.java b/src/main/java/io/personium/core/PersoniumCoreAuthzException.java similarity index 66% rename from src/main/java/com/fujitsu/dc/core/DcCoreAuthzException.java rename to src/main/java/io/personium/core/PersoniumCoreAuthzException.java index dd0f48702..c6acc3de8 100644 --- a/src/main/java/com/fujitsu/dc/core/DcCoreAuthzException.java +++ b/src/main/java/io/personium/core/PersoniumCoreAuthzException.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core; +package io.personium.core; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.MediaType; @@ -23,61 +23,61 @@ import org.apache.http.HttpStatus; -import com.fujitsu.dc.core.DcCoreMessageUtils.Severity; -import com.fujitsu.dc.core.auth.OAuth2Helper.AcceptableAuthScheme; -import com.fujitsu.dc.core.auth.OAuth2Helper.Scheme; -import com.fujitsu.dc.core.exceptions.ODataErrorMessage; +import io.personium.core.PersoniumCoreMessageUtils.Severity; +import io.personium.core.auth.OAuth2Helper.AcceptableAuthScheme; +import io.personium.core.auth.OAuth2Helper.Scheme; +import io.personium.core.exceptions.ODataErrorMessage; /** * 認証エラー(PR401-AU-xxxx)が発生した場合のログ出力クラス. */ @SuppressWarnings("serial") -public final class DcCoreAuthzException extends DcCoreException { +public final class PersoniumCoreAuthzException extends PersoniumCoreException { /** * 認証ヘッダが必要. */ - public static final DcCoreAuthzException AUTHORIZATION_REQUIRED = create("PR401-AU-0001"); + public static final PersoniumCoreAuthzException AUTHORIZATION_REQUIRED = create("PR401-AU-0001"); /** * トークン有効期限切れ. */ - public static final DcCoreAuthzException EXPIRED_ACCESS_TOKEN = create("PR401-AU-0002"); + public static final PersoniumCoreAuthzException EXPIRED_ACCESS_TOKEN = create("PR401-AU-0002"); /** * AuthenticationSchemeが無効. */ - public static final DcCoreAuthzException INVALID_AUTHN_SCHEME = create("PR401-AU-0003"); + public static final PersoniumCoreAuthzException INVALID_AUTHN_SCHEME = create("PR401-AU-0003"); /** * ベーシック認証ヘッダのフォーマットが無効. */ - public static final DcCoreAuthzException BASIC_AUTH_FORMAT_ERROR = create("PR401-AU-0004"); + public static final PersoniumCoreAuthzException BASIC_AUTH_FORMAT_ERROR = create("PR401-AU-0004"); /** * トークンパースエラー. */ - public static final DcCoreAuthzException TOKEN_PARSE_ERROR = create("PR401-AU-0006"); + public static final PersoniumCoreAuthzException TOKEN_PARSE_ERROR = create("PR401-AU-0006"); /** * リフレッシュトークンでのアクセス. */ - public static final DcCoreAuthzException ACCESS_WITH_REFRESH_TOKEN = create("PR401-AU-0007"); + public static final PersoniumCoreAuthzException ACCESS_WITH_REFRESH_TOKEN = create("PR401-AU-0007"); /** * トークン署名検証エラー. */ - public static final DcCoreAuthzException TOKEN_DISG_ERROR = create("PR401-AU-0008"); + public static final PersoniumCoreAuthzException TOKEN_DISG_ERROR = create("PR401-AU-0008"); /** * クッキー認証エラー. */ - public static final DcCoreAuthzException COOKIE_AUTHENTICATION_FAILED = create("PR401-AU-0009"); + public static final PersoniumCoreAuthzException COOKIE_AUTHENTICATION_FAILED = create("PR401-AU-0009"); /** * ベーシック認証エラー(Accountロック中). */ - public static final DcCoreAuthzException BASIC_AUTHENTICATION_FAILED_IN_ACCOUNT_LOCK = + public static final PersoniumCoreAuthzException BASIC_AUTHENTICATION_FAILED_IN_ACCOUNT_LOCK = create("PR401-AU-0010"); /** * ベーシック認証エラー. */ - public static final DcCoreAuthzException BASIC_AUTHENTICATION_FAILED = create("PR401-AU-0011"); + public static final PersoniumCoreAuthzException BASIC_AUTHENTICATION_FAILED = create("PR401-AU-0011"); /** * インナークラスを強制的にロードする. @@ -98,7 +98,7 @@ public static void loadConfig() { * @param realm WWWW-Authenticateヘッダを返す場合はここにrealm値を設定する * @param authScheme 認証を許可するAuthSchemeの種別 */ - DcCoreAuthzException(final String code, + PersoniumCoreAuthzException(final String code, final Severity severity, final String message, final int status, @@ -114,9 +114,9 @@ public static void loadConfig() { * @param realm2set realm * @return CoreAuthnException */ - public DcCoreAuthzException realm(String realm2set) { + public PersoniumCoreAuthzException realm(String realm2set) { // クローンを作成 - return new DcCoreAuthzException(this.code, this.severity, this.message, this.status, realm2set, + return new PersoniumCoreAuthzException(this.code, this.severity, this.message, this.status, realm2set, AcceptableAuthScheme.ALL); } @@ -126,9 +126,9 @@ public DcCoreAuthzException realm(String realm2set) { * @param acceptableAuthScheme 認証を許可するAuthSchemeの種別 * @return CoreAuthnException */ - public DcCoreAuthzException realm(String realm2set, AcceptableAuthScheme acceptableAuthScheme) { + public PersoniumCoreAuthzException realm(String realm2set, AcceptableAuthScheme acceptableAuthScheme) { // クローンを作成 - return new DcCoreAuthzException(this.code, this.severity, + return new PersoniumCoreAuthzException(this.code, this.severity, this.message, this.status, realm2set, acceptableAuthScheme); } @@ -159,11 +159,11 @@ public Response createResponse() { /** * 原因例外を追加したものを作成して返します. * @param t 原因例外 - * @return DcCoreException + * @return PersoniumCoreException */ - public DcCoreException reason(final Throwable t) { + public PersoniumCoreException reason(final Throwable t) { // クローンを作成して - DcCoreException ret = new DcCoreAuthzException( + PersoniumCoreException ret = new PersoniumCoreAuthzException( this.code, this.severity, this.message, this.status, this.realm, this.authScheme); // スタックトレースをセット ret.setStackTrace(t.getStackTrace()); @@ -172,22 +172,22 @@ public DcCoreException reason(final Throwable t) { /** * ファクトリーメソッド. - * @param code DCメッセージコード - * @return DcCoreException + * @param code Personium message code + * @return PersoniumCoreException */ - public static DcCoreAuthzException create(String code) { - int statusCode = DcCoreException.parseCode(code); + public static PersoniumCoreAuthzException create(String code) { + int statusCode = PersoniumCoreException.parseCode(code); // ログレベルの取得 - Severity severity = DcCoreMessageUtils.getSeverity(code); + Severity severity = PersoniumCoreMessageUtils.getSeverity(code); if (severity == null) { // ログレベルが設定されていなかったらレスポンスコードから自動的に判定する。 severity = decideSeverity(statusCode); } // ログメッセージの取得 - String message = DcCoreMessageUtils.getMessage(code); + String message = PersoniumCoreMessageUtils.getMessage(code); - return new DcCoreAuthzException(code, severity, message, statusCode, null, AcceptableAuthScheme.ALL); + return new PersoniumCoreAuthzException(code, severity, message, statusCode, null, AcceptableAuthScheme.ALL); } } diff --git a/src/main/java/com/fujitsu/dc/core/DcCoreException.java b/src/main/java/io/personium/core/PersoniumCoreException.java similarity index 54% rename from src/main/java/com/fujitsu/dc/core/DcCoreException.java rename to src/main/java/io/personium/core/PersoniumCoreException.java index ed185c8ac..150086599 100644 --- a/src/main/java/com/fujitsu/dc/core/DcCoreException.java +++ b/src/main/java/io/personium/core/PersoniumCoreException.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core; +package io.personium.core; import java.text.MessageFormat; import java.util.regex.Matcher; @@ -25,15 +25,15 @@ import org.apache.http.HttpStatus; -import com.fujitsu.dc.core.DcCoreMessageUtils.Severity; -import com.fujitsu.dc.core.exceptions.ODataErrorMessage; -import com.fujitsu.dc.core.utils.EscapeControlCode; +import io.personium.core.PersoniumCoreMessageUtils.Severity; +import io.personium.core.exceptions.ODataErrorMessage; +import io.personium.core.utils.EscapeControlCode; /** * ログメッセージ作成クラス. */ @SuppressWarnings("serial") -public class DcCoreException extends RuntimeException { +public class PersoniumCoreException extends RuntimeException { /** * OData関連. @@ -42,302 +42,302 @@ public static class OData { /** * JSONのパースに失敗したとき. */ - public static final DcCoreException JSON_PARSE_ERROR = create("PR400-OD-0001"); + public static final PersoniumCoreException JSON_PARSE_ERROR = create("PR400-OD-0001"); /** * クエリのパースに失敗. */ - public static final DcCoreException QUERY_PARSE_ERROR = create("PR400-OD-0002"); + public static final PersoniumCoreException QUERY_PARSE_ERROR = create("PR400-OD-0002"); /** * $fileterのパースに失敗. */ - public static final DcCoreException FILTER_PARSE_ERROR = create("PR400-OD-0003"); + public static final PersoniumCoreException FILTER_PARSE_ERROR = create("PR400-OD-0003"); /** * EntityKeyのパースに失敗. */ - public static final DcCoreException ENTITY_KEY_PARSE_ERROR = create("PR400-OD-0004"); + public static final PersoniumCoreException ENTITY_KEY_PARSE_ERROR = create("PR400-OD-0004"); /** * $formatに指定された値が不正. */ - public static final DcCoreException FORMAT_INVALID_ERROR = create("PR400-OD-0005"); + public static final PersoniumCoreException FORMAT_INVALID_ERROR = create("PR400-OD-0005"); /** * リクエストデータのフォーマットが不正. * {0}プロパティ名 */ - public static final DcCoreException REQUEST_FIELD_FORMAT_ERROR = create("PR400-OD-0006"); + public static final PersoniumCoreException REQUEST_FIELD_FORMAT_ERROR = create("PR400-OD-0006"); /** * リクエストボディのフィールド名が不正. * {0}:詳細メッセージ * 管理情報を更新しようとした時と、スキーマに存在しない値を設定しようとした時に発生 * 注)このエラーはメッセージをソースで管理することになるため、今後はこれを使わないこと。 */ - public static final DcCoreException FIELED_INVALID_ERROR = create("PR400-OD-0007"); + public static final PersoniumCoreException FIELED_INVALID_ERROR = create("PR400-OD-0007"); /** * 該当Associationが存在しない. */ - public static final DcCoreException NO_SUCH_ASSOCIATION = create("PR400-OD-0008"); + public static final PersoniumCoreException NO_SUCH_ASSOCIATION = create("PR400-OD-0008"); /** * リクエストボディの必須項目が無い. * {0}:プロパティ名 */ - public static final DcCoreException INPUT_REQUIRED_FIELD_MISSING = create("PR400-OD-0009"); + public static final PersoniumCoreException INPUT_REQUIRED_FIELD_MISSING = create("PR400-OD-0009"); /** * リクエストボディの必須項目が無い. */ - public static final DcCoreException KEY_FOR_NAVPROP_SHOULD_NOT_BE_SPECIFIED = create("PR400-OD-0010"); + public static final PersoniumCoreException KEY_FOR_NAVPROP_SHOULD_NOT_BE_SPECIFIED = create("PR400-OD-0010"); /** * リクエストURLのKey指定が無い. */ - public static final DcCoreException KEY_FOR_NAVPROP_SHOULD_BE_SPECIFIED = create("PR400-OD-0011"); + public static final PersoniumCoreException KEY_FOR_NAVPROP_SHOULD_BE_SPECIFIED = create("PR400-OD-0011"); /** * 文字種が不正. * {0}:プロパティ名 */ - public static final DcCoreException INVALID_TYPE_ERROR = create("PR400-OD-0012"); + public static final PersoniumCoreException INVALID_TYPE_ERROR = create("PR400-OD-0012"); /** * $inlinecountに指定された値が不正. * {0}:inlinecountで指定された値 */ - public static final DcCoreException INLINECOUNT_PARSE_ERROR = create("PR400-OD-0013"); + public static final PersoniumCoreException INLINECOUNT_PARSE_ERROR = create("PR400-OD-0013"); /** * 指定されたプロパティが存在しない. */ - public static final DcCoreException UNKNOWN_PROPERTY_APPOINTED = create("PR400-OD-0014"); + public static final PersoniumCoreException UNKNOWN_PROPERTY_APPOINTED = create("PR400-OD-0014"); /** * $orderbyのパースに失敗. */ - public static final DcCoreException ORDERBY_PARSE_ERROR = create("PR400-OD-0015"); + public static final PersoniumCoreException ORDERBY_PARSE_ERROR = create("PR400-OD-0015"); /** * 単一Keyにnullが指定された. */ - public static final DcCoreException NULL_SINGLE_KEY = create("PR400-OD-0016"); + public static final PersoniumCoreException NULL_SINGLE_KEY = create("PR400-OD-0016"); /** * $selectのパースに失敗. */ - public static final DcCoreException SELECT_PARSE_ERROR = create("PR400-OD-0017"); + public static final PersoniumCoreException SELECT_PARSE_ERROR = create("PR400-OD-0017"); /** * AssociationEndの更新がリクエストされた. */ - public static final DcCoreException NOT_PUT_ASSOCIATIONEND = create("PR400-OD-0019"); + public static final PersoniumCoreException NOT_PUT_ASSOCIATIONEND = create("PR400-OD-0019"); /** * 登録するデータの型がelasticsearchに登録済みのデータ型と異なる. */ - public static final DcCoreException SCHEMA_MISMATCH = create("PR400-OD-0020"); + public static final PersoniumCoreException SCHEMA_MISMATCH = create("PR400-OD-0020"); /** * $batchのボディのFormatが不正. * ヘッダの指定誤り * {0}:ヘッダ名 */ - public static final DcCoreException BATCH_BODY_FORMAT_HEADER_ERROR = create("PR400-OD-0021"); + public static final PersoniumCoreException BATCH_BODY_FORMAT_HEADER_ERROR = create("PR400-OD-0021"); /** * $batchのボディのFormatが不正. * changesetのネストが指定されていた場合 */ - public static final DcCoreException BATCH_BODY_FORMAT_CHANGESET_NEST_ERROR = create("PR400-OD-0022"); + public static final PersoniumCoreException BATCH_BODY_FORMAT_CHANGESET_NEST_ERROR = create("PR400-OD-0022"); /** * $batchのボディのパースに失敗した場合. */ - public static final DcCoreException BATCH_BODY_PARSE_ERROR = create("PR400-OD-0023"); + public static final PersoniumCoreException BATCH_BODY_PARSE_ERROR = create("PR400-OD-0023"); /** * 更新リクエストでボディのNTKPに指定されたリソースが存在しない場合. * {0}:NTKPで指定された値 */ - public static final DcCoreException BODY_NTKP_NOT_FOUND_ERROR = create("PR400-OD-0024"); + public static final PersoniumCoreException BODY_NTKP_NOT_FOUND_ERROR = create("PR400-OD-0024"); /** * $expandで指定されたNTKPがリソースとして存在しない場合. * {0}:$expandで指定された値 */ - public static final DcCoreException EXPAND_NTKP_NOT_FOUND_ERROR = create("PR400-OD-0025"); + public static final PersoniumCoreException EXPAND_NTKP_NOT_FOUND_ERROR = create("PR400-OD-0025"); /** * $expandのパースに失敗. */ - public static final DcCoreException EXPAND_PARSE_ERROR = create("PR400-OD-0026"); + public static final PersoniumCoreException EXPAND_PARSE_ERROR = create("PR400-OD-0026"); /** * すでに別のスキーマ型のIndexが作成されている場合. */ - public static final DcCoreException ANOTHRE_SCHEMA_TYPE_ALREADY_EXISTS = create("PR400-OD-0027"); + public static final PersoniumCoreException ANOTHRE_SCHEMA_TYPE_ALREADY_EXISTS = create("PR400-OD-0027"); /** * $linksのEntityKeyのパースに失敗. */ - public static final DcCoreException ENTITY_KEY_LINKS_PARSE_ERROR = create("PR400-OD-0028"); + public static final PersoniumCoreException ENTITY_KEY_LINKS_PARSE_ERROR = create("PR400-OD-0028"); /** * クエリに指定された値が不正. */ - public static final DcCoreException QUERY_INVALID_ERROR = create("PR400-OD-0029"); + public static final PersoniumCoreException QUERY_INVALID_ERROR = create("PR400-OD-0029"); /** * $Batchで指定されたリクエスト数が不正. */ - public static final DcCoreException TOO_MANY_REQUESTS = create("PR400-OD-0030"); + public static final PersoniumCoreException TOO_MANY_REQUESTS = create("PR400-OD-0030"); /** * $links登録で1:1を指定. */ - public static final DcCoreException INVALID_MULTIPLICITY = create("PR400-OD-0031"); + public static final PersoniumCoreException INVALID_MULTIPLICITY = create("PR400-OD-0031"); /** * EnitityTypeの階層数、内包プロパティ数の制限を超えた. */ - public static final DcCoreException ENTITYTYPE_STRUCTUAL_LIMITATION_EXCEEDED = create("PR400-OD-0032"); + public static final PersoniumCoreException ENTITYTYPE_STRUCTUAL_LIMITATION_EXCEEDED = create("PR400-OD-0032"); /** * EnitityType数の制限を超えた. */ - public static final DcCoreException ENTITYTYPE_COUNT_LIMITATION_EXCEEDED = create("PR400-OD-0033"); + public static final PersoniumCoreException ENTITYTYPE_COUNT_LIMITATION_EXCEEDED = create("PR400-OD-0033"); /** * $batchのボディのFormatが不正. * リクエストパスの指定誤り * {0}:リクエストパス */ - public static final DcCoreException BATCH_BODY_FORMAT_PATH_ERROR = create("PR400-OD-0034"); + public static final PersoniumCoreException BATCH_BODY_FORMAT_PATH_ERROR = create("PR400-OD-0034"); /** * $batchのボディのFormatが不正. * $batchで受付できないメソッドを指定された * {0}:メソッド */ - public static final DcCoreException BATCH_BODY_FORMAT_METHOD_ERROR = create("PR400-OD-0035"); + public static final PersoniumCoreException BATCH_BODY_FORMAT_METHOD_ERROR = create("PR400-OD-0035"); /** * クエリのパースに失敗. * {0}:失敗したクエリ */ - public static final DcCoreException QUERY_PARSE_ERROR_WITH_PARAM = create("PR400-OD-0036"); + public static final PersoniumCoreException QUERY_PARSE_ERROR_WITH_PARAM = create("PR400-OD-0036"); /** * $batch内全体で指定された$topの値の合計が上限値を超えた. */ - public static final DcCoreException BATCH_TOTAL_TOP_COUNT_LIMITATION_EXCEEDED = create("PR400-OD-0037"); + public static final PersoniumCoreException BATCH_TOTAL_TOP_COUNT_LIMITATION_EXCEEDED = create("PR400-OD-0037"); /** * $linksが作成可能な最大件数をオーバー. */ - public static final DcCoreException LINK_UPPER_LIMIT_RECORD_EXEED = create("PR400-OD-0038"); + public static final PersoniumCoreException LINK_UPPER_LIMIT_RECORD_EXEED = create("PR400-OD-0038"); /** * 指定された$expandの値の合計が上限値を超えた. */ - public static final DcCoreException EXPAND_COUNT_LIMITATION_EXCEEDED = create("PR400-OD-0039"); + public static final PersoniumCoreException EXPAND_COUNT_LIMITATION_EXCEEDED = create("PR400-OD-0039"); /** * $orderbyクエリに配列型のプロパティが指定された. */ - public static final DcCoreException CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY = create("PR400-OD-0040"); + public static final PersoniumCoreException CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY = create("PR400-OD-0040"); /** * リクエストヘッダー{0}の値{1}が正しくない. */ - public static final DcCoreException BAD_REQUEST_HEADER_VALUE = create("PR400-OD-0041"); + public static final PersoniumCoreException BAD_REQUEST_HEADER_VALUE = create("PR400-OD-0041"); /** * 未サポートの操作が実行された 詳細:{0}. */ - public static final DcCoreException OPERATION_NOT_SUPPORTED = create("PR400-OD-0042"); + public static final PersoniumCoreException OPERATION_NOT_SUPPORTED = create("PR400-OD-0042"); /** * 未知の演算子が指定された場合. */ - public static final DcCoreException UNSUPPORTED_QUERY_OPERATOR = create("PR400-OD-0043"); + public static final PersoniumCoreException UNSUPPORTED_QUERY_OPERATOR = create("PR400-OD-0043"); /** * 未知の関数が指定された場合. */ - public static final DcCoreException UNSUPPORTED_QUERY_FUNCTION = create("PR400-OD-0044"); + public static final PersoniumCoreException UNSUPPORTED_QUERY_FUNCTION = create("PR400-OD-0044"); /** * 未知のプロパティを指定した場合. */ - public static final DcCoreException UNKNOWN_QUERY_KEY = create("PR400-OD-0045"); + public static final PersoniumCoreException UNKNOWN_QUERY_KEY = create("PR400-OD-0045"); /** * プロパティのデータ型とは異なる書式の値が指定された場合. */ - public static final DcCoreException OPERATOR_AND_OPERAND_TYPE_MISMATCHED = create("PR400-OD-0046"); + public static final PersoniumCoreException OPERATOR_AND_OPERAND_TYPE_MISMATCHED = create("PR400-OD-0046"); /** * プロパティのデータ型の範囲外の値が指定された場合. */ - public static final DcCoreException UNSUPPORTED_OPERAND_FORMAT = create("PR400-OD-0047"); + public static final PersoniumCoreException UNSUPPORTED_OPERAND_FORMAT = create("PR400-OD-0047"); /** * 検索値のアンエスケープができなかった場合. */ - public static final DcCoreException OPERATOR_AND_OPERAND_UNABLE_TO_UNESCAPE = create("PR400-OD-0048"); + public static final PersoniumCoreException OPERATOR_AND_OPERAND_UNABLE_TO_UNESCAPE = create("PR400-OD-0048"); /** * Cell URL Invalid format. * {0} property name */ - public static final DcCoreException CELL_URL_FORMAT_ERROR = create("PR400-OD-0049"); + public static final PersoniumCoreException CELL_URL_FORMAT_ERROR = create("PR400-OD-0049"); /** * Schema URI Invalid format. * {0} property name */ - public static final DcCoreException SCHEMA_URI_FORMAT_ERROR = create("PR400-OD-0050"); + public static final PersoniumCoreException SCHEMA_URI_FORMAT_ERROR = create("PR400-OD-0050"); /** * 該当EntitySetが存在しない. */ - public static final DcCoreException NO_SUCH_ENTITY_SET = create("PR404-OD-0001"); + public static final PersoniumCoreException NO_SUCH_ENTITY_SET = create("PR404-OD-0001"); /** * 該当Entityが存在しない. */ - public static final DcCoreException NO_SUCH_ENTITY = create("PR404-OD-0002"); + public static final PersoniumCoreException NO_SUCH_ENTITY = create("PR404-OD-0002"); /** * 該当リソースが存在しない. */ - public static final DcCoreException NOT_FOUND = create("PR404-OD-0000"); + public static final PersoniumCoreException NOT_FOUND = create("PR404-OD-0000"); /** * 該当Navigation Propertyが存在しない. */ - public static final DcCoreException NOT_SUCH_NAVPROP = create("PR404-OD-0003"); + public static final PersoniumCoreException NOT_SUCH_NAVPROP = create("PR404-OD-0003"); /** * 関係するデータが存在するエンティティへの操作. */ - public static final DcCoreException CONFLICT_HAS_RELATED = create("PR409-OD-0001"); + public static final PersoniumCoreException CONFLICT_HAS_RELATED = create("PR409-OD-0001"); /** * リンクが既に存在する. */ - public static final DcCoreException CONFLICT_LINKS = create("PR409-OD-0002"); + public static final PersoniumCoreException CONFLICT_LINKS = create("PR409-OD-0002"); /** * エンティティが既に存在する. */ - public static final DcCoreException ENTITY_ALREADY_EXISTS = create("PR409-OD-0003"); + public static final PersoniumCoreException ENTITY_ALREADY_EXISTS = create("PR409-OD-0003"); /** * 複合キーのエンティティに対して$linksを削除した時に同名のエンティティが既に存在する. */ - public static final DcCoreException CONFLICT_UNLINKED_ENTITY = create("PR409-OD-0004"); + public static final PersoniumCoreException CONFLICT_UNLINKED_ENTITY = create("PR409-OD-0004"); /** * 単一キーのエンティティに対して$linksを追加した時に同名のエンティティが既に存在する. */ - public static final DcCoreException CONFLICT_DUPLICATED_ENTITY = create("PR409-OD-0005"); + public static final PersoniumCoreException CONFLICT_DUPLICATED_ENTITY = create("PR409-OD-0005"); /** * AssociationEndのLink登録時にすでに同一の関連が存在する. */ - public static final DcCoreException CONFLICT_DUPLICATED_ENTITY_RELATION = create("PR409-OD-0006"); + public static final PersoniumCoreException CONFLICT_DUPLICATED_ENTITY_RELATION = create("PR409-OD-0006"); /** * If-Matchヘッダの指定が無い. */ - public static final DcCoreException HEADER_NOT_EXIST = create("PR412-OD-0001"); + public static final PersoniumCoreException HEADER_NOT_EXIST = create("PR412-OD-0001"); /** * 該当EntityのEtagがマッチしない. */ - public static final DcCoreException ETAG_NOT_MATCH = create("PR412-OD-0002"); + public static final PersoniumCoreException ETAG_NOT_MATCH = create("PR412-OD-0002"); /** * . */ - public static final DcCoreException CONFLICT_NP = create("PR412-OD-0003"); + public static final PersoniumCoreException CONFLICT_NP = create("PR412-OD-0003"); /** * 未サポートのメディアタイプが指定された. */ - public static final DcCoreException UNSUPPORTED_MEDIA_TYPE = create("PR415-OD-0001"); + public static final PersoniumCoreException UNSUPPORTED_MEDIA_TYPE = create("PR415-OD-0001"); /** * プロパティ名の重複を検出した. */ - public static final DcCoreException DUPLICATED_PROPERTY_NAME = create("PR500-OD-0001"); + public static final PersoniumCoreException DUPLICATED_PROPERTY_NAME = create("PR500-OD-0001"); /** * 内部データの矛盾を検出した. */ - public static final DcCoreException DETECTED_INTERNAL_DATA_CONFLICT = create("PR500-OD-0002"); + public static final PersoniumCoreException DETECTED_INTERNAL_DATA_CONFLICT = create("PR500-OD-0002"); } /** @@ -349,145 +349,145 @@ public static class Dav { /** * XMLのパースに失敗したとき. */ - public static final DcCoreException XML_ERROR = create("PR400-DV-0001"); + public static final PersoniumCoreException XML_ERROR = create("PR400-DV-0001"); /** * XMLの内容がおかしいとき. */ - public static final DcCoreException XML_CONTENT_ERROR = create("PR400-DV-0002"); + public static final PersoniumCoreException XML_CONTENT_ERROR = create("PR400-DV-0002"); /** * Depthが0,1,infinity以外のとき. * {0}:Depthヘッダの値 */ - public static final DcCoreException INVALID_DEPTH_HEADER = create("PR400-DV-0003"); + public static final PersoniumCoreException INVALID_DEPTH_HEADER = create("PR400-DV-0003"); /** * ROLEが存在しない時. */ - public static final DcCoreException ROLE_NOT_FOUND = create("PR400-DV-0004"); + public static final PersoniumCoreException ROLE_NOT_FOUND = create("PR400-DV-0004"); /** * Roleと紐付くBOXが存在しないとき. * {0}:BOX URL */ - public static final DcCoreException BOX_LINKED_BY_ROLE_NOT_FOUND = create("PR400-DV-0005"); + public static final PersoniumCoreException BOX_LINKED_BY_ROLE_NOT_FOUND = create("PR400-DV-0005"); /** * XMLのバリデートに失敗したとき. */ - public static final DcCoreException XML_VALIDATE_ERROR = create("PR400-DV-0006"); + public static final PersoniumCoreException XML_VALIDATE_ERROR = create("PR400-DV-0006"); /** * コレクションの子要素が多すぎる場合. */ - public static final DcCoreException COLLECTION_CHILDRESOURCE_ERROR = create("PR400-DV-0007"); + public static final PersoniumCoreException COLLECTION_CHILDRESOURCE_ERROR = create("PR400-DV-0007"); /** * コレクションの階層が深すぎる場合. */ - public static final DcCoreException COLLECTION_DEPTH_ERROR = create("PR400-DV-0008"); + public static final PersoniumCoreException COLLECTION_DEPTH_ERROR = create("PR400-DV-0008"); /** * ヘッダに不正な値が設定されている場合. * {0}:ヘッダのキー * {1}:ヘッダの値 */ - public static final DcCoreException INVALID_REQUEST_HEADER = create("PR400-DV-0009"); + public static final PersoniumCoreException INVALID_REQUEST_HEADER = create("PR400-DV-0009"); /** * 必須ヘッダの指定が無い場合. * {0}:ヘッダのキー */ - public static final DcCoreException REQUIRED_REQUEST_HEADER_NOT_EXIST = create("PR400-DV-0010"); + public static final PersoniumCoreException REQUIRED_REQUEST_HEADER_NOT_EXIST = create("PR400-DV-0010"); /** * 移動元のリソースとして__srcが指定された場合. */ - public static final DcCoreException SERVICE_SOURCE_COLLECTION_PROHIBITED_TO_MOVE = create("PR400-DV-0011"); + public static final PersoniumCoreException SERVICE_SOURCE_COLLECTION_PROHIBITED_TO_MOVE = create("PR400-DV-0011"); /** * 移動先のリソースとして、既存のリソースが指定された場合. */ - public static final DcCoreException RESOURCE_PROHIBITED_TO_OVERWRITE = create("PR400-DV-0012"); + public static final PersoniumCoreException RESOURCE_PROHIBITED_TO_OVERWRITE = create("PR400-DV-0012"); /** * 移動先のリソースとして、ODataコレクション配下のパスが指定された場合. */ - public static final DcCoreException RESOURCE_PROHIBITED_TO_MOVE_ODATA_COLLECTION = create("PR400-DV-0013"); + public static final PersoniumCoreException RESOURCE_PROHIBITED_TO_MOVE_ODATA_COLLECTION = create("PR400-DV-0013"); /** * 移動先のリソースとして、ファイル配下のパスが指定された場合. */ - public static final DcCoreException RESOURCE_PROHIBITED_TO_MOVE_FILE = create("PR400-DV-0014"); + public static final PersoniumCoreException RESOURCE_PROHIBITED_TO_MOVE_FILE = create("PR400-DV-0014"); /** * BoxはMOVEメソッドでの移動対象とはできない. */ - public static final DcCoreException RESOURCE_PROHIBITED_TO_MOVE_BOX = create("PR400-DV-0015"); + public static final PersoniumCoreException RESOURCE_PROHIBITED_TO_MOVE_BOX = create("PR400-DV-0015"); /** * 移動先のリソースとして、Serviceコレクション配下のパスが指定された場合. */ - public static final DcCoreException RESOURCE_PROHIBITED_TO_MOVE_SERVICE_COLLECTION = create("PR400-DV-0016"); + public static final PersoniumCoreException RESOURCE_PROHIBITED_TO_MOVE_SERVICE_COLLECTION = create("PR400-DV-0016"); /** * 移動先のリソースとして__srcが指定された場合. */ - public static final DcCoreException SERVICE_SOURCE_COLLECTION_PROHIBITED_TO_OVERWRITE = create("PR400-DV-0017"); + public static final PersoniumCoreException SERVICE_SOURCE_COLLECTION_PROHIBITED_TO_OVERWRITE = create("PR400-DV-0017"); /** * 移動元がコレクションで、移動先のリソースとしてサービスソースコレクションが指定された場合. */ - public static final DcCoreException SERVICE_SOURCE_COLLECTION_PROHIBITED_TO_CONTAIN_COLLECTION = + public static final PersoniumCoreException SERVICE_SOURCE_COLLECTION_PROHIBITED_TO_CONTAIN_COLLECTION = create("PR400-DV-0018"); /** * リソースが存在しないとき. */ - public static final DcCoreException RESOURCE_NOT_FOUND = create("PR404-DV-0001"); + public static final PersoniumCoreException RESOURCE_NOT_FOUND = create("PR404-DV-0001"); /** * BOXが存在しないとき. * {0}:BOX名 */ - public static final DcCoreException BOX_NOT_FOUND = create("PR404-DV-0002"); + public static final PersoniumCoreException BOX_NOT_FOUND = create("PR404-DV-0002"); /** * CELLが存在しないとき. */ - public static final DcCoreException CELL_NOT_FOUND = create("PR404-DV-0003"); + public static final PersoniumCoreException CELL_NOT_FOUND = create("PR404-DV-0003"); /** * メソッドが受け付けられないとき. */ - public static final DcCoreException METHOD_NOT_ALLOWED = create("PR405-DV-0001"); + public static final PersoniumCoreException METHOD_NOT_ALLOWED = create("PR405-DV-0001"); /** * Depthがinfinityのとき. */ - public static final DcCoreException PROPFIND_FINITE_DEPTH = create("PR403-DV-0001"); + public static final PersoniumCoreException PROPFIND_FINITE_DEPTH = create("PR403-DV-0001"); /** * コレクション削除時に子リソースがある場合は削除失敗. */ - public static final DcCoreException HAS_CHILDREN = create("PR403-DV-0003"); + public static final PersoniumCoreException HAS_CHILDREN = create("PR403-DV-0003"); /** * コレクション・ファイル名が不正なとき. */ - public static final DcCoreException RESOURCE_NAME_INVALID = create("PR403-DV-0004"); + public static final PersoniumCoreException RESOURCE_NAME_INVALID = create("PR403-DV-0004"); /** * 移動元と移動先が同じ場合. * {0}:Destination ヘッダの値 */ - public static final DcCoreException DESTINATION_EQUALS_SOURCE_URL = create("PR403-DV-0005"); + public static final PersoniumCoreException DESTINATION_EQUALS_SOURCE_URL = create("PR403-DV-0005"); /** * コレクション・ファイルのPUT・MKCOL・MOVE時に親リソースが存在しない時. */ - public static final DcCoreException HAS_NOT_PARENT = create("PR409-DV-0001"); + public static final PersoniumCoreException HAS_NOT_PARENT = create("PR409-DV-0001"); /** * 該当リソースのEtagがマッチしない. */ - public static final DcCoreException ETAG_NOT_MATCH = create("PR412-DV-0001"); + public static final PersoniumCoreException ETAG_NOT_MATCH = create("PR412-DV-0001"); /** * Overwriteヘッダで"F"が指定されたが移動先のリソースが既に存在する時. */ - public static final DcCoreException DESTINATION_ALREADY_EXISTS = create("PR412-DV-0002"); + public static final PersoniumCoreException DESTINATION_ALREADY_EXISTS = create("PR412-DV-0002"); /** * Rangeヘッダ指定誤り. */ - public static final DcCoreException REQUESTED_RANGE_NOT_SATISFIABLE = create("PR416-DV-0001"); + public static final PersoniumCoreException REQUESTED_RANGE_NOT_SATISFIABLE = create("PR416-DV-0001"); /** * ファイルシステムの矛盾を検知. */ - public static final DcCoreException FS_INCONSISTENCY_FOUND = create("PR500-DV-0001"); + public static final PersoniumCoreException FS_INCONSISTENCY_FOUND = create("PR500-DV-0001"); /** * Boxから辿ってidで検索して、Davデータに不整合があった場合. */ - public static final DcCoreException DAV_INCONSISTENCY_FOUND = create("PR500-DV-0002"); + public static final PersoniumCoreException DAV_INCONSISTENCY_FOUND = create("PR500-DV-0002"); /** * Boxから辿ってidで検索して、Davデータに不整合があった場合. */ - public static final DcCoreException DAV_UNAVAILABLE = create("PR503-DV-0001"); + public static final PersoniumCoreException DAV_UNAVAILABLE = create("PR503-DV-0001"); } /** @@ -495,30 +495,30 @@ public static class Dav { */ public static class ServiceCollection { /** - * DC-Engineの接続に失敗した場合. + * Personium-Engineの接続に失敗した場合. */ - public static final DcCoreException SC_ENGINE_CONNECTION_ERROR = create("PR500-SC-0001"); + public static final PersoniumCoreException SC_ENGINE_CONNECTION_ERROR = create("PR500-SC-0001"); /** * ファイルのオープンに失敗した場合(未使用_実装内容に言及しているため、使用しないこと). */ - public static final DcCoreException SC_FILE_OPEN_ERROR = create("PR500-SC-0002"); + public static final PersoniumCoreException SC_FILE_OPEN_ERROR = create("PR500-SC-0002"); /** * ファイルのクローズに失敗した場合(未使用_実装内容に言及しているため、使用しないこと). */ - public static final DcCoreException SC_FILE_CLOSE_ERROR = create("PR500-SC-0003"); + public static final PersoniumCoreException SC_FILE_CLOSE_ERROR = create("PR500-SC-0003"); /** * ファイルのクローズに失敗した場合(未使用_実装内容に言及しているため、使用しないこと). */ - public static final DcCoreException SC_IO_ERROR = create("PR500-SC-0004"); + public static final PersoniumCoreException SC_IO_ERROR = create("PR500-SC-0004"); /** * その他のエラー. */ - public static final DcCoreException SC_UNKNOWN_ERROR = create("PR500-SC-0005"); + public static final PersoniumCoreException SC_UNKNOWN_ERROR = create("PR500-SC-0005"); /** * サービス呼出しで不正なHTTPレスポンスが返却された場合のエラー. */ - public static final DcCoreException SC_INVALID_HTTP_RESPONSE_ERROR = create("PR500-SC-0006"); + public static final PersoniumCoreException SC_INVALID_HTTP_RESPONSE_ERROR = create("PR500-SC-0006"); } /** @@ -529,25 +529,25 @@ public static class SentMessage { * ToRelationに指定されたリソースが存在しない場合. * {0}:指定された値 */ - public static final DcCoreException TO_RELATION_NOT_FOUND_ERROR = create("PR400-SM-0001"); + public static final PersoniumCoreException TO_RELATION_NOT_FOUND_ERROR = create("PR400-SM-0001"); /** * ToRelationに指定されたリソースに紐付くExtCellが存在しない場合. * {0}:指定された値 */ - public static final DcCoreException RELATED_EXTCELL_NOT_FOUND_ERROR = create("PR400-SM-0002"); + public static final PersoniumCoreException RELATED_EXTCELL_NOT_FOUND_ERROR = create("PR400-SM-0002"); /** * 送信先URLが最大送信許可数を超えた場合. */ - public static final DcCoreException OVER_MAX_SENT_NUM = create("PR400-SM-0003"); + public static final PersoniumCoreException OVER_MAX_SENT_NUM = create("PR400-SM-0003"); /** * リクエストに失敗した場合. */ - public static final DcCoreException SM_CONNECTION_ERROR = create("PR500-SM-0001"); + public static final PersoniumCoreException SM_CONNECTION_ERROR = create("PR500-SM-0001"); /** * ボディのパースに失敗した場合. */ - public static final DcCoreException SM_BODY_PARSE_ERROR = create("PR500-SM-0002"); + public static final PersoniumCoreException SM_BODY_PARSE_ERROR = create("PR500-SM-0002"); } /** @@ -557,31 +557,31 @@ public static class ReceiveMessage { /** * メッセージの関係登録で既に関係が存在する. */ - public static final DcCoreException REQUEST_RELATION_EXISTS_ERROR = create("PR400-RM-0001"); + public static final PersoniumCoreException REQUEST_RELATION_EXISTS_ERROR = create("PR400-RM-0001"); /** * メッセージのRequestRelationのパースに失敗. */ - public static final DcCoreException REQUEST_RELATION_PARSE_ERROR = create("PR409-RM-0001"); + public static final PersoniumCoreException REQUEST_RELATION_PARSE_ERROR = create("PR409-RM-0001"); /** * 関係削除対象のRelationが存在しない. */ - public static final DcCoreException REQUEST_RELATION_DOES_NOT_EXISTS = create("PR409-RM-0002"); + public static final PersoniumCoreException REQUEST_RELATION_DOES_NOT_EXISTS = create("PR409-RM-0002"); /** * メッセージのRequestRelationTargetのパースに失敗. */ - public static final DcCoreException REQUEST_RELATION_TARGET_PARSE_ERROR = create("PR409-RM-0003"); + public static final PersoniumCoreException REQUEST_RELATION_TARGET_PARSE_ERROR = create("PR409-RM-0003"); /** * 関係削除対象のExtCellが存在しない. */ - public static final DcCoreException REQUEST_RELATION_TARGET_DOES_NOT_EXISTS = create("PR409-RM-0004"); + public static final PersoniumCoreException REQUEST_RELATION_TARGET_DOES_NOT_EXISTS = create("PR409-RM-0004"); /** * RequestRelationとRequestRelationTargetのリンク情報が存在しない. */ - public static final DcCoreException LINK_DOES_NOT_EXISTS = create("PR409-RM-0005"); + public static final PersoniumCoreException LINK_DOES_NOT_EXISTS = create("PR409-RM-0005"); } /** @@ -592,56 +592,56 @@ public static class Server { /** * 原因不明のエラー. */ - public static final DcCoreException UNKNOWN_ERROR = create("PR500-SV-0000"); + public static final PersoniumCoreException UNKNOWN_ERROR = create("PR500-SV-0000"); /** * データストアへの接続に失敗したとき. */ - public static final DcCoreException DATA_STORE_CONNECTION_ERROR = create("PR500-SV-0001"); + public static final PersoniumCoreException DATA_STORE_CONNECTION_ERROR = create("PR500-SV-0001"); /** * データストア関連の不明なエラー. */ - public static final DcCoreException DATA_STORE_UNKNOWN_ERROR = create("PR500-SV-0002"); + public static final PersoniumCoreException DATA_STORE_UNKNOWN_ERROR = create("PR500-SV-0002"); /** * ESへのリクエストでリトライオーバーしたとき. */ - public static final DcCoreException ES_RETRY_OVER = create("PR500-SV-0003"); + public static final PersoniumCoreException ES_RETRY_OVER = create("PR500-SV-0003"); /** * ファイルシステムに異常が発生したとき. */ - public static final DcCoreException FILE_SYSTEM_ERROR = create("PR500-SV-0004"); + public static final PersoniumCoreException FILE_SYSTEM_ERROR = create("PR500-SV-0004"); /** * データストアの検索に失敗. */ - public static final DcCoreException DATA_STORE_SEARCH_ERROR = create("PR500-SV-0005"); + public static final PersoniumCoreException DATA_STORE_SEARCH_ERROR = create("PR500-SV-0005"); /** * データストアの更新に失敗し、ロールバックにも失敗した. */ - public static final DcCoreException DATA_STORE_UPDATE_ROLLBACK_ERROR = create("PR500-SV-0006"); + public static final PersoniumCoreException DATA_STORE_UPDATE_ROLLBACK_ERROR = create("PR500-SV-0006"); /** * データストアの更新に失敗し、ロールバックが成功した. */ - public static final DcCoreException DATA_STORE_UPDATE_ERROR_ROLLBACKED = create("PR500-SV-0007"); + public static final PersoniumCoreException DATA_STORE_UPDATE_ERROR_ROLLBACKED = create("PR500-SV-0007"); /** * memcachedへの接続に失敗したとき. */ - public static final DcCoreException SERVER_CONNECTION_ERROR = create("PR503-SV-0002"); + public static final PersoniumCoreException SERVER_CONNECTION_ERROR = create("PR503-SV-0002"); /** * Memcachedのロックステータス取得に失敗したとき. */ - public static final DcCoreException GET_LOCK_STATE_ERROR = create("PR503-SV-0003"); + public static final PersoniumCoreException GET_LOCK_STATE_ERROR = create("PR503-SV-0003"); /** * ユニットユーザ単位のデータリストア中のとき. */ - public static final DcCoreException SERVICE_MENTENANCE_RESTORE = create("PR503-SV-0004"); + public static final PersoniumCoreException SERVICE_MENTENANCE_RESTORE = create("PR503-SV-0004"); /** * ReadDeleteOnlyモード状態のとき. */ - public static final DcCoreException READ_DELETE_ONLY = create("PR503-SV-0005"); + public static final PersoniumCoreException READ_DELETE_ONLY = create("PR503-SV-0005"); /** * Adsへの接続に失敗したとき. */ - public static final DcCoreException ADS_CONNECTION_ERROR = create("PR503-SV-0006"); + public static final PersoniumCoreException ADS_CONNECTION_ERROR = create("PR503-SV-0006"); } /** @@ -651,19 +651,19 @@ public static class NetWork { /** * NetWork関連エラー. */ - public static final DcCoreException NETWORK_ERROR = create("PR500-NW-0000"); + public static final PersoniumCoreException NETWORK_ERROR = create("PR500-NW-0000"); /** * HTTPリクエストに失敗. */ - public static final DcCoreException HTTP_REQUEST_FAILED = create("PR500-NW-0001"); + public static final PersoniumCoreException HTTP_REQUEST_FAILED = create("PR500-NW-0001"); /** * 接続先が想定外の応答を返却. */ - public static final DcCoreException UNEXPECTED_RESPONSE = create("PR500-NW-0002"); + public static final PersoniumCoreException UNEXPECTED_RESPONSE = create("PR500-NW-0002"); /** * 接続先が想定外の値を返却. */ - public static final DcCoreException UNEXPECTED_VALUE = create("PR500-NW-0003"); + public static final PersoniumCoreException UNEXPECTED_VALUE = create("PR500-NW-0003"); } /** @@ -673,52 +673,52 @@ public static class Auth { /** * パスワード文字列が不正. */ - public static final DcCoreException PASSWORD_INVALID = create("PR400-AU-0001"); + public static final PersoniumCoreException PASSWORD_INVALID = create("PR400-AU-0001"); /** * リクエストパラメータが不正. */ - public static final DcCoreException REQUEST_PARAM_INVALID = create("PR400-AU-0002"); + public static final PersoniumCoreException REQUEST_PARAM_INVALID = create("PR400-AU-0002"); /** * パスワード文字列が不正. */ - public static final DcCoreException DC_CREDENTIAL_REQUIRED = create("PR400-AU-0003"); + public static final PersoniumCoreException P_CREDENTIAL_REQUIRED = create("PR400-AU-0003"); /** * ユニットユーザアクセスではない. */ - public static final DcCoreException UNITUSER_ACCESS_REQUIRED = create("PR403-AU-0001"); + public static final PersoniumCoreException UNITUSER_ACCESS_REQUIRED = create("PR403-AU-0001"); /** * 必要な権限が無い. */ - public static final DcCoreException NECESSARY_PRIVILEGE_LACKING = create("PR403-AU-0002"); + public static final PersoniumCoreException NECESSARY_PRIVILEGE_LACKING = create("PR403-AU-0002"); /** * 認証ヘッダに指定されたユニットユーザではアクセセスできない. */ - public static final DcCoreException NOT_YOURS = create("PR403-AU-0003"); + public static final PersoniumCoreException NOT_YOURS = create("PR403-AU-0003"); /** * スキーマ認証が必要. */ - public static final DcCoreException SCHEMA_AUTH_REQUIRED = create("PR403-AU-0004"); + public static final PersoniumCoreException SCHEMA_AUTH_REQUIRED = create("PR403-AU-0004"); /** * このスキーマ認証ではアクセスできない. */ - public static final DcCoreException SCHEMA_MISMATCH = create("PR403-AU-0005"); + public static final PersoniumCoreException SCHEMA_MISMATCH = create("PR403-AU-0005"); /** * スキーマ認証レベルが不足. */ - public static final DcCoreException INSUFFICIENT_SCHEMA_AUTHZ_LEVEL = create("PR403-AU-0006"); + public static final PersoniumCoreException INSUFFICIENT_SCHEMA_AUTHZ_LEVEL = create("PR403-AU-0006"); /** * ルートCA証明書の設定エラー. */ - public static final DcCoreException ROOT_CA_CRT_SETTING_ERROR = create("PR500-AN-0001"); + public static final PersoniumCoreException ROOT_CA_CRT_SETTING_ERROR = create("PR500-AN-0001"); /** * リクエストパラメータが不正. */ - public static final DcCoreException REQUEST_PARAM_CLIENTID_INVALID = create("PR400-AZ-0002"); + public static final PersoniumCoreException REQUEST_PARAM_CLIENTID_INVALID = create("PR400-AZ-0002"); /** * リクエストパラメータが不正. */ - public static final DcCoreException REQUEST_PARAM_REDIRECT_INVALID = create("PR400-AZ-0003"); + public static final PersoniumCoreException REQUEST_PARAM_REDIRECT_INVALID = create("PR400-AZ-0003"); } @@ -729,29 +729,29 @@ public static class Event { /** * JSONパースに失敗. */ - public static final DcCoreException JSON_PARSE_ERROR = create("PR400-EV-0001"); + public static final PersoniumCoreException JSON_PARSE_ERROR = create("PR400-EV-0001"); /** - * X-Dc-RequestKey の値が不正. + * X-Personium-RequestKey の値が不正. */ - public static final DcCoreException X_DC_REQUESTKEY_INVALID = create("PR400-EV-0002"); + public static final PersoniumCoreException X_PERSONIUM_REQUESTKEY_INVALID = create("PR400-EV-0002"); /** * リクエストボディの必須項目が無い. * {0}:プロパティ名 */ - public static final DcCoreException INPUT_REQUIRED_FIELD_MISSING = create("PR400-EV-0003"); + public static final PersoniumCoreException INPUT_REQUIRED_FIELD_MISSING = create("PR400-EV-0003"); /** * リクエストデータのフォーマットが不正. * {0}プロパティ名 */ - public static final DcCoreException REQUEST_FIELD_FORMAT_ERROR = create("PR400-EV-0004"); + public static final PersoniumCoreException REQUEST_FIELD_FORMAT_ERROR = create("PR400-EV-0004"); /** * Httpレスポンスの出力に失敗したとき. */ - public static final DcCoreException EVENT_RESPONSE_FAILED = create("PR500-EV-0001"); + public static final PersoniumCoreException EVENT_RESPONSE_FAILED = create("PR500-EV-0001"); /** * 圧縮されたイベントログファイルがオープンできないとき. */ - public static final DcCoreException ARCHIVE_FILE_CANNOT_OPEN = create("PR500-EV-0002"); + public static final PersoniumCoreException ARCHIVE_FILE_CANNOT_OPEN = create("PR500-EV-0002"); } @@ -762,47 +762,47 @@ public static class BarInstall { /** * リクエストヘッダーの値が不正なとき. */ - public static final DcCoreException REQUEST_HEADER_FORMAT_ERROR = create("PR400-BI-0001"); + public static final PersoniumCoreException REQUEST_HEADER_FORMAT_ERROR = create("PR400-BI-0001"); /** * Barファイルのファイルサイズが上限値を超えているとき. */ - public static final DcCoreException BAR_FILE_SIZE_TOO_LARGE = create("PR400-BI-0002"); + public static final PersoniumCoreException BAR_FILE_SIZE_TOO_LARGE = create("PR400-BI-0002"); /** * Barファイル内エントリのファイルサイズが上限値を超えているとき. */ - public static final DcCoreException BAR_FILE_ENTRY_SIZE_TOO_LARGE = create("PR400-BI-0003"); + public static final PersoniumCoreException BAR_FILE_ENTRY_SIZE_TOO_LARGE = create("PR400-BI-0003"); /** * インストール対象のBoxがBox Schemaとして登録済みのとき. */ - public static final DcCoreException BAR_FILE_BOX_SCHEMA_ALREADY_EXISTS = create("PR400-BI-0004"); + public static final PersoniumCoreException BAR_FILE_BOX_SCHEMA_ALREADY_EXISTS = create("PR400-BI-0004"); /** * Barファイルのファイルサイズが上限値を超えているとき. */ - public static final DcCoreException BAR_FILE_SIZE_INVALID = create("PR400-BI-0005"); + public static final PersoniumCoreException BAR_FILE_SIZE_INVALID = create("PR400-BI-0005"); /** * JSONファイルの形式が不正なとき. */ - public static final DcCoreException JSON_FILE_FORMAT_ERROR = create("PR400-BI-0006"); + public static final PersoniumCoreException JSON_FILE_FORMAT_ERROR = create("PR400-BI-0006"); /** * barファイルがオープンできないとき. */ - public static final DcCoreException BAR_FILE_CANNOT_OPEN = create("PR400-BI-0007"); + public static final PersoniumCoreException BAR_FILE_CANNOT_OPEN = create("PR400-BI-0007"); /** * barファイルが読み込めないとき. */ - public static final DcCoreException BAR_FILE_CANNOT_READ = create("PR400-BI-0008"); + public static final PersoniumCoreException BAR_FILE_CANNOT_READ = create("PR400-BI-0008"); /** * barファイルの構造が正しくないとき. */ - public static final DcCoreException BAR_FILE_INVALID_STRUCTURES = create("PR400-BI-0009"); + public static final PersoniumCoreException BAR_FILE_INVALID_STRUCTURES = create("PR400-BI-0009"); /** * インストール対象のBoxが登録済みのとき. */ - public static final DcCoreException BAR_FILE_BOX_ALREADY_EXISTS = create("PR405-BI-0001"); + public static final PersoniumCoreException BAR_FILE_BOX_ALREADY_EXISTS = create("PR405-BI-0001"); /** * Httpレスポンスの出力に失敗したとき. */ - public static final DcCoreException BAR_FILE_RESPONSE_FAILED = create("PR500-BI-0001"); + public static final PersoniumCoreException BAR_FILE_RESPONSE_FAILED = create("PR500-BI-0001"); } /** @@ -812,33 +812,33 @@ public static class Misc { /** * メソッドが受け付けられないとき. */ - public static final DcCoreException METHOD_NOT_ALLOWED = create("PR405-MC-0001"); + public static final PersoniumCoreException METHOD_NOT_ALLOWED = create("PR405-MC-0001"); /** * サーバ内の処理中にキャンセルされた場合。 * $batchのタイムアウトで使用。 */ - public static final DcCoreException SERVER_REQUEST_TIMEOUT = create("PR408-MC-0001"); + public static final PersoniumCoreException SERVER_REQUEST_TIMEOUT = create("PR408-MC-0001"); /** * セル一括削除時に削除対象のセルにアクセスがあったとき. */ - public static final DcCoreException CONFLICT_CELLACCESS = create("PR409-MC-0001"); + public static final PersoniumCoreException CONFLICT_CELLACCESS = create("PR409-MC-0001"); /** * ヘッダの前提条件指定が満たされていないとき. */ - public static final DcCoreException PRECONDITION_FAILED = create("PR412-MC-0001"); + public static final PersoniumCoreException PRECONDITION_FAILED = create("PR412-MC-0001"); /** * メソッドが未実装のとき. */ - public static final DcCoreException METHOD_NOT_IMPLEMENTED = create("PR501-MC-0001"); + public static final PersoniumCoreException METHOD_NOT_IMPLEMENTED = create("PR501-MC-0001"); /** * 未実装機能. */ - public static final DcCoreException NOT_IMPLEMENTED = create("PR501-MC-0002"); + public static final PersoniumCoreException NOT_IMPLEMENTED = create("PR501-MC-0002"); /** * 同時リクエストが多すぎるとき. * 排他制御のタイムアウトで使用。 */ - public static final DcCoreException TOO_MANY_CONCURRENT_REQUESTS = create("PR503-SV-0001"); + public static final PersoniumCoreException TOO_MANY_CONCURRENT_REQUESTS = create("PR503-SV-0001"); } @@ -868,7 +868,7 @@ public static void loadConfig() { * @param code エラーコード * @param message エラーメッセージ */ - DcCoreException(final String code, + PersoniumCoreException(final String code, final Severity severity, final String message, final int status, @@ -887,7 +887,7 @@ public static void loadConfig() { * @param code エラーコード * @param message エラーメッセージ */ - DcCoreException(final String code, + PersoniumCoreException(final String code, final Severity severity, final String message, final int status) { @@ -938,20 +938,20 @@ public String getMessage() { /** * 原因例外を追加したものを作成して返します. * @param t 原因例外 - * @return DcCoreException + * @return PersoniumCoreException */ - public DcCoreException reason(final Throwable t) { + public PersoniumCoreException reason(final Throwable t) { // クローンを作成 - DcCoreException ret = new DcCoreException(this.code, this.severity, this.message, this.status, t); + PersoniumCoreException ret = new PersoniumCoreException(this.code, this.severity, this.message, this.status, t); return ret; } /** * メッセージをパラメタ置換したものを作成して返します. エラーメッセージ上の $1 $2 等の表現がパラメタ置換用キーワードです。 * @param params 付加メッセージ - * @return DcCoreMessage + * @return PersoniumCoreMessage */ - public DcCoreException params(final Object... params) { + public PersoniumCoreException params(final Object... params) { // 置換メッセージ作成 String ms = MessageFormat.format(this.message, params); @@ -959,29 +959,29 @@ public DcCoreException params(final Object... params) { ms = EscapeControlCode.escape(ms); // メッセージ置換クローンを作成 - DcCoreException ret = new DcCoreException(this.code, this.severity, ms, this.status); + PersoniumCoreException ret = new PersoniumCoreException(this.code, this.severity, ms, this.status); return ret; } /** * ファクトリーメソッド. * @param code メッセージコード - * @return DcCoreException + * @return PersoniumCoreException */ - public static DcCoreException create(String code) { + public static PersoniumCoreException create(String code) { int statusCode = parseCode(code); // ログレベルの取得 - Severity severity = DcCoreMessageUtils.getSeverity(code); + Severity severity = PersoniumCoreMessageUtils.getSeverity(code); if (severity == null) { // ログレベルが設定されていなかったらレスポンスコードから自動的に判定する。 severity = decideSeverity(statusCode); } // ログメッセージの取得 - String message = DcCoreMessageUtils.getMessage(code); + String message = PersoniumCoreMessageUtils.getMessage(code); - return new DcCoreException(code, severity, message, statusCode); + return new PersoniumCoreException(code, severity, message, statusCode); } /** @@ -999,7 +999,7 @@ static Severity decideSeverity(int statusCode) { return Severity.INFO; } else { // それ以外の場合は考えられないのでウォーニング. - // 200系とか300系をDcCoreExceptionで処理する場合はログレベル設定をちゃんと書きましょう. + // 200系とか300系をPersoniumCoreExceptionで処理する場合はログレベル設定をちゃんと書きましょう. return Severity.WARN; } } diff --git a/src/main/java/com/fujitsu/dc/core/DcCoreLog.java b/src/main/java/io/personium/core/PersoniumCoreLog.java similarity index 64% rename from src/main/java/com/fujitsu/dc/core/DcCoreLog.java rename to src/main/java/io/personium/core/PersoniumCoreLog.java index b1e343d49..bd51a15fb 100644 --- a/src/main/java/com/fujitsu/dc/core/DcCoreLog.java +++ b/src/main/java/io/personium/core/PersoniumCoreLog.java @@ -14,21 +14,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core; +package io.personium.core; import java.text.MessageFormat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.core.DcCoreMessageUtils.Severity; +import io.personium.core.PersoniumCoreMessageUtils.Severity; /** * ログメッセージ作成クラス. */ -public final class DcCoreLog { +public final class PersoniumCoreLog { - static Logger log = LoggerFactory.getLogger(DcCoreLog.class); + static Logger log = LoggerFactory.getLogger(PersoniumCoreLog.class); /** * OData関連. @@ -38,15 +38,15 @@ public static class OData { * 主キーでの検索で1件のみ取得できるはずの場所で2件以上のデータが返ってきた. * {0}:ヒット件数 */ - public static final DcCoreLog FOUND_MULTIPLE_RECORDS = create("PL-OD-0001"); + public static final PersoniumCoreLog FOUND_MULTIPLE_RECORDS = create("PL-OD-0001"); /** * バルクデータ登録で異常. */ - public static final DcCoreLog BULK_INSERT_FAIL = create("PL-OD-0002"); + public static final PersoniumCoreLog BULK_INSERT_FAIL = create("PL-OD-0002"); /** * プロパティ名の重複を検出した. */ - public static final DcCoreLog DUPLICATED_PROPERTY_NAME = create("PL-OD-0003"); + public static final PersoniumCoreLog DUPLICATED_PROPERTY_NAME = create("PL-OD-0003"); } /** @@ -57,21 +57,21 @@ public static class Dav { * Roleが見つからなかったとき. * {0}:詳細メッセージ */ - public static final DcCoreLog ROLE_NOT_FOUND = create("PL-DV-0001"); + public static final PersoniumCoreLog ROLE_NOT_FOUND = create("PL-DV-0001"); /** * Rangeヘッダ指定誤り. * {0}:詳細メッセージ */ - public static final DcCoreLog REQUESTED_RANGE_NOT_SATISFIABLE = create("PL-DV-0002"); + public static final PersoniumCoreLog REQUESTED_RANGE_NOT_SATISFIABLE = create("PL-DV-0002"); /** * Rangeヘッダ指定のファイル読み飛ばし失敗. */ - public static final DcCoreLog FILE_TOO_SHORT = create("PL-DV-0003"); + public static final PersoniumCoreLog FILE_TOO_SHORT = create("PL-DV-0003"); /** * バイナリデータの削除に失敗. * {0}:バイナリデータのUUID */ - public static final DcCoreLog FILE_DELETE_FAIL = create("PL-DV-0004"); + public static final PersoniumCoreLog FILE_DELETE_FAIL = create("PL-DV-0004"); } /** @@ -82,27 +82,27 @@ public static class Auth { * トークンのパースに失敗した時. * {0}:詳細メッセージ */ - public static final DcCoreLog TOKEN_PARSE_ERROR = create("PL-AU-0001"); + public static final PersoniumCoreLog TOKEN_PARSE_ERROR = create("PL-AU-0001"); /** * トークンの署名検証エラー. * {0}:詳細メッセージ */ - public static final DcCoreLog TOKEN_DISG_ERROR = create("PL-AU-0002"); + public static final PersoniumCoreLog TOKEN_DISG_ERROR = create("PL-AU-0002"); /** * ルートCA証明書設定エラー. * {0}:詳細メッセージ */ - public static final DcCoreLog ROOT_CA_CRT_SETTING_ERROR = create("PL-AU-0003"); + public static final PersoniumCoreLog ROOT_CA_CRT_SETTING_ERROR = create("PL-AU-0003"); /** * 最終ログイン時刻の更新時にAccountが存在しない場合. * {0}:詳細メッセージ */ - public static final DcCoreLog ACCOUNT_ALREADY_DELETED = create("PL-AU-0004"); + public static final PersoniumCoreLog ACCOUNT_ALREADY_DELETED = create("PL-AU-0004"); /** * 対応するアカウントが存在したが、指定されたGrantTypeに対応していない. * {0}:詳細メッセージ */ - public static final DcCoreLog UNSUPPORTED_ACCOUNT_GRANT_TYPE = create("PL-AU-0005"); + public static final PersoniumCoreLog UNSUPPORTED_ACCOUNT_GRANT_TYPE = create("PL-AU-0005"); } /** @@ -113,22 +113,22 @@ public static class OIDC { * 対応するアカウントが存在しない. * {0}:詳細メッセージ */ - public static final DcCoreLog NO_SUCH_ACCOUNT = create("PL-OI-0001"); + public static final PersoniumCoreLog NO_SUCH_ACCOUNT = create("PL-OI-0001"); /** * 対応するアカウントが存在したが、指定されたGrantTypeに対応していない. * {0}:詳細メッセージ */ - public static final DcCoreLog UNSUPPORTED_ACCOUNT_GRANT_TYPE = create("PL-OI-0002"); + public static final PersoniumCoreLog UNSUPPORTED_ACCOUNT_GRANT_TYPE = create("PL-OI-0002"); /** * リクエストユーザーとIDTokenのユーザーが一致しない. * {0}:詳細メッセージ */ - public static final DcCoreLog INVALID_ACCOUNT = create("PL-OI-0003"); + public static final PersoniumCoreLog INVALID_ACCOUNT = create("PL-OI-0003"); /** . * IssuerがGoogleではない * {0}:詳細メッセージ */ - public static final DcCoreLog INVALID_ISSUER = create("PL-OI-0004"); + public static final PersoniumCoreLog INVALID_ISSUER = create("PL-OI-0004"); } /** @@ -140,88 +140,88 @@ public static class Server { * Adsへマスタデータ作成に失敗. * {0}:詳細メッセージ */ - public static final DcCoreLog DATA_STORE_ENTITY_CREATE_FAIL = create("PL-SV-0001"); + public static final PersoniumCoreLog DATA_STORE_ENTITY_CREATE_FAIL = create("PL-SV-0001"); /** * Adsへマスタデータ更新に失敗. * {0}:詳細メッセージ */ - public static final DcCoreLog DATA_STORE_ENTITY_UPDATE_FAIL = create("PL-SV-0002"); + public static final PersoniumCoreLog DATA_STORE_ENTITY_UPDATE_FAIL = create("PL-SV-0002"); /** * Adsへマスタデータ削除に失敗. * {0}:詳細メッセージ */ - public static final DcCoreLog DATA_STORE_ENTITY_DELETE_FAIL = create("PL-SV-0003"); + public static final PersoniumCoreLog DATA_STORE_ENTITY_DELETE_FAIL = create("PL-SV-0003"); /** * memcachedのポート番号フォーマットエラー. * {0}:詳細メッセージ */ - public static final DcCoreLog MEMCACHED_PORT_FORMAT_ERROR = create("PL-SV-0004"); + public static final PersoniumCoreLog MEMCACHED_PORT_FORMAT_ERROR = create("PL-SV-0004"); /** * memcachedへの接続に失敗. * {0}:ホスト名 * {1}:ポート名 * {2}:詳細メッセージ */ - public static final DcCoreLog MEMCACHED_CONNECTO_FAIL = create("PL-SV-0005"); + public static final PersoniumCoreLog MEMCACHED_CONNECTO_FAIL = create("PL-SV-0005"); /** * memcachedへのcache設定失敗. * {0}:詳細メッセージ */ - public static final DcCoreLog MEMCACHED_SET_FAIL = create("PL-SV-0006"); + public static final PersoniumCoreLog MEMCACHED_SET_FAIL = create("PL-SV-0006"); /** * memcachedへのcacheクリアー失敗. * {0}:詳細メッセージ */ - public static final DcCoreLog MEMCACHED_CLEAR_FAIL = create("PL-SV-0007"); + public static final PersoniumCoreLog MEMCACHED_CLEAR_FAIL = create("PL-SV-0007"); /** * memcachedへのcache削除失敗. * {0}:詳細メッセージ */ - public static final DcCoreLog MEMCACHED_DELETE_FAIL = create("PL-SV-0008"); + public static final PersoniumCoreLog MEMCACHED_DELETE_FAIL = create("PL-SV-0008"); /** * AdsへBulkでのマスタデータ作成に失敗. * {0}:詳細メッセージ */ - public static final DcCoreLog DATA_STORE_ENTITY_BULK_CREATE_FAIL = create("PL-SV-0009"); + public static final PersoniumCoreLog DATA_STORE_ENTITY_BULK_CREATE_FAIL = create("PL-SV-0009"); /** * RDBへの接続失敗. * {0}:詳細メッセージ */ - public static final DcCoreLog RDB_CONNECT_FAIL = create("PL-SV-0010"); + public static final PersoniumCoreLog RDB_CONNECT_FAIL = create("PL-SV-0010"); /** * SQL実行エラー. * {0}:詳細メッセージ */ - public static final DcCoreLog EXECUTE_QUERY_SQL_FAIL = create("PL-SV-0011"); + public static final PersoniumCoreLog EXECUTE_QUERY_SQL_FAIL = create("PL-SV-0011"); /** * RDBとの切断失敗. * {0}:詳細メッセージ */ - public static final DcCoreLog RDB_DISCONNECT_FAIL = create("PL-SV-0012"); + public static final PersoniumCoreLog RDB_DISCONNECT_FAIL = create("PL-SV-0012"); /** * ADSへの接続失敗. * {0}:詳細メッセージ */ - public static final DcCoreLog ADS_CONNECTION_ERROR = create("PL-SV-0013"); + public static final PersoniumCoreLog ADS_CONNECTION_ERROR = create("PL-SV-0013"); /** * ElasticSearchのインデックスが存在しない. * {0}:インデックス名 */ - public static final DcCoreLog ES_INDEX_NOT_EXIST = create("PL-SV-0014"); + public static final PersoniumCoreLog ES_INDEX_NOT_EXIST = create("PL-SV-0014"); /** * Adsの作成に失敗. * {0}:インデックス名 */ - public static final DcCoreLog FAILED_TO_CREATE_ADS = create("PL-SV-0015"); + public static final PersoniumCoreLog FAILED_TO_CREATE_ADS = create("PL-SV-0015"); /** * JDBCに対して実行するSQL文をログに出力. * {0}:実行したSQL文 */ - public static final DcCoreLog JDBC_EXEC_SQL = create("PL-SV-0016"); + public static final PersoniumCoreLog JDBC_EXEC_SQL = create("PL-SV-0016"); /** * サーバ起動失敗. */ - public static final DcCoreLog FAILED_TO_START_SERVER = create("PL-SV-0017"); + public static final PersoniumCoreLog FAILED_TO_START_SERVER = create("PL-SV-0017"); /** * JDBCに対して実行するユーザODataのSQL実行をログに出力. * {0}:DB名 @@ -233,21 +233,21 @@ public static class Server { * {6}:Nodeのid * {7}:EntityTypeのid */ - public static final DcCoreLog JDBC_USER_ODATA_SQL = create("PL-SV-0018"); + public static final PersoniumCoreLog JDBC_USER_ODATA_SQL = create("PL-SV-0018"); /** * ReferenceOnlyロックを設定した. * {0}:キー名 */ - public static final DcCoreLog SET_REFERENCE_ONLY_LOCK = create("PL-SV-0019"); + public static final PersoniumCoreLog SET_REFERENCE_ONLY_LOCK = create("PL-SV-0019"); /** * Adsエラー時のリペア用ログの書込みに失敗. */ - public static final DcCoreLog WRITE_ADS_FAILURE_LOG_ERROR = create("PL-SV-0020"); + public static final PersoniumCoreLog WRITE_ADS_FAILURE_LOG_ERROR = create("PL-SV-0020"); /** * Adsエラー時のリペア用ログに書込む情報. * {0}:ログ情報 */ - public static final DcCoreLog WRITE_ADS_FAILURE_LOG_INFO = create("PL-SV-0021"); + public static final PersoniumCoreLog WRITE_ADS_FAILURE_LOG_INFO = create("PL-SV-0021"); } /** @@ -258,7 +258,7 @@ public static class Es { * ESへの接続が完了した. * {0}:接続ノードアドレス */ - public static final DcCoreLog CONNECTED = create("PL-ES-0001"); + public static final PersoniumCoreLog CONNECTED = create("PL-ES-0001"); /** * ESへのリクエストが完了した. * {0}:インデックス名 @@ -268,12 +268,12 @@ public static class Es { * {4}:ESへのリクエストタイプ * {3}と{4}の出力順は逆になる */ - public static final DcCoreLog AFTER_REQUEST = create("PL-ES-0002"); + public static final PersoniumCoreLog AFTER_REQUEST = create("PL-ES-0002"); /** * インデックスを作成. * {0}:インデックス名 */ - public static final DcCoreLog CREATING_INDEX = create("PL-ES-0003"); + public static final PersoniumCoreLog CREATING_INDEX = create("PL-ES-0003"); /** * ESへの登録リクエストが完了した. * {0}:インデックス名 @@ -282,12 +282,12 @@ public static class Es { * {3}:ESへのリクエストタイプ * {4}:リクエストクエリ */ - public static final DcCoreLog AFTER_CREATE = create("PL-ES-0004"); + public static final PersoniumCoreLog AFTER_CREATE = create("PL-ES-0004"); /** * ESへの登録リクエストが完了した. * {0}:リクエストクエリ */ - public static final DcCoreLog AFTER_CREATE_BODY = create("PL-ES-0005"); + public static final PersoniumCoreLog AFTER_CREATE_BODY = create("PL-ES-0005"); } /** @@ -297,7 +297,7 @@ public static class Misc { /** * 到達し得ないソース等の原因不明のエラー. */ - public static final DcCoreLog UNREACHABLE_CODE_ERROR = create("PL-MC-0001"); + public static final PersoniumCoreLog UNREACHABLE_CODE_ERROR = create("PL-MC-0001"); } String message; @@ -321,7 +321,7 @@ public static void loadConfig() { * @param severityエラーレベル * @param message エラーメッセージ */ - DcCoreLog(final String code, + PersoniumCoreLog(final String code, final Severity severity, final String message) { this.code = code; @@ -332,20 +332,20 @@ public static void loadConfig() { /** * ファクトリーメソッド. * @param code エラーコード - * @return DcCoreLog + * @return PersoniumCoreLog */ - public static DcCoreLog create(String code) { + public static PersoniumCoreLog create(String code) { // ログレベルの取得 - Severity severity = DcCoreMessageUtils.getSeverity(code); + Severity severity = PersoniumCoreMessageUtils.getSeverity(code); if (severity == null) { // 設定ファイルで省略されていたらウォーニング扱いとする。 severity = Severity.WARN; } // ログメッセージの取得 - String message = DcCoreMessageUtils.getMessage(code); + String message = PersoniumCoreMessageUtils.getMessage(code); - return new DcCoreLog(code, severity, message); + return new PersoniumCoreLog(code, severity, message); } /** @@ -359,24 +359,24 @@ public String getCode() { /** * メッセージをパラメタ置換したものを作成して返します. エラーメッセージ上の {1} {2} 等の表現がパラメタ置換用キーワードです。 * @param params 付加メッセージ - * @return DcCoreLog + * @return PersoniumCoreLog */ - public DcCoreLog params(final Object... params) { + public PersoniumCoreLog params(final Object... params) { // 置換メッセージ作成 String ms = MessageFormat.format(this.message, params); // メッセージ置換クローンを作成 - DcCoreLog ret = new DcCoreLog(this.code, this.severity, ms); + PersoniumCoreLog ret = new PersoniumCoreLog(this.code, this.severity, ms); return ret; } /** * 原因例外を追加したものを作成して返します. * @param t 原因例外 - * @return DcCoreException + * @return PersoniumCoreException */ - public DcCoreLog reason(final Throwable t) { + public PersoniumCoreLog reason(final Throwable t) { // クローンを作成して - DcCoreLog ret = new DcCoreLog(this.code, this.severity, this.message); + PersoniumCoreLog ret = new PersoniumCoreLog(this.code, this.severity, this.message); // 原因のExceptionをセット ret.reason = t; return ret; @@ -386,7 +386,7 @@ public DcCoreLog reason(final Throwable t) { * ログの出力. * ログの出力時にログ出力元のクラス名、メソッド名、行数を表示する。 * 出力例) - * 2012-09-09 11:23:47.029 [main] [INFO ] DcCoreLog [com.fujitsu.dc.core.DcCoreLogTest#test:22] - JSON Parse Error. + * 2012-09-09 11:23:47.029 [main] [INFO ] PersoniumCoreLog [io.personium.core.PersoniumCoreLogTest#test:22] - JSON Parse Error. */ public void writeLog() { diff --git a/src/main/java/com/fujitsu/dc/core/DcCoreMessageUtils.java b/src/main/java/io/personium/core/PersoniumCoreMessageUtils.java similarity index 83% rename from src/main/java/com/fujitsu/dc/core/DcCoreMessageUtils.java rename to src/main/java/io/personium/core/PersoniumCoreMessageUtils.java index d31afd926..03f6af4a9 100644 --- a/src/main/java/com/fujitsu/dc/core/DcCoreMessageUtils.java +++ b/src/main/java/io/personium/core/PersoniumCoreMessageUtils.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core; +package io.personium.core; import java.io.IOException; import java.io.InputStream; @@ -24,7 +24,7 @@ /** * ログメッセージ作成クラス. */ -public abstract class DcCoreMessageUtils { +public abstract class PersoniumCoreMessageUtils { /** * ログレベルの設定を保持する. */ @@ -37,15 +37,15 @@ public abstract class DcCoreMessageUtils { /** * ログレベル設定のキー. * 後ろにメッセージコードをつけるのでドットまで定義 - * 例)com.fujitsu.dc.core.loglevel.PR400-OD-0001 + * 例)io.personium.core.loglevel.PR400-OD-0001 */ - public static final String LOG_LEVEL = DcCoreConfig.KEY_ROOT + "loglevel."; + public static final String LOG_LEVEL = PersoniumUnitConfig.KEY_ROOT + "loglevel."; /** * ログメッセージ設定のキー. * 後ろにメッセージコードをつけるのでドットまで定義 */ - public static final String LOG_MESSAGE = DcCoreConfig.KEY_ROOT + "msg."; + public static final String LOG_MESSAGE = PersoniumUnitConfig.KEY_ROOT + "msg."; /** * ログレベルに対応する例外の深刻さ. @@ -70,14 +70,14 @@ public enum Severity { } static { - LOG_LEVEL_PROP = doLoad("dc-log-level.properties"); - LOG_MSG_PROP = doLoad("dc-messages.properties"); + LOG_LEVEL_PROP = doLoad("personium-log-level.properties"); + LOG_MSG_PROP = doLoad("personium-messages.properties"); } private static Properties doLoad(String file) { Properties prop = new Properties(); prop.clear(); - InputStream is = DcCoreConfig.class.getClassLoader().getResourceAsStream(file); + InputStream is = PersoniumUnitConfig.class.getClassLoader().getResourceAsStream(file); try { prop.load(is); } catch (IOException e) { @@ -95,7 +95,7 @@ private static Properties doLoad(String file) { /** * コンストラクタ. */ - private DcCoreMessageUtils() { + private PersoniumCoreMessageUtils() { } /** diff --git a/src/main/java/com/fujitsu/dc/core/DcReadDeleteModeManager.java b/src/main/java/io/personium/core/PersoniumReadDeleteModeManager.java similarity index 89% rename from src/main/java/com/fujitsu/dc/core/DcReadDeleteModeManager.java rename to src/main/java/io/personium/core/PersoniumReadDeleteModeManager.java index 0c1e27f1d..9bba6086b 100644 --- a/src/main/java/com/fujitsu/dc/core/DcReadDeleteModeManager.java +++ b/src/main/java/io/personium/core/PersoniumReadDeleteModeManager.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core; +package io.personium.core; import java.util.Arrays; import java.util.HashSet; @@ -24,13 +24,13 @@ import javax.ws.rs.HttpMethod; import javax.ws.rs.core.PathSegment; -import com.fujitsu.dc.core.model.lock.ReadDeleteModeLockManager; +import io.personium.core.model.lock.ReadDeleteModeLockManager; /** * PCSの動作モードを参照するクラス. */ -public class DcReadDeleteModeManager { - private DcReadDeleteModeManager() { +public class PersoniumReadDeleteModeManager { + private PersoniumReadDeleteModeManager() { } /** @@ -42,7 +42,7 @@ private DcReadDeleteModeManager() { HttpMethod.DELETE, HttpMethod.OPTIONS, HttpMethod.HEAD, - com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPFIND, + io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPFIND, "REPORT" ) ); @@ -93,7 +93,7 @@ public static void checkReadDeleteOnlyMode(String method, List path return; } - throw DcCoreException.Server.READ_DELETE_ONLY; + throw PersoniumCoreException.Server.READ_DELETE_ONLY; } private static boolean isBatchPath(List pathSegment) { diff --git a/src/main/java/com/fujitsu/dc/core/DcCoreConfig.java b/src/main/java/io/personium/core/PersoniumUnitConfig.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/DcCoreConfig.java rename to src/main/java/io/personium/core/PersoniumUnitConfig.java index 2fbd42702..c132a5a21 100644 --- a/src/main/java/com/fujitsu/dc/core/DcCoreConfig.java +++ b/src/main/java/io/personium/core/PersoniumUnitConfig.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core; +package io.personium.core; import java.io.File; import java.io.FileInputStream; @@ -29,15 +29,15 @@ import org.slf4j.LoggerFactory; /** - * 設定情報を保持するクラス. このクラスからクラスパス上にある dc-config.propertiesの内容にアクセスできます。 + * 設定情報を保持するクラス. このクラスからクラスパス上にある personium-unit-config.propertiesの内容にアクセスできます。 */ -public class DcCoreConfig { +public class PersoniumUnitConfig { private static final int DEFAULT_BATCH_TIMEOUT = 270000; private static final int DEFAULT_BATCH_SLEEP_INTERVAL = 1000; private static final int DEFAULT_BATCH_SLEEP = 50; /** - * dc-config.propertiesの設定ファイルパスキー. + * personium-unit-config.propertiesの設定ファイルパスキー. */ static final String KEY_CONFIG_FILE = "io.personium.configurationFile"; @@ -196,7 +196,7 @@ public static final class Security { /** * トークンを暗号化する際に利用している秘密鍵. */ - public static final String TOKEN_SECRET_KEY = KEY_ROOT + "security.sercret16"; + public static final String TOKEN_SECRET_KEY = KEY_ROOT + "security.secret16"; /** * トークンを暗号化する際に利用している秘密鍵. @@ -619,7 +619,7 @@ public static final class AdsRepair { * RepairAdsを起動するか否かを示すファイルのパス. ファイルが存在する場合のみ、RepairAdsが起動する。 */ public static final String REPAIR_ADS_INVOCATION_FILE_PATH = KEY_ROOT + "es.ads.repair.invocationFlagFile"; - static final String DEFAULT_REPAIR_ADS_INVOCATION_FILE_PATH = "/personium/dc-core/invokeRepair"; + static final String DEFAULT_REPAIR_ADS_INVOCATION_FILE_PATH = "/personium/personium-core/invokeRepair"; } /** @@ -664,17 +664,17 @@ public static boolean isGoogleClientIdTrusted(String clientId) { static { // 各種メッセージ出力クラスを強制的にロードする - DcCoreLog.loadConfig(); - DcCoreException.loadConfig(); - DcCoreAuthnException.loadConfig(); + PersoniumCoreLog.loadConfig(); + PersoniumCoreException.loadConfig(); + PersoniumCoreAuthnException.loadConfig(); } /** * singleton. */ - private static DcCoreConfig singleton = new DcCoreConfig(); + private static PersoniumUnitConfig singleton = new PersoniumUnitConfig(); - // static Logger log = LoggerFactory.getLogger(DcCoreConfig.class); + // static Logger log = LoggerFactory.getLogger(PersoniumCoreConfig.class); /** * 設定値を格納するプロパティ実体. @@ -689,7 +689,7 @@ public static boolean isGoogleClientIdTrusted(String clientId) { /** * protectedなコンストラクタ. */ - protected DcCoreConfig() { + protected PersoniumUnitConfig() { this.doReload(); } @@ -697,9 +697,9 @@ protected DcCoreConfig() { * 設定のリロード. */ private synchronized void doReload() { - Logger log = LoggerFactory.getLogger(DcCoreConfig.class); - Properties properties = getDcConfigDefaultProperties(); - Properties propertiesOverride = getDcConfigProperties(); + Logger log = LoggerFactory.getLogger(PersoniumUnitConfig.class); + Properties properties = getUnitConfigDefaultProperties(); + Properties propertiesOverride = getPersoniumConfigProperties(); // 読み込みに成功した場合、メンバ変数へ置換する if (!properties.isEmpty()) { this.props.clear(); @@ -752,12 +752,12 @@ private static boolean isAstarisk(String val) { return false; } /** - * dc-config-default.propertiesファイルを読み込む. - * @return dc-config-default.properties + * personium-unit-config-default.propertiesファイルを読み込む. + * @return personium-unit-config-default.properties */ - protected Properties getDcConfigDefaultProperties() { + protected Properties getUnitConfigDefaultProperties() { Properties properties = new Properties(); - InputStream is = DcCoreConfig.class.getClassLoader().getResourceAsStream("dc-config-default.properties"); + InputStream is = PersoniumUnitConfig.class.getClassLoader().getResourceAsStream("personium-unit-config-default.properties"); try { properties.load(is); } catch (IOException e) { @@ -773,11 +773,11 @@ protected Properties getDcConfigDefaultProperties() { } /** - * dc-config.propertiesファイルを読み込む. - * @return dc-config.properties + * personium-unit-config.propertiesファイルを読み込む. + * @return personium-unit-config.properties */ - protected Properties getDcConfigProperties() { - Logger log = LoggerFactory.getLogger(DcCoreConfig.class); + protected Properties getPersoniumConfigProperties() { + Logger log = LoggerFactory.getLogger(PersoniumUnitConfig.class); Properties propertiesOverride = new Properties(); String configFilePath = System.getProperty(KEY_CONFIG_FILE); InputStream is = getConfigFileInputStream(configFilePath); @@ -785,32 +785,32 @@ protected Properties getDcConfigProperties() { if (is != null) { propertiesOverride.load(is); } else { - log.debug("[dc-config.properties] file not found on the classpath. using default config."); + log.debug("[personium-unit-config.properties] file not found on the classpath. using default config."); } } catch (IOException e) { - log.debug("IO Exception when loading [dc-config.properties] file."); + log.debug("IO Exception when loading [personium-unit-config.properties] file."); } finally { try { if (is != null) { is.close(); } } catch (IOException e) { - log.debug("IO Exception when closing [dc-config.properties] file."); + log.debug("IO Exception when closing [personium-unit-config.properties] file."); } } return propertiesOverride; } /** - * dc-config.propertiesをInputStream形式で取得する. + * personium-unit-config.propertiesをInputStream形式で取得する. * @param configFilePath 設定ファイルパス - * @return dc-config.properties + * @return personium-unit-config.properties */ protected InputStream getConfigFileInputStream(String configFilePath) { - Logger log = LoggerFactory.getLogger(DcCoreConfig.class); + Logger log = LoggerFactory.getLogger(PersoniumUnitConfig.class); InputStream configFileInputStream = null; if (configFilePath == null) { - configFileInputStream = DcCoreConfig.class.getClassLoader().getResourceAsStream("dc-config.properties"); + configFileInputStream = PersoniumUnitConfig.class.getClassLoader().getResourceAsStream("personium-unit-config.properties"); return configFileInputStream; } @@ -818,11 +818,11 @@ protected InputStream getConfigFileInputStream(String configFilePath) { // 設定ファイルを指定されたパスから読み込む File configFile = new File(configFilePath); configFileInputStream = new FileInputStream(configFile); - log.info("dc-config.properties from system properties."); + log.info("personium-unit-config.properties from system properties."); } catch (FileNotFoundException e) { // 指定されたパスにファイルが存在しない場合は、クラスパス上のファイルを読み込む - configFileInputStream = DcCoreConfig.class.getClassLoader().getResourceAsStream("dc-config.properties"); - log.info("dc-config.properties from class path."); + configFileInputStream = PersoniumUnitConfig.class.getClassLoader().getResourceAsStream("personium-unit-config.properties"); + log.info("personium-unit-config.properties from class path."); } return configFileInputStream; } @@ -1506,7 +1506,7 @@ public static void reload() { * @return boolean httpsの場合:true */ public static boolean isHttps() { - return DcCoreConfig.getUnitScheme().equals("https"); + return PersoniumUnitConfig.getUnitScheme().equals("https"); } /** diff --git a/src/main/java/com/fujitsu/dc/core/annotations/ACL.java b/src/main/java/io/personium/core/annotations/ACL.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/annotations/ACL.java rename to src/main/java/io/personium/core/annotations/ACL.java index ead969e5c..4da7924ca 100644 --- a/src/main/java/com/fujitsu/dc/core/annotations/ACL.java +++ b/src/main/java/io/personium/core/annotations/ACL.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.annotations; +package io.personium.core.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/src/main/java/com/fujitsu/dc/core/annotations/MERGE.java b/src/main/java/io/personium/core/annotations/MERGE.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/annotations/MERGE.java rename to src/main/java/io/personium/core/annotations/MERGE.java index bc30ec5f7..82bfdffc4 100644 --- a/src/main/java/com/fujitsu/dc/core/annotations/MERGE.java +++ b/src/main/java/io/personium/core/annotations/MERGE.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.annotations; +package io.personium.core.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/src/main/java/com/fujitsu/dc/core/annotations/PATCH.java b/src/main/java/io/personium/core/annotations/PATCH.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/annotations/PATCH.java rename to src/main/java/io/personium/core/annotations/PATCH.java index 2ea71a1d4..a97d3a583 100644 --- a/src/main/java/com/fujitsu/dc/core/annotations/PATCH.java +++ b/src/main/java/io/personium/core/annotations/PATCH.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.annotations; +package io.personium.core.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/src/main/java/com/fujitsu/dc/core/annotations/REPORT.java b/src/main/java/io/personium/core/annotations/REPORT.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/annotations/REPORT.java rename to src/main/java/io/personium/core/annotations/REPORT.java index 798416c04..296ec5303 100644 --- a/src/main/java/com/fujitsu/dc/core/annotations/REPORT.java +++ b/src/main/java/io/personium/core/annotations/REPORT.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.annotations; +package io.personium.core.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/src/main/java/com/fujitsu/dc/core/annotations/RequirePrivilege.java b/src/main/java/io/personium/core/annotations/RequirePrivilege.java similarity index 93% rename from src/main/java/com/fujitsu/dc/core/annotations/RequirePrivilege.java rename to src/main/java/io/personium/core/annotations/RequirePrivilege.java index df4674b84..1021374bf 100644 --- a/src/main/java/com/fujitsu/dc/core/annotations/RequirePrivilege.java +++ b/src/main/java/io/personium/core/annotations/RequirePrivilege.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.annotations; +package io.personium.core.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/src/main/java/com/fujitsu/dc/core/annotations/package-info.java b/src/main/java/io/personium/core/annotations/package-info.java similarity index 91% rename from src/main/java/com/fujitsu/dc/core/annotations/package-info.java rename to src/main/java/io/personium/core/annotations/package-info.java index bb8ea8c8a..0605c6f55 100644 --- a/src/main/java/com/fujitsu/dc/core/annotations/package-info.java +++ b/src/main/java/io/personium/core/annotations/package-info.java @@ -17,5 +17,5 @@ /** * package for annotation definitions. */ -package com.fujitsu.dc.core.annotations; +package io.personium.core.annotations; diff --git a/src/main/java/com/fujitsu/dc/core/auth/AccessContext.java b/src/main/java/io/personium/core/auth/AccessContext.java similarity index 83% rename from src/main/java/com/fujitsu/dc/core/auth/AccessContext.java rename to src/main/java/io/personium/core/auth/AccessContext.java index cced48bcb..20ed1d6db 100644 --- a/src/main/java/com/fujitsu/dc/core/auth/AccessContext.java +++ b/src/main/java/io/personium/core/auth/AccessContext.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.auth; +package io.personium.core.auth; import java.net.URI; import java.net.URISyntaxException; @@ -26,31 +26,31 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token.TokenDsigException; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token.TokenParseException; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token.TokenRootCrtException; -import com.fujitsu.dc.common.auth.token.AccountAccessToken; -import com.fujitsu.dc.common.auth.token.CellLocalAccessToken; -import com.fujitsu.dc.common.auth.token.IAccessToken; -import com.fujitsu.dc.common.auth.token.LocalToken; -import com.fujitsu.dc.common.auth.token.Role; -import com.fujitsu.dc.common.auth.token.TransCellAccessToken; -import com.fujitsu.dc.common.auth.token.TransCellRefreshToken; -import com.fujitsu.dc.common.auth.token.UnitLocalUnitUserToken; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreAuthzException; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.DcCoreLog; -import com.fujitsu.dc.core.auth.OAuth2Helper.AcceptableAuthScheme; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.jaxb.Ace; -import com.fujitsu.dc.core.model.jaxb.Acl; -import com.fujitsu.dc.core.odata.OEntityWrapper; -import com.fujitsu.dc.core.rs.cell.AuthResourceUtils; -import com.fujitsu.dc.core.utils.UriUtils; +import io.personium.common.auth.token.AbstractOAuth2Token; +import io.personium.common.auth.token.AbstractOAuth2Token.TokenDsigException; +import io.personium.common.auth.token.AbstractOAuth2Token.TokenParseException; +import io.personium.common.auth.token.AbstractOAuth2Token.TokenRootCrtException; +import io.personium.common.auth.token.AccountAccessToken; +import io.personium.common.auth.token.CellLocalAccessToken; +import io.personium.common.auth.token.IAccessToken; +import io.personium.common.auth.token.LocalToken; +import io.personium.common.auth.token.Role; +import io.personium.common.auth.token.TransCellAccessToken; +import io.personium.common.auth.token.TransCellRefreshToken; +import io.personium.common.auth.token.UnitLocalUnitUserToken; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumCoreAuthzException; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.PersoniumCoreLog; +import io.personium.core.auth.OAuth2Helper.AcceptableAuthScheme; +import io.personium.core.model.Box; +import io.personium.core.model.Cell; +import io.personium.core.model.jaxb.Ace; +import io.personium.core.model.jaxb.Acl; +import io.personium.core.odata.OEntityWrapper; +import io.personium.core.rs.cell.AuthResourceUtils; +import io.personium.core.utils.UriUtils; /** * アクセス文脈情報. @@ -245,38 +245,38 @@ public List getRoleList() { * ファクトリメソッド. アクセスしているCellとAuthorizationヘッダの値を元にオブジェクトを生成して返します. * @param authzHeaderValue Authorizationヘッダの値 * @param requestURIInfo リクエストのURI情報 - * @param dcCookiePeer リクエストパラメタに指定された dc_cookie_peerの値 - * @param dcCookieAuthValue クッキー内 dc_cookieに指定されている値 + * @param pCookiePeer リクエストパラメタに指定された p_cookie_peerの値 + * @param pCookieAuthValue クッキー内 p_cookieに指定されている値 * @param cell アクセスしているCell * @param baseUri アクセスしているbaseUri * @param host リクエストヘッダのHostの値 - * @param xDcUnitUser X-Dc-UnitUserヘッダ + * @param xPersoniumUnitUser X-Personium-UnitUserヘッダ * @return 生成されたAccessContextオブジェクト */ public static AccessContext create(final String authzHeaderValue, - final UriInfo requestURIInfo, final String dcCookiePeer, final String dcCookieAuthValue, - final Cell cell, final String baseUri, final String host, String xDcUnitUser) { + final UriInfo requestURIInfo, final String pCookiePeer, final String pCookieAuthValue, + final Cell cell, final String baseUri, final String host, String xPersoniumUnitUser) { if (authzHeaderValue == null) { - if (dcCookiePeer == null || 0 == dcCookiePeer.length()) { + if (pCookiePeer == null || 0 == pCookiePeer.length()) { return new AccessContext(TYPE_ANONYMOUS, cell, baseUri); } // クッキー認証の場合 // クッキー内の値を復号化した値を取得 try { - if (null == dcCookieAuthValue) { + if (null == pCookieAuthValue) { return new AccessContext(TYPE_INVALID, cell, baseUri, InvalidReason.cookieAuthError); } - String decodedCookieValue = LocalToken.decode(dcCookieAuthValue, + String decodedCookieValue = LocalToken.decode(pCookieAuthValue, UnitLocalUnitUserToken.getIvBytes( AccessContext.getCookieCryptKey(requestURIInfo.getBaseUri()))); int separatorIndex = decodedCookieValue.indexOf("\t"); String peer = decodedCookieValue.substring(0, separatorIndex); // クッキー内の情報から authorizationHeader相当のトークンを取得 String authToken = decodedCookieValue.substring(separatorIndex + 1); - if (dcCookiePeer.equals(peer)) { + if (pCookiePeer.equals(peer)) { // 再帰呼び出しで適切な AccessContextを生成する。 return create(OAuth2Helper.Scheme.BEARER + " " + authToken, - requestURIInfo, null, null, cell, baseUri, host, xDcUnitUser); + requestURIInfo, null, null, cell, baseUri, host, xPersoniumUnitUser); } else { return new AccessContext(TYPE_INVALID, cell, baseUri, InvalidReason.cookieAuthError); } @@ -295,7 +295,7 @@ public static AccessContext create(final String authzHeaderValue, } else if (authzHeaderValue.startsWith(OAuth2Helper.Scheme.BEARER)) { // OAuth2.0認証 - return createBearerAuthz(authzHeaderValue, cell, baseUri, host, xDcUnitUser); + return createBearerAuthz(authzHeaderValue, cell, baseUri, host, xPersoniumUnitUser); } return new AccessContext(TYPE_INVALID, cell, baseUri, InvalidReason.authenticationScheme); } @@ -315,7 +315,7 @@ private static AccessContext createBasicAuthz(final String authzHeaderValue, fin return new AccessContext(TYPE_INVALID, null, baseUri, InvalidReason.basicAuthError); } - String[] idpw = DcCoreUtils.parseBasicAuthzHeader(authzHeaderValue); + String[] idpw = PersoniumCoreUtils.parseBasicAuthzHeader(authzHeaderValue); if (idpw == null) { return new AccessContext(TYPE_INVALID, cell, baseUri, InvalidReason.basicAuthFormat); } @@ -356,11 +356,11 @@ private static AccessContext createBasicAuthz(final String authzHeaderValue, fin * @param authzHeaderValue Authorizationヘッダの値 * @param cell アクセスしているCell * @param baseUri アクセスしているbaseUri - * @param xDcUnitUser X-DC-UnitUserヘッダ + * @param xPersoniumUnitUser X-Personium-UnitUserヘッダ * @return 生成されたAccessContextオブジェクト */ private static AccessContext createBearerAuthz(final String authzHeaderValue, final Cell cell, - final String baseUri, final String host, String xDcUnitUser) { + final String baseUri, final String host, String xPersoniumUnitUser) { // Bearer // 認証トークンの値が[Bearer ]で開始していなければ不正なトークンと判断する if (!authzHeaderValue.startsWith(OAuth2Helper.Scheme.BEARER_CREDENTIALS_PREFIX)) { @@ -368,14 +368,14 @@ private static AccessContext createBearerAuthz(final String authzHeaderValue, fi } String accessToken = authzHeaderValue.substring(OAuth2Helper.Scheme.BEARER.length() + 1); // マスタートークンの検出 - // マスタートークン指定で、X-Dc-UnitUserヘッダがなかった場合はマスタートークン扱い - if (DcCoreConfig.getMasterToken().equals(accessToken) && xDcUnitUser == null) { + // マスタートークン指定で、X-Personium-UnitUserヘッダがなかった場合はマスタートークン扱い + if (PersoniumUnitConfig.getMasterToken().equals(accessToken) && xPersoniumUnitUser == null) { AccessContext ret = new AccessContext(TYPE_UNIT_MASTER, cell, baseUri); return ret; - } else if (DcCoreConfig.getMasterToken().equals(accessToken) && xDcUnitUser != null) { - // X-Dc-UnitUserヘッダ指定だとマスターからユニットユーザトークンへの降格 + } else if (PersoniumUnitConfig.getMasterToken().equals(accessToken) && xPersoniumUnitUser != null) { + // X-Personium-UnitUserヘッダ指定だとマスターからユニットユーザトークンへの降格 AccessContext ret = new AccessContext(TYPE_UNIT_USER, cell, baseUri); - ret.subject = xDcUnitUser; + ret.subject = xPersoniumUnitUser; return ret; } // 以降、Cellレベル。 @@ -388,16 +388,16 @@ private static AccessContext createBearerAuthz(final String authzHeaderValue, fi tk = AbstractOAuth2Token.parse(accessToken, issuer, host); } catch (TokenParseException e) { // パースに失敗したので - DcCoreLog.Auth.TOKEN_PARSE_ERROR.params(e.getMessage()).writeLog(); + PersoniumCoreLog.Auth.TOKEN_PARSE_ERROR.params(e.getMessage()).writeLog(); return new AccessContext(TYPE_INVALID, cell, baseUri, InvalidReason.tokenParseError); } catch (TokenDsigException e) { // 証明書検証に失敗したので - DcCoreLog.Auth.TOKEN_DISG_ERROR.params(e.getMessage()).writeLog(); + PersoniumCoreLog.Auth.TOKEN_DISG_ERROR.params(e.getMessage()).writeLog(); return new AccessContext(TYPE_INVALID, cell, baseUri, InvalidReason.tokenDsigError); } catch (TokenRootCrtException e) { // ルートCA証明書の設定エラー - DcCoreLog.Auth.ROOT_CA_CRT_SETTING_ERROR.params(e.getMessage()).writeLog(); - throw DcCoreException.Auth.ROOT_CA_CRT_SETTING_ERROR; + PersoniumCoreLog.Auth.ROOT_CA_CRT_SETTING_ERROR.params(e.getMessage()).writeLog(); + throw PersoniumCoreException.Auth.ROOT_CA_CRT_SETTING_ERROR; } log.debug(tk.getClass().getCanonicalName()); // AccessTokenではない場合、すなわちリフレッシュトークン。 @@ -418,7 +418,7 @@ private static AccessContext createBearerAuthz(final String authzHeaderValue, fi String acct = tk.getSubject(); ret.roles = cell.getRoleListForAccount(acct); if (ret.roles == null) { - throw DcCoreAuthzException.AUTHORIZATION_REQUIRED.realm(getRealm(baseUri, cell), + throw PersoniumCoreAuthzException.AUTHORIZATION_REQUIRED.realm(getRealm(baseUri, cell), AcceptableAuthScheme.BEARER); } // AccessContextではSubjectはURLに正規化。 @@ -443,7 +443,7 @@ private static AccessContext createBearerAuthz(final String authzHeaderValue, fi // TCATの場合はユニットユーザトークンである可能性をチェック // TCATがユニットユーザトークンである条件1:Targetが自分のユニットであること。 // TCATがユニットユーザトークンである条件2:Issuerが設定に存在するUnitUserCellであること。 - if (tca.getTarget().equals(baseUri) && DcCoreConfig.checkUnitUserIssuers(tca.getIssuer())) { + if (tca.getTarget().equals(baseUri) && PersoniumUnitConfig.checkUnitUserIssuers(tca.getIssuer())) { // ロール情報をとってきて、ユニットアドミンロールがついていた場合、ユニットアドミンに昇格させる。 List roles = tca.getRoles(); @@ -463,7 +463,7 @@ private static AccessContext createBearerAuthz(final String authzHeaderValue, fi return ret; } else if (cell == null) { // ユニットレベルでCellが空のトークンを許すのはマスタートークンと、ユニットユーザトークンだけなので無効なトークン扱いにする。 - throw DcCoreException.Auth.UNITUSER_ACCESS_REQUIRED; + throw PersoniumCoreException.Auth.UNITUSER_ACCESS_REQUIRED; } else { // TCATの処理 ret.accessType = TYPE_TRANS; @@ -612,10 +612,10 @@ public void checkCellIssueToken(AcceptableAuthScheme acceptableAuthScheme) { this.throwInvalidTokenException(acceptableAuthScheme); } else if (AccessContext.TYPE_ANONYMOUS.equals(this.getType())) { - throw DcCoreAuthzException.AUTHORIZATION_REQUIRED.realm(getRealm(), acceptableAuthScheme); + throw PersoniumCoreAuthzException.AUTHORIZATION_REQUIRED.realm(getRealm(), acceptableAuthScheme); } else { - throw DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + throw PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; } } @@ -631,10 +631,10 @@ public void checkMyLocalToken(Cell cellname, AcceptableAuthScheme acceptableAuth this.throwInvalidTokenException(acceptableAuthScheme); } else if (AccessContext.TYPE_ANONYMOUS.equals(this.getType()) || AccessContext.TYPE_BASIC.equals(this.getType())) { - throw DcCoreAuthzException.AUTHORIZATION_REQUIRED.realm(getRealm(), acceptableAuthScheme); + throw PersoniumCoreAuthzException.AUTHORIZATION_REQUIRED.realm(getRealm(), acceptableAuthScheme); } else if (!(this.getType() == AccessContext.TYPE_LOCAL && this.getCell().getName().equals(cellname.getName()))) { - throw DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + throw PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; } } @@ -662,7 +662,7 @@ public void checkSchemaAccess(String settingConfidentialLevel, Box box, Acceptab if (AccessContext.TYPE_INVALID.equals(this.getType())) { this.throwInvalidTokenException(acceptableAuthScheme); } else if (AccessContext.TYPE_ANONYMOUS.equals(this.getType())) { - throw DcCoreAuthzException.AUTHORIZATION_REQUIRED.realm(getRealm(), acceptableAuthScheme); + throw PersoniumCoreAuthzException.AUTHORIZATION_REQUIRED.realm(getRealm(), acceptableAuthScheme); } // トークン内のスキーマチェック(Boxレベル以下かつマスタートークン以外のアクセスの場合のみ) @@ -673,11 +673,11 @@ public void checkSchemaAccess(String settingConfidentialLevel, Box box, Acceptab // ボックスのスキーマが未設定の場合チェックしない if (boxSchema != null) { if (tokenSchema == null) { - throw DcCoreException.Auth.SCHEMA_AUTH_REQUIRED; + throw PersoniumCoreException.Auth.SCHEMA_AUTH_REQUIRED; // トークンスキーマがConfidentialの場合、#cを削除して比較する } else if (!tokenSchema.replaceAll(OAuth2Helper.Key.CONFIDENTIAL_MARKER, "").equals(boxSchema)) { // 認証・ボックスのスキーマが設定済かつ等しいくない場合 - throw DcCoreException.Auth.SCHEMA_MISMATCH; + throw PersoniumCoreException.Auth.SCHEMA_MISMATCH; } } } @@ -693,7 +693,7 @@ public void checkSchemaAccess(String settingConfidentialLevel, Box box, Acceptab // 設定がCONFIDENTIALの場合はトークン(ac)のスキーマがCONFIDENTIALならOK return; } - throw DcCoreException.Auth.INSUFFICIENT_SCHEMA_AUTHZ_LEVEL; + throw PersoniumCoreException.Auth.INSUFFICIENT_SCHEMA_AUTHZ_LEVEL; } /** @@ -746,28 +746,28 @@ public void throwInvalidTokenException(AcceptableAuthScheme allowedAuthScheme) { switch (this.invalidReason) { case expired: - throw DcCoreAuthzException.EXPIRED_ACCESS_TOKEN.realm(realm, allowedAuthScheme); + throw PersoniumCoreAuthzException.EXPIRED_ACCESS_TOKEN.realm(realm, allowedAuthScheme); case authenticationScheme: - throw DcCoreAuthzException.INVALID_AUTHN_SCHEME.realm(realm, allowedAuthScheme); + throw PersoniumCoreAuthzException.INVALID_AUTHN_SCHEME.realm(realm, allowedAuthScheme); case basicAuthFormat: - throw DcCoreAuthzException.BASIC_AUTH_FORMAT_ERROR.realm(realm, allowedAuthScheme); + throw PersoniumCoreAuthzException.BASIC_AUTH_FORMAT_ERROR.realm(realm, allowedAuthScheme); case basicNotAllowed: - throw DcCoreAuthzException.AUTHORIZATION_REQUIRED.realm(getRealm(), allowedAuthScheme); + throw PersoniumCoreAuthzException.AUTHORIZATION_REQUIRED.realm(getRealm(), allowedAuthScheme); case basicAuthError: - throw DcCoreAuthzException.BASIC_AUTHENTICATION_FAILED.realm(realm, allowedAuthScheme); + throw PersoniumCoreAuthzException.BASIC_AUTHENTICATION_FAILED.realm(realm, allowedAuthScheme); case basicAuthErrorInAccountLock: - throw DcCoreAuthzException.BASIC_AUTHENTICATION_FAILED_IN_ACCOUNT_LOCK.realm(realm, + throw PersoniumCoreAuthzException.BASIC_AUTHENTICATION_FAILED_IN_ACCOUNT_LOCK.realm(realm, allowedAuthScheme); case cookieAuthError: - throw DcCoreAuthzException.COOKIE_AUTHENTICATION_FAILED.realm(realm, allowedAuthScheme); + throw PersoniumCoreAuthzException.COOKIE_AUTHENTICATION_FAILED.realm(realm, allowedAuthScheme); case tokenParseError: - throw DcCoreAuthzException.TOKEN_PARSE_ERROR.realm(realm, allowedAuthScheme); + throw PersoniumCoreAuthzException.TOKEN_PARSE_ERROR.realm(realm, allowedAuthScheme); case refreshToken: - throw DcCoreAuthzException.ACCESS_WITH_REFRESH_TOKEN.realm(realm, allowedAuthScheme); + throw PersoniumCoreAuthzException.ACCESS_WITH_REFRESH_TOKEN.realm(realm, allowedAuthScheme); case tokenDsigError: - throw DcCoreAuthzException.TOKEN_DISG_ERROR.realm(realm, allowedAuthScheme); + throw PersoniumCoreAuthzException.TOKEN_DISG_ERROR.realm(realm, allowedAuthScheme); default: - throw DcCoreException.Server.UNKNOWN_ERROR; + throw PersoniumCoreException.Server.UNKNOWN_ERROR; } } diff --git a/src/main/java/com/fujitsu/dc/core/auth/AuthUtils.java b/src/main/java/io/personium/core/auth/AuthUtils.java similarity index 75% rename from src/main/java/com/fujitsu/dc/core/auth/AuthUtils.java rename to src/main/java/io/personium/core/auth/AuthUtils.java index a3dde2612..33613c0e6 100644 --- a/src/main/java/com/fujitsu/dc/core/auth/AuthUtils.java +++ b/src/main/java/io/personium/core/auth/AuthUtils.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.auth; +package io.personium.core.auth; import java.io.UnsupportedEncodingException; import java.security.MessageDigest; @@ -26,11 +26,11 @@ import org.apache.commons.lang.CharEncoding; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.Account; -import com.fujitsu.dc.core.odata.OEntityWrapper; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.Account; +import io.personium.core.odata.OEntityWrapper; /** * 認証関連のユーティリティ. @@ -57,12 +57,12 @@ public static String hashPassword(final String passwd) { // DC0 Ruby Code // Digest::SHA256.hexdigest(pw + "Password hash salt value") - String str2hash = passwd + DcCoreConfig.getAuthPasswordSalt(); + String str2hash = passwd + PersoniumUnitConfig.getAuthPasswordSalt(); try { MessageDigest md = MessageDigest.getInstance(MD_ALGORITHM); byte[] digestBytes = md.digest(str2hash.getBytes(CharEncoding.UTF_8)); // そちらのほうがデータ効率は良いが、DC0との互換性のためにこの実装としている。 - return DcCoreUtils.byteArray2HexString(digestBytes); + return PersoniumCoreUtils.byteArray2HexString(digestBytes); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); } catch (UnsupportedEncodingException e) { @@ -72,26 +72,26 @@ public static String hashPassword(final String passwd) { /** * パスワードのバリデートチェックをする. - * @param dcCredHeader dcCredHeader + * @param pCredHeader pCredHeader * @param entitySetName entitySetName * @return Hash文字列化されたパスワード */ - public static String checkValidatePassword(final String dcCredHeader, String entitySetName) { + public static String checkValidatePassword(final String pCredHeader, String entitySetName) { if (Account.EDM_TYPE_NAME.equals(entitySetName)) { - if (dcCredHeader != null) { - if ((dcCredHeader.length() >= MIN_PASSWORD_LENGTH) - && (dcCredHeader.length() <= MAX_PASSWORD_LENGTH)) { + if (pCredHeader != null) { + if ((pCredHeader.length() >= MIN_PASSWORD_LENGTH) + && (pCredHeader.length() <= MAX_PASSWORD_LENGTH)) { String regex = "^[a-zA-Z0-9-_]{0,}$"; Pattern pattern = Pattern.compile(regex); - Matcher m = pattern.matcher(dcCredHeader); + Matcher m = pattern.matcher(pCredHeader); if (!m.find()) { - throw DcCoreException.Auth.PASSWORD_INVALID; + throw PersoniumCoreException.Auth.PASSWORD_INVALID; } } else { - throw DcCoreException.Auth.PASSWORD_INVALID; + throw PersoniumCoreException.Auth.PASSWORD_INVALID; } } - String hPassStr = AuthUtils.hashPassword(dcCredHeader); + String hPassStr = AuthUtils.hashPassword(pCredHeader); return hPassStr; } return null; diff --git a/src/main/java/com/fujitsu/dc/core/auth/BoxPrivilege.java b/src/main/java/io/personium/core/auth/BoxPrivilege.java similarity index 93% rename from src/main/java/com/fujitsu/dc/core/auth/BoxPrivilege.java rename to src/main/java/io/personium/core/auth/BoxPrivilege.java index 26da982c4..a9c4ffc06 100644 --- a/src/main/java/com/fujitsu/dc/core/auth/BoxPrivilege.java +++ b/src/main/java/io/personium/core/auth/BoxPrivilege.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.auth; +package io.personium.core.auth; import java.util.HashMap; import java.util.Map; @@ -36,14 +36,14 @@ public final class BoxPrivilege extends Privilege { * @param name Privilege名 * @param parent 親Privilege */ - BoxPrivilege(final String name, final BoxPrivilege parent) { + BoxPrivilege(final String name, final Privilege parent) { super(name, parent); } /** * すべての権限. */ - public static final BoxPrivilege ALL = new BoxPrivilege("all"); + public static final BoxPrivilege ALL = new BoxPrivilege("all", CellPrivilege.ROOT); /** * リード権限. */ diff --git a/src/main/java/com/fujitsu/dc/core/auth/CellPrivilege.java b/src/main/java/io/personium/core/auth/CellPrivilege.java similarity index 91% rename from src/main/java/com/fujitsu/dc/core/auth/CellPrivilege.java rename to src/main/java/io/personium/core/auth/CellPrivilege.java index 921718885..97bb5603b 100644 --- a/src/main/java/com/fujitsu/dc/core/auth/CellPrivilege.java +++ b/src/main/java/io/personium/core/auth/CellPrivilege.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.auth; +package io.personium.core.auth; import java.util.HashMap; import java.util.Map; @@ -43,11 +43,11 @@ public final class CellPrivilege extends Privilege { /** * すべての権限. */ - public static final CellPrivilege ALL = new CellPrivilege("all"); + public static final CellPrivilege ROOT = new CellPrivilege("root"); /** * Account, Role, extRole グループ操作権限. */ - public static final CellPrivilege AUTH = new CellPrivilege("auth", ALL); + public static final CellPrivilege AUTH = new CellPrivilege("auth", ROOT); /** * AUTHグループ read権限. */ @@ -55,7 +55,7 @@ public final class CellPrivilege extends Privilege { /** * ReceivedMessage, SentMessage グループ操作権限. */ - public static final CellPrivilege MESSAGE = new CellPrivilege("message", ALL); + public static final CellPrivilege MESSAGE = new CellPrivilege("message", ROOT); /** * MESSAGEグループ read権限. */ @@ -63,7 +63,7 @@ public final class CellPrivilege extends Privilege { /** * event, log グループ操作権限. */ - public static final CellPrivilege EVENT = new CellPrivilege("event", ALL); + public static final CellPrivilege EVENT = new CellPrivilege("event", ROOT); /** * EVENTグループ read権限. */ @@ -71,7 +71,7 @@ public final class CellPrivilege extends Privilege { /** * log 操作権限. */ - public static final CellPrivilege LOG = new CellPrivilege("log", ALL); + public static final CellPrivilege LOG = new CellPrivilege("log", ROOT); /** * log read権限. */ @@ -79,7 +79,7 @@ public final class CellPrivilege extends Privilege { /** * relation, extCell グループ操作権限. */ - public static final CellPrivilege SOCIAL = new CellPrivilege("social", ALL); + public static final CellPrivilege SOCIAL = new CellPrivilege("social", ROOT); /** * SOCIALグループ read権限. */ @@ -87,7 +87,7 @@ public final class CellPrivilege extends Privilege { /** * Box グループ操作権限. */ - public static final CellPrivilege BOX = new CellPrivilege("box", ALL); + public static final CellPrivilege BOX = new CellPrivilege("box", ROOT); /** * BOXグループ read権限. */ @@ -99,7 +99,7 @@ public final class CellPrivilege extends Privilege { /** * ACL グループ操作権限. */ - public static final CellPrivilege ACL = new CellPrivilege("acl", ALL); + public static final CellPrivilege ACL = new CellPrivilege("acl", ROOT); /** * ACLグループ read権限. */ @@ -107,7 +107,7 @@ public final class CellPrivilege extends Privilege { /** * PROPFIND権限. */ - public static final CellPrivilege PROPFIND = new CellPrivilege("propfind", ALL); + public static final CellPrivilege PROPFIND = new CellPrivilege("propfind", ROOT); static Map map = new HashMap(); @@ -120,7 +120,7 @@ public static Map getPrivilegeMap() { } static { - register(ALL); + register(ROOT); register(AUTH); register(AUTH_READ); register(MESSAGE); diff --git a/src/main/java/com/fujitsu/dc/core/auth/IdToken.java b/src/main/java/io/personium/core/auth/IdToken.java similarity index 83% rename from src/main/java/com/fujitsu/dc/core/auth/IdToken.java rename to src/main/java/io/personium/core/auth/IdToken.java index 0497924c8..a6a952aff 100644 --- a/src/main/java/com/fujitsu/dc/core/auth/IdToken.java +++ b/src/main/java/io/personium/core/auth/IdToken.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.auth; +package io.personium.core.auth; import java.io.IOException; import java.io.InputStream; @@ -41,9 +41,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreAuthnException; -import com.fujitsu.dc.core.DcCoreException; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumCoreAuthnException; +import io.personium.core.PersoniumCoreException; /** * IdToken. @@ -105,13 +105,13 @@ public IdToken(JSONObject json) { * 最終検証結果を返す. * @param null * @retrun boolean - * @throws DcCoreAuthnException dcae + * @throws PersoniumCoreAuthnException pcae */ - public void verify() throws DcCoreAuthnException { + public void verify() throws PersoniumCoreAuthnException { // expireしていないかチェック(60秒くらいは過ぎても良い) boolean expired = (exp + VERIFY_WAIT) * VERIFY_SECOND < System.currentTimeMillis(); if (expired) { - throw DcCoreAuthnException.OIDC_EXPIRED_ID_TOKEN.params(exp); + throw PersoniumCoreAuthnException.OIDC_EXPIRED_ID_TOKEN.params(exp); } // 署名検証 verifySignature(); @@ -129,10 +129,10 @@ private void verifySignature() { Signature sig = Signature.getInstance(ALG); sig.initVerify(rsaPubKey); sig.update((this.getHeader() + "." + this.getPayload()).getBytes()); - boolean verified = sig.verify(DcCoreUtils.decodeBase64Url(this.getSignature())); + boolean verified = sig.verify(PersoniumCoreUtils.decodeBase64Url(this.getSignature())); if (!verified) { // 署名検証結果、署名が不正であると認定 - throw DcCoreAuthnException.OIDC_AUTHN_FAILED; + throw PersoniumCoreAuthnException.OIDC_AUTHN_FAILED; } } catch (NoSuchAlgorithmException e) { // 環境がおかしい以外でここには来ない @@ -146,7 +146,7 @@ private void verifySignature() { // type, // if this signature algorithm is unable to process the input data // provided, etc. - throw DcCoreAuthnException.OIDC_INVALID_ID_TOKEN.params("ID Token sig value is invalid."); + throw PersoniumCoreAuthnException.OIDC_INVALID_ID_TOKEN.params("ID Token sig value is invalid."); } } @@ -161,15 +161,15 @@ private RSAPublicKey getKey() { JSONObject k = (JSONObject) jsonAry.get(i); String compKid = (String) k.get(KID); if (compKid.equals(this.getKid())) { - BigInteger n = new BigInteger(1, DcCoreUtils.decodeBase64Url((String) k.get(N))); - BigInteger e = new BigInteger(1, DcCoreUtils.decodeBase64Url((String) k.get(E))); + BigInteger n = new BigInteger(1, PersoniumCoreUtils.decodeBase64Url((String) k.get(N))); + BigInteger e = new BigInteger(1, PersoniumCoreUtils.decodeBase64Url((String) k.get(E))); RSAPublicKeySpec rsaPubKey = new RSAPublicKeySpec(n, e); try { KeyFactory kf = KeyFactory.getInstance((String) k.get(KTY)); return (RSAPublicKey) kf.generatePublic(rsaPubKey); } catch (NoSuchAlgorithmException e1) { // ktyの値がRSA以外はサポートしない - throw DcCoreException.NetWork.UNEXPECTED_VALUE.params(KTY, "RSA").reason(e1); + throw PersoniumCoreException.NetWork.UNEXPECTED_VALUE.params(KTY, "RSA").reason(e1); } catch (InvalidKeySpecException e1) { // バグ以外でここには来ない throw new RuntimeException(e1); @@ -177,7 +177,7 @@ private RSAPublicKey getKey() { } } // 該当するkidを持つ鍵情報が取れなかった場合 - throw DcCoreAuthnException.OIDC_INVALID_ID_TOKEN.params("ID Token header value is invalid."); + throw PersoniumCoreAuthnException.OIDC_INVALID_ID_TOKEN.params("ID Token header value is invalid."); } /** @@ -191,15 +191,15 @@ public static IdToken parse(String idTokenStr) { IdToken ret = new IdToken(); String[] splitIdToken = idTokenStr.split("\\."); if (splitIdToken.length != SPLIT_TOKEN_NUM) { - throw DcCoreAuthnException.OIDC_INVALID_ID_TOKEN.params("2 periods required."); + throw PersoniumCoreAuthnException.OIDC_INVALID_ID_TOKEN.params("2 periods required."); } ret.header = splitIdToken[0]; ret.payload = splitIdToken[1]; ret.signature = splitIdToken[2]; try { - String headerDecoded = new String(DcCoreUtils.decodeBase64Url(ret.header), StandardCharsets.UTF_8); - String payloadDecoded = new String(DcCoreUtils.decodeBase64Url(ret.payload), StandardCharsets.UTF_8); + String headerDecoded = new String(PersoniumCoreUtils.decodeBase64Url(ret.header), StandardCharsets.UTF_8); + String payloadDecoded = new String(PersoniumCoreUtils.decodeBase64Url(ret.payload), StandardCharsets.UTF_8); JSONObject header = (JSONObject) new JSONParser().parse(headerDecoded); JSONObject payload = (JSONObject) new JSONParser().parse(payloadDecoded); @@ -210,11 +210,11 @@ public static IdToken parse(String idTokenStr) { ret.exp = (Long) payload.get(EXP); } catch (ParseException e) { // BASE64はOk.JSONのパースに失敗. - throw DcCoreAuthnException.OIDC_INVALID_ID_TOKEN + throw PersoniumCoreAuthnException.OIDC_INVALID_ID_TOKEN .params("Header and payload should be Base64 encoded JSON."); } catch (Exception e) { // BASE64が失敗. - throw DcCoreAuthnException.OIDC_INVALID_ID_TOKEN.params("Header and payload should be Base64 encoded."); + throw PersoniumCoreAuthnException.OIDC_INVALID_ID_TOKEN.params("Header and payload should be Base64 encoded."); } return ret; } @@ -246,18 +246,18 @@ public static JSONObject getHttpJSON(String url) { HttpResponse res = httpClient.execute(get); InputStream is = res.getEntity().getContent(); status = res.getStatusLine().getStatusCode(); - String body = DcCoreUtils.readInputStreamAsString(is); + String body = PersoniumCoreUtils.readInputStreamAsString(is); JSONObject jsonObj = (JSONObject) new JSONParser().parse(body); return jsonObj; } catch (ClientProtocolException e) { // HTTPのプロトコル違反 - throw DcCoreException.NetWork.UNEXPECTED_RESPONSE.params(url, "proper HTTP response", status).reason(e); + throw PersoniumCoreException.NetWork.UNEXPECTED_RESPONSE.params(url, "proper HTTP response", status).reason(e); } catch (IOException e) { // サーバーに接続できない場合に発生 - throw DcCoreException.NetWork.HTTP_REQUEST_FAILED.params(HttpGet.METHOD_NAME, url).reason(e); + throw PersoniumCoreException.NetWork.HTTP_REQUEST_FAILED.params(HttpGet.METHOD_NAME, url).reason(e); } catch (ParseException e) { // JSONでないものを返してきた - throw DcCoreException.NetWork.UNEXPECTED_RESPONSE.params(url, "JSON", status).reason(e); + throw PersoniumCoreException.NetWork.UNEXPECTED_RESPONSE.params(url, "JSON", status).reason(e); } } diff --git a/src/main/java/com/fujitsu/dc/core/auth/OAuth2Helper.java b/src/main/java/io/personium/core/auth/OAuth2Helper.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/auth/OAuth2Helper.java rename to src/main/java/io/personium/core/auth/OAuth2Helper.java index 070c1aec5..061170648 100644 --- a/src/main/java/com/fujitsu/dc/core/auth/OAuth2Helper.java +++ b/src/main/java/io/personium/core/auth/OAuth2Helper.java @@ -14,11 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.auth; +package io.personium.core.auth; import javax.xml.namespace.QName; -import com.fujitsu.dc.common.utils.DcCoreUtils; +import io.personium.common.utils.PersoniumCoreUtils; /** * OAuth2まわりのユーティリティ. @@ -154,9 +154,9 @@ public static class GrantType { */ public static final String REFRESH_TOKEN = "refresh_token"; /** - * dc1-oidc google. + * Grant Type URN for oidc google. */ - public static final String DC1_OIDC_GOOGLE = "urn:x-dc1:oidc:google"; + public static final String URN_OIDC_GOOGLE = "urn:x-personium:oidc:google"; } @@ -264,15 +264,15 @@ public static class Key { */ public static final String SCOPE = "scope"; /** - * dc_target. + * p_target. */ - public static final String TARGET = "dc_target"; + public static final String TARGET = "p_target"; /** - * dc_owner. + * p_owner. */ - public static final String OWNER = "dc_owner"; + public static final String OWNER = "p_owner"; /** - * dc_owner value. + * p_owner value. */ public static final String TRUE_STR = "true"; /** @@ -294,12 +294,12 @@ public static class Key { /** * ownerRepresentativeAccounts. */ - public static final QName PROP_KEY_OWNER_REPRESENTIVE_ACCOUNTS = new QName(DcCoreUtils.XmlConst.NS_DC1, + public static final QName PROP_KEY_OWNER_REPRESENTIVE_ACCOUNTS = new QName(PersoniumCoreUtils.XmlConst.NS_PERSONIUM, "ownerRepresentativeAccounts"); /** * ownerRepresentativeAccount. */ - public static final QName PROP_KEY_OWNER_REPRESENTIVE_ACCOUNT = new QName(DcCoreUtils.XmlConst.NS_DC1, + public static final QName PROP_KEY_OWNER_REPRESENTIVE_ACCOUNT = new QName(PersoniumCoreUtils.XmlConst.NS_PERSONIUM, "account"); } diff --git a/src/main/java/com/fujitsu/dc/core/auth/Privilege.java b/src/main/java/io/personium/core/auth/Privilege.java similarity index 94% rename from src/main/java/com/fujitsu/dc/core/auth/Privilege.java rename to src/main/java/io/personium/core/auth/Privilege.java index f2beaa520..9cd789235 100644 --- a/src/main/java/com/fujitsu/dc/core/auth/Privilege.java +++ b/src/main/java/io/personium/core/auth/Privilege.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.auth; +package io.personium.core.auth; /** diff --git a/src/main/java/com/fujitsu/dc/core/auth/package-info.java b/src/main/java/io/personium/core/auth/package-info.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/auth/package-info.java rename to src/main/java/io/personium/core/auth/package-info.java index 4db0202b0..3f84d57df 100644 --- a/src/main/java/com/fujitsu/dc/core/auth/package-info.java +++ b/src/main/java/io/personium/core/auth/package-info.java @@ -17,4 +17,4 @@ /** * classes for authentication / authorization. */ -package com.fujitsu.dc.core.auth; +package io.personium.core.auth; diff --git a/src/main/java/com/fujitsu/dc/core/bar/BarFileInstaller.java b/src/main/java/io/personium/core/bar/BarFileInstaller.java similarity index 81% rename from src/main/java/com/fujitsu/dc/core/bar/BarFileInstaller.java rename to src/main/java/io/personium/core/bar/BarFileInstaller.java index 1d15d407c..ad233c4ca 100644 --- a/src/main/java/com/fujitsu/dc/core/bar/BarFileInstaller.java +++ b/src/main/java/io/personium/core/bar/BarFileInstaller.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.bar; +package io.personium.core.bar; import java.io.File; import java.io.FileDescriptor; @@ -46,17 +46,17 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.auth.CellPrivilege; -import com.fujitsu.dc.core.bar.jackson.JSONManifest; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.odata.DcODataProducer; -import com.fujitsu.dc.core.odata.DcOptionsQueryParser; -import com.fujitsu.dc.core.rs.odata.ODataEntityResource; -import com.fujitsu.dc.core.rs.odata.ODataResource; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.auth.AccessContext; +import io.personium.core.auth.CellPrivilege; +import io.personium.core.bar.jackson.JSONManifest; +import io.personium.core.model.Box; +import io.personium.core.model.Cell; +import io.personium.core.odata.PersoniumODataProducer; +import io.personium.core.odata.PersoniumOptionsQueryParser; +import io.personium.core.rs.odata.ODataEntityResource; +import io.personium.core.rs.odata.ODataResource; /** * barファイルインストール処理を行うクラス. @@ -75,7 +75,7 @@ public class BarFileInstaller { private ODataEntityResource oDataEntityResource; private UriInfo uriInfo; - private String barTempDir = DcCoreConfig.get(DcCoreConfig.BAR.BAR_INSTALLFILE_DIR); + private String barTempDir = PersoniumUnitConfig.get(PersoniumUnitConfig.BAR.BAR_INSTALLFILE_DIR); private JSONObject manifestJson; @@ -136,7 +136,7 @@ public Response barFileInstall(Map headers, runner.setEntryCount(entryCount); runner.writeInitProgressCache(); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { if (null != runner) { runner.writeErrorProgressCache(); } @@ -147,7 +147,7 @@ public Response barFileInstall(Map headers, runner.writeErrorProgressCache(); } removeBarFile(barFile); - throw DcCoreException.Server.UNKNOWN_ERROR; + throw PersoniumCoreException.Server.UNKNOWN_ERROR; } finally { IOUtils.closeQuietly(inStream); } @@ -193,39 +193,39 @@ private void checkHeaders(Map headers) { // Content-Type: application/zip固定 String contentType = headers.get(HttpHeaders.CONTENT_TYPE); if (!"application/zip".equals(contentType)) { - throw DcCoreException.BarInstall.REQUEST_HEADER_FORMAT_ERROR + throw PersoniumCoreException.BarInstall.REQUEST_HEADER_FORMAT_ERROR .params(HttpHeaders.CONTENT_TYPE); } } /** * システムプロパティに設定されているbarファイルの最大ファイルサイズ(MB)を取得する。 - * @return com.fujitsu.dc.core.bar.file.maxSize + * @return io.personium.core.bar.file.maxSize */ protected long getMaxBarFileSize() { long maxBarFileSize; try { - maxBarFileSize = Long.parseLong(DcCoreConfig - .get(DcCoreConfig.BAR.BAR_FILE_MAX_SIZE)); + maxBarFileSize = Long.parseLong(PersoniumUnitConfig + .get(PersoniumUnitConfig.BAR.BAR_FILE_MAX_SIZE)); } catch (NumberFormatException ne) { - throw DcCoreException.Server.UNKNOWN_ERROR; + throw PersoniumCoreException.Server.UNKNOWN_ERROR; } return maxBarFileSize; } /** * プロパティファイルからBARファイル内の最大ファイルサイズ(MB)を取得する。 - * @return com.fujitsu.dc.core.bar.entry.maxSize + * @return io.personium.core.bar.entry.maxSize */ protected long getMaxBarEntryFileSize() { long maxBarFileSize; try { - maxBarFileSize = Long.parseLong(DcCoreConfig - .get(DcCoreConfig.BAR.BAR_ENTRY_MAX_SIZE)); + maxBarFileSize = Long.parseLong(PersoniumUnitConfig + .get(PersoniumUnitConfig.BAR.BAR_ENTRY_MAX_SIZE)); } catch (NumberFormatException ne) { - log.info("NumberFormatException" + DcCoreConfig - .get(DcCoreConfig.BAR.BAR_ENTRY_MAX_SIZE)); - throw DcCoreException.Server.UNKNOWN_ERROR; + log.info("NumberFormatException" + PersoniumUnitConfig + .get(PersoniumUnitConfig.BAR.BAR_ENTRY_MAX_SIZE)); + throw PersoniumCoreException.Server.UNKNOWN_ERROR; } return maxBarFileSize; } @@ -251,7 +251,7 @@ private File storeTemporaryBarFile(InputStream inStream) { File barFileDir = new File(new File(barTempDir, unitUserName), "bar"); if (!barFileDir.exists() && !barFileDir.mkdirs()) { String message = "unable create directory: " + barFileDir.getAbsolutePath(); - throw DcCoreException.Server.FILE_SYSTEM_ERROR.params(message); + throw PersoniumCoreException.Server.FILE_SYSTEM_ERROR.params(message); } // barファイルをNFS上に格納する。 @@ -270,13 +270,13 @@ private File storeTemporaryBarFile(InputStream inStream) { } else { message = String.format(message, barFile.getAbsolutePath()); } - throw DcCoreException.Server.FILE_SYSTEM_ERROR.params(message); + throw PersoniumCoreException.Server.FILE_SYSTEM_ERROR.params(message); } finally { - if (null != outStream && DcCoreConfig.getFsyncEnabled()) { + if (null != outStream && PersoniumUnitConfig.getFsyncEnabled()) { try { sync(((FileOutputStream) outStream).getFD()); } catch (Exception e) { - throw DcCoreException.Server.FILE_SYSTEM_ERROR.params(e.getMessage()); + throw PersoniumCoreException.Server.FILE_SYSTEM_ERROR.params(e.getMessage()); } } IOUtils.closeQuietly(outStream); @@ -328,7 +328,7 @@ private long checkBarFileContents(File barFile) { } // barファイルの必須ファイルチェック(格納順はインストール時にチェックする) if (!checkBarFileStructures(zae, requiredBarFiles)) { - throw DcCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES.params(entryName); + throw PersoniumCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES.params(entryName); } } if (!requiredBarFiles.isEmpty()) { @@ -341,25 +341,25 @@ private long checkBarFileContents(File barFile) { entryNames.append(requiredFileNames[i]); } } - throw DcCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES.params(entryNames.toString()); + throw PersoniumCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES.params(entryNames.toString()); } return entryCount; - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { throw e; } catch (Exception e) { log.info(e.getMessage(), e.fillInStackTrace()); - throw DcCoreException.BarInstall.BAR_FILE_CANNOT_READ.params(entryName); + throw PersoniumCoreException.BarInstall.BAR_FILE_CANNOT_READ.params(entryName); } } catch (FileNotFoundException e) { - throw DcCoreException.BarInstall.BAR_FILE_CANNOT_OPEN.params("barFile"); + throw PersoniumCoreException.BarInstall.BAR_FILE_CANNOT_OPEN.params("barFile"); } catch (ZipException e) { - throw DcCoreException.BarInstall.BAR_FILE_CANNOT_OPEN.params(e.getMessage()); + throw PersoniumCoreException.BarInstall.BAR_FILE_CANNOT_OPEN.params(e.getMessage()); } catch (IOException e) { - throw DcCoreException.BarInstall.BAR_FILE_CANNOT_OPEN.params(e.getMessage()); - } catch (DcCoreException e) { + throw PersoniumCoreException.BarInstall.BAR_FILE_CANNOT_OPEN.params(e.getMessage()); + } catch (PersoniumCoreException e) { throw e; } catch (RuntimeException e) { - throw DcCoreException.Server.UNKNOWN_ERROR; + throw PersoniumCoreException.Server.UNKNOWN_ERROR; } finally { ZipFile.closeQuietly(zipFile); } @@ -371,7 +371,7 @@ private void checkAndReadManifest(String entryName, ZipArchiveEntry zae, ZipFile JSONManifest manifest = BarFileUtils.readJsonEntry(inStream, entryName, JSONManifest.class); if (!manifest.checkSchema()) { - throw DcCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES.params(entryName); + throw PersoniumCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES.params(entryName); } this.manifestJson = manifest.getJson(); } finally { @@ -391,7 +391,7 @@ protected void checkBarFileEntrySize(ZipArchiveEntry zae, String entryName, if (zae.getSize() > (long) (maxBarEntryFileSize * MB)) { String message = "Bar file entry size too large invalid file [%s: %sB]"; log.info(String.format(message, entryName, String.valueOf(zae.getSize()))); - throw DcCoreException.BarInstall.BAR_FILE_ENTRY_SIZE_TOO_LARGE + throw PersoniumCoreException.BarInstall.BAR_FILE_ENTRY_SIZE_TOO_LARGE .params(entryName, String.valueOf(zae.getSize())); } } @@ -406,7 +406,7 @@ protected void checkBarFileSize(File barFile) { if (barFile.length() > (long) (maxBarFileSize * MB)) { String message = "Bar file size too large invalid file [%sB]"; log.info(String.format(message, String.valueOf(barFile.length()))); - throw DcCoreException.BarInstall.BAR_FILE_SIZE_TOO_LARGE + throw PersoniumCoreException.BarInstall.BAR_FILE_SIZE_TOO_LARGE .params(String.valueOf(barFile.length())); } } @@ -440,23 +440,23 @@ private boolean checkBarFileStructures(ZipArchiveEntry zae, Map * インストール先Boxが既に登録されているかどうか、マニフェストに定義されているスキーマURLが既に登録されているかどうかをチェックする. */ private void checkDuplicateBoxAndSchema() { - DcODataProducer producer = oDataEntityResource.getOdataProducer(); + PersoniumODataProducer producer = oDataEntityResource.getOdataProducer(); // [400]既に同じscheme URLが設定されたBoxが存在している // 同じスキーマURLを持つBoxを検索し、1件以上ヒットした場合はエラーとする。 String schemaUrl = (String) this.manifestJson.get("Schema"); - BoolCommonExpression filter = DcOptionsQueryParser.parseFilter("Schema eq '" + schemaUrl + "'"); + BoolCommonExpression filter = PersoniumOptionsQueryParser.parseFilter("Schema eq '" + schemaUrl + "'"); QueryInfo query = new QueryInfo(null, null, null, filter, null, null, null, null, null); if (producer.getEntitiesCount(Box.EDM_TYPE_NAME, query).getCount() > 0) { - throw DcCoreException.BarInstall.BAR_FILE_BOX_SCHEMA_ALREADY_EXISTS.params(schemaUrl); + throw PersoniumCoreException.BarInstall.BAR_FILE_BOX_SCHEMA_ALREADY_EXISTS.params(schemaUrl); } // [405]既に同名のBoxが存在している // Box名のみで検索を行い、スキーマ有無に係わらず検索にヒットした場合はエラーとする。 - filter = DcOptionsQueryParser.parseFilter("Name eq '" + this.boxName + "'"); + filter = PersoniumOptionsQueryParser.parseFilter("Name eq '" + this.boxName + "'"); query = new QueryInfo(null, null, null, filter, null, null, null, null, null); if (producer.getEntitiesCount(Box.EDM_TYPE_NAME, query).getCount() > 0) { - throw DcCoreException.BarInstall.BAR_FILE_BOX_ALREADY_EXISTS.params(this.boxName); + throw PersoniumCoreException.BarInstall.BAR_FILE_BOX_ALREADY_EXISTS.params(this.boxName); } log.info("Install target Box is not found, able to install."); @@ -474,7 +474,7 @@ public String getCellName() { * ODataProducerの取得. * @return ODataProducer */ - public DcODataProducer getOdataProducer() { + public PersoniumODataProducer getOdataProducer() { return oDataEntityResource.getOdataProducer(); } diff --git a/src/main/java/com/fujitsu/dc/core/bar/BarFileReadRunner.java b/src/main/java/io/personium/core/bar/BarFileReadRunner.java similarity index 85% rename from src/main/java/com/fujitsu/dc/core/bar/BarFileReadRunner.java rename to src/main/java/io/personium/core/bar/BarFileReadRunner.java index 3daf20f54..19f4ba816 100644 --- a/src/main/java/com/fujitsu/dc/core/bar/BarFileReadRunner.java +++ b/src/main/java/io/personium/core/bar/BarFileReadRunner.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.bar; +package io.personium.core.bar; import java.io.BufferedReader; import java.io.ByteArrayInputStream; @@ -81,51 +81,51 @@ import org.slf4j.LoggerFactory; import org.w3c.dom.Element; -import com.fujitsu.dc.common.es.util.DcUUID; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.DcCoreMessageUtils; -import com.fujitsu.dc.core.bar.jackson.JSONExtRoles; -import com.fujitsu.dc.core.bar.jackson.JSONLinks; -import com.fujitsu.dc.core.bar.jackson.JSONManifest; -import com.fujitsu.dc.core.bar.jackson.JSONMappedObject; -import com.fujitsu.dc.core.bar.jackson.JSONRelations; -import com.fujitsu.dc.core.bar.jackson.JSONRoles; -import com.fujitsu.dc.core.bar.jackson.JSONUserDataLinks; -import com.fujitsu.dc.core.eventbus.DcEventBus; -import com.fujitsu.dc.core.eventbus.JSONEvent; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.BoxCmp; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.DavCmp; -import com.fujitsu.dc.core.model.DavCommon; -import com.fujitsu.dc.core.model.ModelFactory; -import com.fujitsu.dc.core.model.ctl.AssociationEnd; -import com.fujitsu.dc.core.model.ctl.ComplexType; -import com.fujitsu.dc.core.model.ctl.ComplexTypeProperty; -import com.fujitsu.dc.core.model.ctl.CtlSchema; -import com.fujitsu.dc.core.model.ctl.EntityType; -import com.fujitsu.dc.core.model.ctl.Event; -import com.fujitsu.dc.core.model.ctl.Event.LEVEL; -import com.fujitsu.dc.core.model.ctl.ExtRole; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.core.model.ctl.Relation; -import com.fujitsu.dc.core.model.ctl.Role; -import com.fujitsu.dc.core.model.impl.es.doc.EntitySetDocHandler; -import com.fujitsu.dc.core.model.impl.es.odata.UserDataODataProducer; -import com.fujitsu.dc.core.model.impl.es.odata.UserSchemaODataProducer; -import com.fujitsu.dc.core.model.progress.Progress; -import com.fujitsu.dc.core.model.progress.ProgressInfo; -import com.fujitsu.dc.core.model.progress.ProgressManager; -import com.fujitsu.dc.core.odata.DcEdmxFormatParser; -import com.fujitsu.dc.core.odata.DcODataProducer; -import com.fujitsu.dc.core.odata.OEntityWrapper; -import com.fujitsu.dc.core.rs.cell.EventResource; -import com.fujitsu.dc.core.rs.odata.BulkRequest; -import com.fujitsu.dc.core.rs.odata.ODataEntitiesResource; -import com.fujitsu.dc.core.rs.odata.ODataEntityResource; -import com.fujitsu.dc.core.rs.odata.ODataResource; +import io.personium.common.es.util.PersoniumUUID; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.PersoniumCoreMessageUtils; +import io.personium.core.bar.jackson.JSONExtRoles; +import io.personium.core.bar.jackson.JSONLinks; +import io.personium.core.bar.jackson.JSONManifest; +import io.personium.core.bar.jackson.JSONMappedObject; +import io.personium.core.bar.jackson.JSONRelations; +import io.personium.core.bar.jackson.JSONRoles; +import io.personium.core.bar.jackson.JSONUserDataLinks; +import io.personium.core.eventbus.PersoniumEventBus; +import io.personium.core.eventbus.JSONEvent; +import io.personium.core.model.Box; +import io.personium.core.model.BoxCmp; +import io.personium.core.model.Cell; +import io.personium.core.model.DavCmp; +import io.personium.core.model.DavCommon; +import io.personium.core.model.ModelFactory; +import io.personium.core.model.ctl.AssociationEnd; +import io.personium.core.model.ctl.ComplexType; +import io.personium.core.model.ctl.ComplexTypeProperty; +import io.personium.core.model.ctl.CtlSchema; +import io.personium.core.model.ctl.EntityType; +import io.personium.core.model.ctl.Event; +import io.personium.core.model.ctl.Event.LEVEL; +import io.personium.core.model.ctl.ExtRole; +import io.personium.core.model.ctl.Property; +import io.personium.core.model.ctl.Relation; +import io.personium.core.model.ctl.Role; +import io.personium.core.model.impl.es.doc.EntitySetDocHandler; +import io.personium.core.model.impl.es.odata.UserDataODataProducer; +import io.personium.core.model.impl.es.odata.UserSchemaODataProducer; +import io.personium.core.model.progress.Progress; +import io.personium.core.model.progress.ProgressInfo; +import io.personium.core.model.progress.ProgressManager; +import io.personium.core.odata.PersoniumEdmxFormatParser; +import io.personium.core.odata.PersoniumODataProducer; +import io.personium.core.odata.OEntityWrapper; +import io.personium.core.rs.cell.EventResource; +import io.personium.core.rs.odata.BulkRequest; +import io.personium.core.rs.odata.ODataEntitiesResource; +import io.personium.core.rs.odata.ODataEntityResource; +import io.personium.core.rs.odata.ODataResource; /** * Httpリクエストボディからbarファイルを読み込むためのクラス. @@ -156,7 +156,7 @@ public class BarFileReadRunner implements Runnable { private ZipArchiveInputStream zipArchiveInputStream; private final String boxName; private final ODataEntityResource odataEntityResource; - private final DcODataProducer odataProducer; + private final PersoniumODataProducer odataProducer; private final String entitySetName; private final UriInfo uriInfo; private final String requestKey; @@ -184,12 +184,12 @@ public class BarFileReadRunner implements Runnable { private BoxCmp boxCmp; private Map davCmpMap; private Map davFileMap = new HashMap(); - private long linksOutputStreamSize = Long.parseLong(DcCoreConfig - .get(DcCoreConfig.BAR.BAR_USERDATA_LINKS_OUTPUT_STREAM_SIZE)); - private long bulkSize = Long.parseLong(DcCoreConfig - .get(DcCoreConfig.BAR.BAR_USERDATA_BULK_SIZE)); + private long linksOutputStreamSize = Long.parseLong(PersoniumUnitConfig + .get(PersoniumUnitConfig.BAR.BAR_USERDATA_LINKS_OUTPUT_STREAM_SIZE)); + private long bulkSize = Long.parseLong(PersoniumUnitConfig + .get(PersoniumUnitConfig.BAR.BAR_USERDATA_BULK_SIZE)); private Event event; - private DcEventBus eventBus; + private PersoniumEventBus eventBus; private BarInstallProgressInfo progressInfo; /** @@ -208,7 +208,7 @@ public BarFileReadRunner( Cell cell, String boxName, ODataEntityResource odataEntityResource, - DcODataProducer producer, + PersoniumODataProducer producer, String entitySetName, UriInfo uriInfo, String requestKey) { @@ -241,11 +241,11 @@ public void run() { try { this.zipArchiveInputStream = new ZipArchiveInputStream(new FileInputStream(barFile)); } catch (IOException e) { - throw DcCoreException.Server.FILE_SYSTEM_ERROR.params(e.getMessage()); + throw PersoniumCoreException.Server.FILE_SYSTEM_ERROR.params(e.getMessage()); } // ルートディレクトリ("bar/")の存在チェック if (!isRootDir()) { - String message = DcCoreMessageUtils.getMessage("PL-BI-2001"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2001"); writeOutputStream(true, "PL-BI-1004", ROOT_DIR, message); isSuccess = false; return; @@ -253,7 +253,7 @@ public void run() { // 00_metaの存在チェック if (!isMetadataDir()) { - String message = DcCoreMessageUtils.getMessage("PL-BI-2001"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2001"); writeOutputStream(true, "PL-BI-1004", META_DIR, message); isSuccess = false; return; @@ -308,7 +308,7 @@ public void run() { for (String filename : filenameList) { Boolean isNecessary = barFileOrder.get(filename); if (isNecessary && !doneKeys.contains(filename)) { - String message = DcCoreMessageUtils.getMessage("PL-BI-2001"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2001"); writeOutputStream(true, "PL-BI-1004", filename, message); isSuccess = false; } @@ -324,7 +324,7 @@ public void run() { writeOutputStream(false, CODE_BAR_INSTALL_COMPLETED, this.cell.getUrl() + boxName, ""); this.progressInfo.setStatus(ProgressInfo.STATUS.COMPLETED); } else { - String message = DcCoreMessageUtils.getMessage("PL-BI-2001"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2001"); writeOutputStream(false, CODE_BAR_INSTALL_FAILED, this.cell.getUrl() + boxName, message); this.progressInfo.setStatus(ProgressInfo.STATUS.FAILED); } @@ -341,7 +341,7 @@ public void run() { * barインストール処理状況の内部イベント出力用の設定を行う. */ private void setEventBus() { - eventBus = new DcEventBus(this.cell); + eventBus = new PersoniumEventBus(this.cell); JSONEvent reqBody = new JSONEvent(); reqBody.setAction(WebDAVMethod.MKCOL.toString()); reqBody.setLevel(LEVEL.INFO); @@ -418,17 +418,17 @@ private boolean isMatchEntryName(String name) { /** * プロパティファイルからBARファイル内の最大ファイルサイズ(MB)を取得する。 - * @return com.fujitsu.dc.core.bar.entry.maxSize + * @return io.personium.core.bar.entry.maxSize */ private long getMaxBarEntryFileSize() { long maxBarFileSize; try { - maxBarFileSize = Long.parseLong(DcCoreConfig - .get(DcCoreConfig.BAR.BAR_ENTRY_MAX_SIZE)); + maxBarFileSize = Long.parseLong(PersoniumUnitConfig + .get(PersoniumUnitConfig.BAR.BAR_ENTRY_MAX_SIZE)); } catch (NumberFormatException ne) { - log.info("NumberFormatException" + DcCoreConfig - .get(DcCoreConfig.BAR.BAR_ENTRY_MAX_SIZE)); - throw DcCoreException.Server.UNKNOWN_ERROR; + log.info("NumberFormatException" + PersoniumUnitConfig + .get(PersoniumUnitConfig.BAR.BAR_ENTRY_MAX_SIZE)); + throw PersoniumCoreException.Server.UNKNOWN_ERROR; } return maxBarFileSize; } @@ -500,7 +500,7 @@ protected boolean createContents() { List userDataLinks = new ArrayList(); LinkedHashMap bulkRequests = new LinkedHashMap(); Map fileNameMap = new HashMap(); - DcODataProducer producer = null; + PersoniumODataProducer producer = null; while ((zae = this.zipArchiveInputStream.getNextZipEntry()) != null) { String entryName = zae.getName(); @@ -576,7 +576,7 @@ protected boolean createContents() { continue; } else if (!entryName.endsWith("/")) { // xml,jsonファイル以外のファイルがあった場合はエラーを返却する - String message = DcCoreMessageUtils.getMessage("PL-BI-2001"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2001"); log.info(message + " [" + entryName + "]"); writeOutputStream(true, "PL-BI-1004", entryName, message); return false; @@ -601,7 +601,7 @@ protected boolean createContents() { case TYPE_MISMATCH: // ODataコレクション配下ではなく、かつ、rootpropsに定義されていないエントリ - String message = DcCoreMessageUtils.getMessage("PL-BI-2006"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2006"); log.info(message + " [" + entryName + "]"); writeOutputStream(true, "PL-BI-1004", entryName, message); return false; @@ -626,7 +626,7 @@ protected boolean createContents() { } catch (IOException ex) { isSuccess = false; log.info("IOException: " + ex.getMessage(), ex.fillInStackTrace()); - String message = DcCoreMessageUtils.getMessage("PL-BI-2000"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2000"); writeOutputStream(true, CODE_BAR_INSTALL_FAILED, "", message); } @@ -640,7 +640,7 @@ private boolean checkNecessaryFile(boolean isSuccess, Map odataC for (String colName : colList) { String filename = colName + METADATA_XML; if (!doneKeys.contains(filename)) { - String message = DcCoreMessageUtils.getMessage("PL-BI-2001"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2001"); writeOutputStream(true, "PL-BI-1004", filename, message); isSuccess = false; } @@ -664,16 +664,16 @@ private boolean installSvcCollection(Map webdavCols, String entr } private boolean setBulkRequests(String entryName, - DcODataProducer producer, + PersoniumODataProducer producer, LinkedHashMap bulkRequests, Map fileNameMap) { BulkRequest bulkRequest = new BulkRequest(); - String key = DcUUID.randomUUID(); + String key = PersoniumUUID.randomUUID(); try { // entityType名を取得する String entityTypeName = getEntityTypeName(entryName); if (producer.getMetadata().findEdmEntitySet(entityTypeName) == null) { - throw DcCoreException.OData.NO_SUCH_ENTITY_SET; + throw PersoniumCoreException.OData.NO_SUCH_ENTITY_SET; } // ZipArchiveImputStreamからユーザデータのJSONをStringReader形式で取得する @@ -697,12 +697,12 @@ private boolean setBulkRequests(String entryName, key = oEntity.getEntitySetName() + ":" + (String) docHandler.getStaticFields().get("__id"); if (bulkRequests.containsKey(key)) { - throw DcCoreException.OData.ENTITY_ALREADY_EXISTS; + throw PersoniumCoreException.OData.ENTITY_ALREADY_EXISTS; } // ID指定がない場合はUUIDを払い出す if (docHandler.getId() == null) { - docHandler.setId(DcUUID.randomUUID()); + docHandler.setId(PersoniumUUID.randomUUID()); } bulkRequest.setEntitySetName(entityTypeName); bulkRequest.setDocHandler(docHandler); @@ -738,7 +738,7 @@ private String getEntityTypeName(String entryName) { private boolean execBulkRequest(String cellId, LinkedHashMap bulkRequests, Map fileNameMap, - DcODataProducer producer) { + PersoniumODataProducer producer) { // バルクで一括登録を実行 producer.bulkCreateEntity(producer.getMetadata(), bulkRequests, cellId); @@ -746,13 +746,13 @@ private boolean execBulkRequest(String cellId, LinkedHashMap request : bulkRequests.entrySet()) { // エラーが発生していた場合はエラーのレスポンスを返却する if (request.getValue().getError() != null) { - if (request.getValue().getError() instanceof DcCoreException) { - DcCoreException e = ((DcCoreException) request.getValue().getError()); + if (request.getValue().getError() instanceof PersoniumCoreException) { + PersoniumCoreException e = ((PersoniumCoreException) request.getValue().getError()); writeOutputStream(true, "PL-BI-1004", fileNameMap.get(request.getKey()), e.getMessage()); - log.info("DcCoreException: " + e.getMessage()); + log.info("PersoniumCoreException: " + e.getMessage()); } else { Exception e = request.getValue().getError(); - String message = DcCoreMessageUtils.getMessage("PL-BI-2003"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2003"); writeOutputStream(true, "PL-BI-1004", fileNameMap.get(request.getKey()), message); log.info("Regist Entity Error: " + e.toString()); log.info("Regist Entity Error: " + e.getClass().getName()); @@ -828,10 +828,10 @@ protected boolean registWebDavFile(String entryName, InputStream inputStream, DavCmp parentCmp = webdavCols.get(colPath); // 親コレクション内のコレクション・ファイル数のチェック - int maxChildResource = DcCoreConfig.getMaxChildResourceCount(); + int maxChildResource = PersoniumUnitConfig.getMaxChildResourceCount(); if (parentCmp.getChildrenCount() >= maxChildResource) { // コレクション内に作成可能なコレクション・ファイル数の制限を超えたため、エラーとする - String message = DcCoreMessageUtils.getMessage("PR400-DV-0007"); + String message = PersoniumCoreMessageUtils.getMessage("PR400-DV-0007"); log.info(message); writeOutputStream(true, "PL-BI-1004", entryName, message); return false; @@ -852,7 +852,7 @@ protected boolean registWebDavFile(String entryName, InputStream inputStream, contentType = this.davFileMap.get(entryName); RuntimeDelegate.getInstance().createHeaderDelegate(MediaType.class).fromString(contentType); } catch (Exception e) { - String message = DcCoreMessageUtils.getMessage("PL-BI-2005"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2005"); log.info(message + ": " + e.getMessage(), e.fillInStackTrace()); writeOutputStream(true, "PL-BI-1004", entryName, message); return false; @@ -862,7 +862,7 @@ protected boolean registWebDavFile(String entryName, InputStream inputStream, try { fileCmp.putForCreate(contentType, new CloseShieldInputStream(inputStream)); } catch (Exception e) { - String message = DcCoreMessageUtils.getMessage("PL-BI-2004"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2004"); log.info(message + ": " + e.getMessage(), e.fillInStackTrace()); writeOutputStream(true, "PL-BI-1004", entryName, message); return false; @@ -938,9 +938,9 @@ protected boolean registXmlEntry(String rootPropsName, InputStream inputStream, List elements = resourceType.getAny(); for (Element element : elements) { String nodeName = element.getNodeName(); - if (nodeName.equals("dc:odata")) { + if (nodeName.equals("p:odata")) { collectionType = TYPE_ODATA_COLLECTION; - } else if (nodeName.equals("dc:service")) { + } else if (nodeName.equals("p:service")) { collectionType = TYPE_SERVICE_COLLECTION; } } @@ -961,7 +961,7 @@ protected boolean registXmlEntry(String rootPropsName, InputStream inputStream, } if (nodeName.equals("acl")) { if (!BarFileUtils.aclNameSpaceValidate(rootPropsName, element, this.schemaUrl)) { - String message = DcCoreMessageUtils.getMessage("PL-BI-2007"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2007"); log.info(message + " [" + rootPropsName + "]"); writeOutputStream(true, "PL-BI-1004", rootPropsName, message); return false; @@ -990,8 +990,8 @@ protected boolean registXmlEntry(String rootPropsName, InputStream inputStream, this.davFileMap.put(entryName, contentType); } } - } catch (DcCoreException e) { - log.info("DcCoreException: " + e.getMessage()); + } catch (PersoniumCoreException e) { + log.info("PersoniumCoreException: " + e.getMessage()); writeOutputStream(true, "PL-BI-1004", rootPropsName, e.getMessage()); return false; } catch (Exception ex) { @@ -1016,20 +1016,20 @@ protected boolean validateCollectionDefinitions(Multistatus multiStatus, String for (Response response : multiStatus.getResponse()) { List hrefs = response.getHref(); if (hrefs.size() != 1) { - String message = DcCoreMessageUtils.getMessage("PL-BI-2008"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2008"); writeOutputStream(true, "PL-BI-1004", rootPropsName, message); return false; } String href = hrefs.get(0); // href属性値がない場合は定義エラーとみなす。 if (href == null || href.length() == 0) { - String message = DcCoreMessageUtils.getMessage("PL-BI-2009"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2009"); writeOutputStream(true, "PL-BI-1004", rootPropsName, message); return false; } // href属性値として"dcbox:/" で始まらない場合は定義エラーとみなす。 if (!href.startsWith(DCBOX_NO_SLUSH)) { - String message = MessageFormat.format(DcCoreMessageUtils.getMessage("PL-BI-2010"), href); + String message = MessageFormat.format(PersoniumCoreMessageUtils.getMessage("PL-BI-2010"), href); writeOutputStream(true, "PL-BI-1004", rootPropsName, message); return false; } @@ -1051,7 +1051,7 @@ protected boolean validateCollectionDefinitions(Multistatus multiStatus, String // パス定義が重複している場合は同じデータが登録されてしまうため定義エラーとする。 // パス末尾の"/"指定有無の条件を無視するため、このタイミングでチェックする。 if (pathMap.containsKey(href)) { - String message = MessageFormat.format(DcCoreMessageUtils.getMessage("PL-BI-2011"), href); + String message = MessageFormat.format(PersoniumCoreMessageUtils.getMessage("PL-BI-2011"), href); writeOutputStream(true, "PL-BI-1004", rootPropsName, message); return false; } @@ -1074,7 +1074,7 @@ protected boolean validateCollectionDefinitions(Multistatus multiStatus, String // Boxルートパスが定義されていない場合も同様に定義エラーとする。 String upper = href.substring(0, upperPathposition); if (!keySet.contains(upper)) { - String message = MessageFormat.format(DcCoreMessageUtils.getMessage("PL-BI-2012"), upper); + String message = MessageFormat.format(PersoniumCoreMessageUtils.getMessage("PL-BI-2012"), upper); writeOutputStream(true, "PL-BI-1004", rootPropsName, message); return false; } @@ -1082,20 +1082,20 @@ protected boolean validateCollectionDefinitions(Multistatus multiStatus, String String resourceName = href.substring(upperPathposition + 1, href.length()); if (upperCollectionType == TYPE_ODATA_COLLECTION) { // ODataコレクション:コレクション配下にコレクション/ファイルが定義されていた場合は定義エラーとする。 - String message = MessageFormat.format(DcCoreMessageUtils.getMessage("PL-BI-2013"), href); + String message = MessageFormat.format(PersoniumCoreMessageUtils.getMessage("PL-BI-2013"), href); writeOutputStream(true, "PL-BI-1004", rootPropsName, message); return false; } else if (upperCollectionType == TYPE_SERVICE_COLLECTION) { // Serviceコレクション:コレクション配下にコレクション/ファイルが定義されていた場合は定義エラーとする。 // ただし、"__src"のみは例外として除外する。 if (!("__src".equals(resourceName) && currentCollectionType == TYPE_WEBDAV_COLLECTION)) { - String message = MessageFormat.format(DcCoreMessageUtils.getMessage("PL-BI-2014"), href); + String message = MessageFormat.format(PersoniumCoreMessageUtils.getMessage("PL-BI-2014"), href); writeOutputStream(true, "PL-BI-1004", rootPropsName, message); return false; } } else if (upperCollectionType == TYPE_DAV_FILE) { // WebDAVファイル/Serviceソース配下にコレクション/ファイルが定義されていた場合は定義エラーとする。 - String message = MessageFormat.format(DcCoreMessageUtils.getMessage("PL-BI-2015"), href); + String message = MessageFormat.format(PersoniumCoreMessageUtils.getMessage("PL-BI-2015"), href); writeOutputStream(true, "PL-BI-1004", rootPropsName, message); return false; } @@ -1103,7 +1103,7 @@ protected boolean validateCollectionDefinitions(Multistatus multiStatus, String if (currentCollectionType == TYPE_SERVICE_COLLECTION) { String srcPath = href + "/__src"; if (!keySet.contains(srcPath) || pathMap.get(srcPath) != TYPE_WEBDAV_COLLECTION) { - String message = MessageFormat.format(DcCoreMessageUtils.getMessage("PL-BI-2016"), href); + String message = MessageFormat.format(PersoniumCoreMessageUtils.getMessage("PL-BI-2016"), href); writeOutputStream(true, "PL-BI-1004", rootPropsName, message); return false; } @@ -1111,7 +1111,7 @@ protected boolean validateCollectionDefinitions(Multistatus multiStatus, String // リソース名として正しいことを確認する(コレクション/ファイルの名前フォーマットは共通)。 if (!DavCommon.isValidResourceName(resourceName)) { - String message = MessageFormat.format(DcCoreMessageUtils.getMessage("PL-BI-2017"), resourceName); + String message = MessageFormat.format(PersoniumCoreMessageUtils.getMessage("PL-BI-2017"), resourceName); writeOutputStream(true, "PL-BI-1004", rootPropsName, message); return false; } @@ -1130,7 +1130,7 @@ protected boolean validateCollectionDefinitions(Multistatus multiStatus, String private int getCollectionType(String rootPropsName, Response response) { // 要素の配下を辿って定義されているコレクションのタイプを取得する // -prop/resourcetype/collecton のDOMノードパスが存在する場合はコレクション定義とみなす - // この際、"dc:odata" または "dc:service" のDOMノードパスが存在しない場合はWebDAVコレクション定義とみなす + // この際、"p:odata" または "p:service" のDOMノードパスが存在しない場合はWebDAVコレクション定義とみなす // - 上記に当てはまらない場合はWebDAvファイルまたはサービスソースとみなす for (Propstat propstat : response.getPropstat()) { Prop prop = propstat.getProp(); @@ -1139,12 +1139,12 @@ private int getCollectionType(String rootPropsName, Response response) { List elements = resourceType.getAny(); for (Element element : elements) { String nodeName = element.getNodeName(); - if (nodeName.equals("dc:odata")) { + if (nodeName.equals("p:odata")) { return TYPE_ODATA_COLLECTION; - } else if (nodeName.equals("dc:service")) { + } else if (nodeName.equals("p:service")) { return TYPE_SERVICE_COLLECTION; } else { - String message = MessageFormat.format(DcCoreMessageUtils.getMessage("PL-BI-2018"), nodeName); + String message = MessageFormat.format(PersoniumCoreMessageUtils.getMessage("PL-BI-2018"), nodeName); writeOutputStream(true, "PL-BI-1004", rootPropsName, message); return TYPE_MISMATCH; } @@ -1182,27 +1182,27 @@ private boolean registJsonEntry(String entryName, InputStream inputStream) { } log.debug(jsonName); } else { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); } - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { // JSONファイルのバリデートエラー writeOutputStream(true, "PL-BI-1004", entryName, e.getMessage()); - log.info("DcCoreException" + e.getMessage(), e.fillInStackTrace()); + log.info("PersoniumCoreException" + e.getMessage(), e.fillInStackTrace()); return false; } catch (JsonParseException e) { // JSONファイルの解析エラー - String message = DcCoreMessageUtils.getMessage("PL-BI-2002"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2002"); writeOutputStream(true, "PL-BI-1004", entryName, message); log.info("JsonParseException: " + e.getMessage(), e.fillInStackTrace()); return false; } catch (JsonMappingException e) { // JSONファイルのデータ定義エラー - String message = DcCoreMessageUtils.getMessage("PL-BI-2003"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2003"); writeOutputStream(true, "PL-BI-1004", entryName, message); log.info("JsonMappingException: " + e.getMessage(), e.fillInStackTrace()); return false; } catch (Exception e) { - String message = DcCoreMessageUtils.getMessage("PL-BI-2000"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2000"); writeOutputStream(true, "PL-BI-1004", entryName, message); log.info("Exception: " + e.getMessage(), e.fillInStackTrace()); return false; @@ -1234,7 +1234,7 @@ protected List registJsonLinksUserdata(String entryName, Input token = jp.nextToken(); // 配列でなければエラー if (token != JsonToken.START_ARRAY) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(USERDATA_LINKS_JSON); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(USERDATA_LINKS_JSON); } token = jp.nextToken(); @@ -1242,34 +1242,34 @@ protected List registJsonLinksUserdata(String entryName, Input if (token == JsonToken.END_ARRAY) { break; } else if (token != JsonToken.START_OBJECT) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(USERDATA_LINKS_JSON); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(USERDATA_LINKS_JSON); } userDataLinks.add(barFileJsonValidate(jp, mapper, USERDATA_LINKS_JSON)); token = jp.nextToken(); } } else { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(USERDATA_LINKS_JSON); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(USERDATA_LINKS_JSON); } } catch (JsonParseException e) { // JSONファイルの解析エラー - String message = DcCoreMessageUtils.getMessage("PL-BI-2002"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2002"); writeOutputStream(true, "PL-BI-1004", entryName, message); log.info("JsonParseException: " + e.getMessage(), e.fillInStackTrace()); return null; } catch (JsonMappingException e) { // JSONファイルのデータ定義エラー - String message = DcCoreMessageUtils.getMessage("PL-BI-2003"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2003"); writeOutputStream(true, "PL-BI-1004", entryName, message); log.info("JsonMappingException: " + e.getMessage(), e.fillInStackTrace()); return null; - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { // JSONファイルのバリデートエラー writeOutputStream(true, "PL-BI-1004", entryName, e.getMessage()); - log.info("DcCoreException" + e.getMessage(), e.fillInStackTrace()); + log.info("PersoniumCoreException" + e.getMessage(), e.fillInStackTrace()); return null; } catch (IOException e) { - String message = DcCoreMessageUtils.getMessage("PL-BI-2000"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2000"); writeOutputStream(true, "PL-BI-1004", entryName, message); log.info("IOException: " + e.getMessage(), e.fillInStackTrace()); return null; @@ -1294,7 +1294,7 @@ private boolean isValidFileStructure(ZipArchiveEntry zae, // 不正なファイルでないかをチェック if (!barFileOrder.containsKey(entryName)) { log.info("[" + entryName + "] invalid file"); - String message = DcCoreMessageUtils.getMessage("PL-BI-2001"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2001"); writeOutputStream(true, "PL-BI-1004", entryName, message); return false; } @@ -1307,7 +1307,7 @@ private boolean isValidFileStructure(ZipArchiveEntry zae, // 最初のエントリの場合は"00"であることが必須 if (!entryIndex.equals("00")) { log.info("bar/00_meta/00_manifest.json is not exsist"); - String message = DcCoreMessageUtils.getMessage("PL-BI-2001"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2001"); writeOutputStream(true, "PL-BI-1004", entryName, message); return false; } @@ -1319,7 +1319,7 @@ private boolean isValidFileStructure(ZipArchiveEntry zae, // 前回処理したエントリのプレフィックスと比較 if (entryIndex.compareTo(lastEntryIndex) < 0) { log.info("[" + entryName + "] invalid file"); - String message = DcCoreMessageUtils.getMessage("PL-BI-2001"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2001"); writeOutputStream(true, "PL-BI-1004", entryName, message); return false; } @@ -1328,7 +1328,7 @@ private boolean isValidFileStructure(ZipArchiveEntry zae, // [400]barファイル/barファイル内エントリのファイルサイズが上限値を超えている if (zae.getSize() > (long) (maxSize * MB)) { log.info("Bar file entry size too large invalid file [" + entryName + "]"); - String message = DcCoreException.BarInstall.BAR_FILE_ENTRY_SIZE_TOO_LARGE + String message = PersoniumCoreException.BarInstall.BAR_FILE_ENTRY_SIZE_TOO_LARGE .params(zae.getName(), String.valueOf(zae.getSize())).getMessage(); writeOutputStream(true, "PL-BI-1004", entryName, message); return false; @@ -1362,7 +1362,7 @@ protected boolean isValidODataContents(String entryName, Map col // 00_$metadata.xmlの処理が済んでいるかのチェック String meatadataPath = odataColPath + METADATA_XML; if (!doneKeys.contains(meatadataPath)) { - String message = DcCoreMessageUtils.getMessage("PL-BI-2001"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2001"); log.info(message + "entryName: " + entryName); writeOutputStream(true, "PL-BI-1004", entryName, message); return false; @@ -1370,7 +1370,7 @@ protected boolean isValidODataContents(String entryName, Map col // 90_data/の処理が済んでいないかのチェック String userDataPath = odataColPath + USERDATA_DIR_NAME + "/"; if (doneKeys.contains(userDataPath)) { - String message = DcCoreMessageUtils.getMessage("PL-BI-2001"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2001"); log.info(message + "entryName: " + entryName); writeOutputStream(true, "PL-BI-1004", entryName, message); return false; @@ -1380,7 +1380,7 @@ protected boolean isValidODataContents(String entryName, Map col // 00_$metadata.xmlの処理が済んでいるかのチェック String meatadataPath = odataColPath + METADATA_XML; if (!doneKeys.contains(meatadataPath)) { - String message = DcCoreMessageUtils.getMessage("PL-BI-2001"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2001"); log.info(message + "entryName: " + entryName); writeOutputStream(true, "PL-BI-1004", entryName, message); return false; @@ -1396,7 +1396,7 @@ protected boolean isValidODataContents(String entryName, Map col } if (dirPath != null && !dirPath.equals(USERDATA_DIR_NAME)) { // bar/90_contents/{OData_collection}/{dir}/の場合はエラーとする - String message = DcCoreMessageUtils.getMessage("PL-BI-2001"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2001"); log.info(message + "entryName: " + entryName); writeOutputStream(true, "PL-BI-1004", entryName, message); return false; @@ -1414,7 +1414,7 @@ protected boolean isValidODataContents(String entryName, Map col m = pattern.matcher(fileName); if (!m.matches()) { // bar/90_contents/{OData_collection}/{dir}/の場合はエラーとする - String message = DcCoreMessageUtils.getMessage("PL-BI-2001"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2001"); log.info(message + "entryName: " + entryName); writeOutputStream(true, "PL-BI-1004", entryName, message); return false; @@ -1441,7 +1441,7 @@ protected void registJsonEntityData(JsonParser jp, ObjectMapper mapper, String j token = jp.nextToken(); // 配列でなければエラー if (token != JsonToken.START_ARRAY) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); } token = jp.nextToken(); @@ -1449,7 +1449,7 @@ protected void registJsonEntityData(JsonParser jp, ObjectMapper mapper, String j if (token == JsonToken.END_ARRAY) { break; } else if (token != JsonToken.START_OBJECT) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); } // 1件登録処理 @@ -1481,22 +1481,22 @@ protected JSONMappedObject barFileJsonValidate( if (jsonName.equals(EXTROLE_JSON)) { JSONExtRoles extRoles = mapper.readValue(jp, JSONExtRoles.class); if (extRoles.getExtRole() == null) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); } if (extRoles.getRelationName() == null) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); } return extRoles; } else if (jsonName.equals(ROLE_JSON)) { JSONRoles roles = mapper.readValue(jp, JSONRoles.class); if (roles.getName() == null) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); } return roles; } else if (jsonName.equals(RELATION_JSON)) { JSONRelations relations = mapper.readValue(jp, JSONRelations.class); if (relations.getName() == null) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); } return relations; } else if (jsonName.equals(LINKS_JSON)) { @@ -1518,39 +1518,39 @@ protected JSONMappedObject barFileJsonValidate( */ private void linksJsonValidate(String jsonName, JSONLinks links) { if (links.getFromType() == null) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); } else { if (!links.getFromType().equals(Relation.EDM_TYPE_NAME) && !links.getFromType().equals(Role.EDM_TYPE_NAME) && !links.getFromType().equals(ExtRole.EDM_TYPE_NAME)) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); } } if (links.getFromName() == null) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); } else { Map fromNameMap = links.getFromName(); for (Map.Entry entry : fromNameMap.entrySet()) { if (entry.getValue() == null) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); } } } if (links.getToType() == null) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); } else { if (!links.getToType().equals(Relation.EDM_TYPE_NAME) && !links.getToType().equals(Role.EDM_TYPE_NAME) && !links.getToType().equals(ExtRole.EDM_TYPE_NAME)) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); } } if (links.getToName() == null) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); } else { Map toNameMap = links.getToName(); for (Map.Entry entry : toNameMap.entrySet()) { if (entry.getValue() == null) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); } } } @@ -1563,28 +1563,28 @@ private void linksJsonValidate(String jsonName, JSONLinks links) { */ private void userDataLinksJsonValidate(String jsonName, JSONUserDataLinks links) { if (links.getFromType() == null) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); } if (links.getFromId() == null) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); } else { Map fromIdMap = links.getFromId(); for (Map.Entry entry : fromIdMap.entrySet()) { if (entry.getValue() == null) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); } } } if (links.getToType() == null) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); } if (links.getToId() == null) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); } else { Map toIdMap = links.getToId(); for (Map.Entry entry : toIdMap.entrySet()) { if (entry.getValue() == null) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); } } } @@ -1603,16 +1603,16 @@ protected JSONManifest manifestJsonValidate(JsonParser jp, ObjectMapper mapper) try { manifest = mapper.readValue(jp, JSONManifest.class); } catch (UnrecognizedPropertyException ex) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params("manifest.json unrecognized property"); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params("manifest.json unrecognized property"); } if (manifest.getBarVersion() == null) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params("manifest.json#barVersion"); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params("manifest.json#barVersion"); } if (manifest.getBoxVersion() == null) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params("manifest.json#boxVersion"); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params("manifest.json#boxVersion"); } if (manifest.getDefaultPath() == null) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params("manifest.json#DefaultPath"); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params("manifest.json#DefaultPath"); } return manifest; } @@ -1631,7 +1631,7 @@ private void checkMatchFieldName(JsonParser jp, String jsonName) throws IOExcept && !(fieldName.equals("ExtRoles") && jsonName.equals(EXTROLE_JSON)) && !(fieldName.equals("Links") && jsonName.equals(LINKS_JSON)) && !(fieldName.equals("Links") && jsonName.equals(USERDATA_LINKS_JSON))) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); } } @@ -1639,7 +1639,7 @@ private void checkMatchFieldName(JsonParser jp, String jsonName) throws IOExcept * Httpレスポンス用メッセージの出力. * @param isError エラー時の場合はtrueを、それ以外はfalseを指定する. * @param code - * メッセージコード(dc-messages.propertiesに定義されたメッセージコード) + * メッセージコード(personium-messages.propertiesに定義されたメッセージコード) * @param path * 処理対象リソースパス(ex. /bar/meta/roles.json) */ @@ -1651,14 +1651,14 @@ private void writeOutputStream(boolean isError, String code, String path) { * barファイルインストールログ詳細の出力. * @param isError エラー時の場合はtrueを、それ以外はfalseを指定する. * @param code - * メッセージコード(dc-messages.propertiesに定義されたメッセージコード) + * メッセージコード(personium-messages.propertiesに定義されたメッセージコード) * @param path * 処理対象リソースパス(ex. /bar/meta/roles.json) * @param detail * 処理失敗時の詳細情報(PL-BI-2xxx) */ private void writeOutputStream(boolean isError, String code, String path, String detail) { - String message = DcCoreMessageUtils.getMessage(code); + String message = PersoniumCoreMessageUtils.getMessage(code); if (detail == null) { message = message.replace("{0}", ""); } else { @@ -1836,7 +1836,7 @@ private void createExtRole(JSONObject json) { * 70_$links.jsonに定義されているリンク情報をESへ登録する. * @param mappedObject JSONファイルから読み込んだオブジェクト */ - private void createLinks(JSONMappedObject mappedObject, DcODataProducer producer) { + private void createLinks(JSONMappedObject mappedObject, PersoniumODataProducer producer) { Map fromNameMap = ((JSONLinks) mappedObject).getFromName(); String fromkey = BarFileUtils.getComplexKeyName(((JSONLinks) mappedObject).getFromType(), fromNameMap, this.boxName); @@ -1856,10 +1856,10 @@ private void createLinks(JSONMappedObject mappedObject, DcODataProducer producer producer.createLink(sourceEntity, targetNavProp, newTargetEntity); } - private boolean createUserdataLinks(DcODataProducer producer, List userDataLinks) { + private boolean createUserdataLinks(PersoniumODataProducer producer, List userDataLinks) { int linkSize = userDataLinks.size(); int linkCount = 0; - String message = DcCoreMessageUtils.getMessage("PL-BI-1002"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-1002"); for (JSONMappedObject json : userDataLinks) { linkCount++; if (!createUserdataLink(json, producer)) { @@ -1879,7 +1879,7 @@ private boolean createUserdataLinks(DcODataProducer producer, List maxDepth) { // // コレクション数の制限を超えたため、400エラーとする -// throw DcCoreException.Dav.COLLECTION_DEPTH_ERROR; +// throw PersoniumCoreException.Dav.COLLECTION_DEPTH_ERROR; // } // // // 親コレクション内のコレクション・ファイル数のチェック -// int maxChildResource = DcCoreConfig.getMaxChildResourceCount(); +// int maxChildResource = PersoniumCoreConfig.getMaxChildResourceCount(); // if (parentCmp.getChildrenCount() >= maxChildResource) { // // コレクション内に作成可能なコレクション・ファイル数の制限を超えたため、400エラーとする -// throw DcCoreException.Dav.COLLECTION_CHILDRESOURCE_ERROR; +// throw PersoniumCoreException.Dav.COLLECTION_CHILDRESOURCE_ERROR; // } @@ -2015,7 +2015,7 @@ private void createCollection(String collectionUrl, BarFileUtils.convertToRoleInstanceUrl(aclElement, baseUrl, this.cell.getName(), this.boxName); StringBuffer sbAclXml = new StringBuffer(); sbAclXml.append(""); - sbAclXml.append(DcCoreUtils.nodeToString(convElement)); + sbAclXml.append(PersoniumCoreUtils.nodeToString(convElement)); Reader aclXml = new StringReader(sbAclXml.toString()); collectionCmp.acl(aclXml); } @@ -2044,7 +2044,7 @@ private void registBoxAclAndProppatch(Box targetBox, Element aclElement, BarFileUtils.convertToRoleInstanceUrl(aclElement, baseUrl, this.cell.getName(), this.boxName); StringBuffer sbAclXml = new StringBuffer(); sbAclXml.append(""); - sbAclXml.append(DcCoreUtils.nodeToString(convElement)); + sbAclXml.append(PersoniumCoreUtils.nodeToString(convElement)); Reader aclXml = new StringReader(sbAclXml.toString()); boxCmp.acl(aclXml); } @@ -2060,7 +2060,7 @@ private void registProppatch(DavCmp davCmp, List propElements, String b Propertyupdate propUpdate = Propertyupdate.unmarshal(propXml); davCmp.proppatch(propUpdate, boxUrl); } catch (IOException ex) { - throw DcCoreException.Dav.XML_ERROR.reason(ex); + throw PersoniumCoreException.Dav.XML_ERROR.reason(ex); } } } @@ -2113,35 +2113,35 @@ protected boolean registUserSchema(String entryName, InputStream inputStream, Da XMLFactoryProvider2 provider = StaxXMLFactoryProvider2.getInstance(); XMLInputFactory2 factory = provider.newXMLInputFactory2(); XMLEventReader2 reader = factory.createXMLEventReader(isr); - DcEdmxFormatParser parser = new DcEdmxFormatParser(); + PersoniumEdmxFormatParser parser = new PersoniumEdmxFormatParser(); metadata = parser.parseMetadata(reader); } catch (Exception ex) { log.info("XMLParseException: " + ex.getMessage(), ex.fillInStackTrace()); - String message = DcCoreMessageUtils.getMessage("PL-BI-2002"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2002"); writeOutputStream(true, "PL-BI-1004", entryName, message); return false; } catch (StackOverflowError tw) { // ComplexTypeの循環参照時にStackOverFlowErrorが発生する log.info("XMLParseException: " + tw.getMessage(), tw.fillInStackTrace()); - String message = DcCoreMessageUtils.getMessage("PL-BI-2002"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2002"); writeOutputStream(true, "PL-BI-1004", entryName, message); return false; } // Entity/Propertyの登録 // Property/ComplexPropertyはデータ型としてComplexTypeを使用する場合があるため、 // 一番最初にComplexTypeを登録してから、EntityTypeを登録する - // DcODataProducer producer = davCmp.getODataProducer(); + // PersoniumODataProducer producer = davCmp.getODataProducer(); try { createComplexTypes(metadata, davCmp); createEntityTypes(metadata, davCmp); createAssociations(metadata, davCmp); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { writeOutputStream(true, "PL-BI-1004", entryName, e.getMessage()); - log.info("DcCoreException: " + e.getMessage()); + log.info("PersoniumCoreException: " + e.getMessage()); return false; } catch (Exception e) { log.info("Regist Entity Error: " + e.getMessage(), e.fillInStackTrace()); - String message = DcCoreMessageUtils.getMessage("PL-BI-2003"); + String message = PersoniumCoreMessageUtils.getMessage("PL-BI-2003"); writeOutputStream(true, "PL-BI-1004", entryName, message); return false; } @@ -2193,7 +2193,7 @@ protected void createEntityTypes(EdmDataServices metadata, DavCmp davCmp) { * @param producer ODataプロデューサー */ @SuppressWarnings("unchecked") - protected void createProperties(EdmStructuralType entity, DavCmp davCmp, DcODataProducer producer) { + protected void createProperties(EdmStructuralType entity, DavCmp davCmp, PersoniumODataProducer producer) { Iterable properties = entity.getDeclaredProperties(); EdmDataServices userMetadata = null; String edmTypeName = Property.EDM_TYPE_NAME; @@ -2212,7 +2212,7 @@ protected void createProperties(EdmStructuralType entity, DavCmp davCmp, DcOData } CollectionKind kind = property.getCollectionKind(); if (kind != null && !kind.equals(CollectionKind.NONE) && !kind.equals(CollectionKind.List)) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(METADATA_XML); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(METADATA_XML); } JSONObject json = new JSONObject(); json.put("Name", property.getName()); @@ -2246,7 +2246,7 @@ protected void createProperties(EdmStructuralType entity, DavCmp davCmp, DcOData */ protected void createAssociations(EdmDataServices metadata, DavCmp davCmp) { Iterable associations = metadata.getAssociations(); - DcODataProducer producer = null; + PersoniumODataProducer producer = null; EdmDataServices userMetadata = null; for (EdmAssociation association : associations) { // Association情報をもとに、AssociationEndとAssociationEnd同士のリンクを登録する @@ -2291,23 +2291,23 @@ protected void createAssociations(EdmDataServices metadata, DavCmp davCmp) { private String getRealRoleName(String sourceRoleName) { String[] tokens = sourceRoleName.split(":"); if (tokens.length != 2) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(sourceRoleName); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(sourceRoleName); } if (tokens[0].length() <= 0 || tokens[1].length() <= 0) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(sourceRoleName); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(sourceRoleName); } return tokens[1]; } /** * 引数で渡されたAssociationEndを登録する. - * @param producer Entity登録用DcODataProcucerオブジェクト + * @param producer Entity登録用PersoniumODataProcucerオブジェクト * @param userMetadata ユーザ定義用スキーマオブジェクト * @param associationEnd 登録用AssociationEndオブジェクト * @param associationEndName AssociationEnd名 */ @SuppressWarnings("unchecked") - protected void createAssociationEnd(DcODataProducer producer, + protected void createAssociationEnd(PersoniumODataProducer producer, EdmDataServices userMetadata, EdmAssociationEnd associationEnd, String associationEndName) { // AssociationEndの名前は、AssociationEndのロール名を使用する JSONObject json = new JSONObject(); @@ -2330,7 +2330,7 @@ protected void createAssociationEnd(DcODataProducer producer, protected void createComplexTypes(EdmDataServices metadata, DavCmp davCmp) { // DeclaredPropertyはComplexTypeに紐付いているため、ComplexTypeごとにComplexTypePropertyを登録する Iterable complexTypes = metadata.getComplexTypes(); - DcODataProducer producer = null; + PersoniumODataProducer producer = null; EdmDataServices userMetadata = null; for (EdmComplexType complexType : complexTypes) { log.debug("ComplexType: " + complexType.getName()); @@ -2360,12 +2360,12 @@ protected void createComplexTypes(EdmDataServices metadata, DavCmp davCmp) { private Reader getProppatchXml(List propElements) { StringBuffer sbPropXml = new StringBuffer(); sbPropXml.append(""); sbPropXml.append(""); sbPropXml.append(""); for (Element element : propElements) { - sbPropXml.append(DcCoreUtils.nodeToString(element)); + sbPropXml.append(PersoniumCoreUtils.nodeToString(element)); } sbPropXml.append(""); sbPropXml.append(""); diff --git a/src/main/java/com/fujitsu/dc/core/bar/BarFileUtils.java b/src/main/java/io/personium/core/bar/BarFileUtils.java similarity index 88% rename from src/main/java/com/fujitsu/dc/core/bar/BarFileUtils.java rename to src/main/java/io/personium/core/bar/BarFileUtils.java index fb0e52da3..f0ec9c146 100644 --- a/src/main/java/com/fujitsu/dc/core/bar/BarFileUtils.java +++ b/src/main/java/io/personium/core/bar/BarFileUtils.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.bar; +package io.personium.core.bar; import java.io.IOException; import java.io.InputStream; @@ -31,12 +31,12 @@ import org.codehaus.jackson.map.exc.UnrecognizedPropertyException; import org.w3c.dom.Element; -import com.fujitsu.dc.common.es.util.IndexNameEncoder; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.model.ctl.ExtRole; -import com.fujitsu.dc.core.model.ctl.Relation; -import com.fujitsu.dc.core.model.ctl.Role; +import io.personium.common.es.util.IndexNameEncoder; +import io.personium.core.PersoniumCoreException; +import io.personium.core.auth.AccessContext; +import io.personium.core.model.ctl.ExtRole; +import io.personium.core.model.ctl.Relation; +import io.personium.core.model.ctl.Role; /** * Httpリクエストボディからbarファイルを読み込むためのクラス. @@ -100,7 +100,7 @@ public static String getLocalUrl(final String url, final String baseUrl, final S try { newUrl = newUrl + new URL(url).getPath(); } catch (MalformedURLException e) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(fileName); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(fileName); } return newUrl; } @@ -124,7 +124,7 @@ public static Element convertToRoleInstanceUrl( URL url = new URL(roleClassUrl); paths = url.getPath().split("/"); } catch (MalformedURLException e) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(BarFileReadRunner.ROOTPROPS_XML); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(BarFileReadRunner.ROOTPROPS_XML); } // ロールクラスURLからロールインスタンスURLへ変換して属性として設定 StringBuilder newBaseUrl = null; @@ -187,10 +187,10 @@ public static T readJsonEntry( try { json = mapper.readValue(jp, clazz); } catch (UnrecognizedPropertyException ex) { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); } } else { - throw DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); + throw PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.params(jsonName); } return json; } diff --git a/src/main/java/com/fujitsu/dc/core/bar/BarInstallProgressInfo.java b/src/main/java/io/personium/core/bar/BarInstallProgressInfo.java similarity index 95% rename from src/main/java/com/fujitsu/dc/core/bar/BarInstallProgressInfo.java rename to src/main/java/io/personium/core/bar/BarInstallProgressInfo.java index da59af587..fd385dcc4 100644 --- a/src/main/java/com/fujitsu/dc/core/bar/BarInstallProgressInfo.java +++ b/src/main/java/io/personium/core/bar/BarInstallProgressInfo.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.bar; +package io.personium.core.bar; import java.text.SimpleDateFormat; import java.util.Date; @@ -22,7 +22,7 @@ import org.json.simple.JSONObject; -import com.fujitsu.dc.core.model.progress.ProgressInfo; +import io.personium.core.model.progress.ProgressInfo; /** * barインストール用非同期処理状況オブジェクト. diff --git a/src/main/java/com/fujitsu/dc/core/bar/jackson/JSONExtRoles.java b/src/main/java/io/personium/core/bar/jackson/JSONExtRoles.java similarity index 94% rename from src/main/java/com/fujitsu/dc/core/bar/jackson/JSONExtRoles.java rename to src/main/java/io/personium/core/bar/jackson/JSONExtRoles.java index 314397d67..b685d4ecb 100644 --- a/src/main/java/com/fujitsu/dc/core/bar/jackson/JSONExtRoles.java +++ b/src/main/java/io/personium/core/bar/jackson/JSONExtRoles.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.bar.jackson; +package io.personium.core.bar.jackson; import org.codehaus.jackson.annotate.JsonProperty; import org.json.simple.JSONObject; diff --git a/src/main/java/com/fujitsu/dc/core/bar/jackson/JSONLinks.java b/src/main/java/io/personium/core/bar/jackson/JSONLinks.java similarity index 94% rename from src/main/java/com/fujitsu/dc/core/bar/jackson/JSONLinks.java rename to src/main/java/io/personium/core/bar/jackson/JSONLinks.java index d270bc87b..6f908c2b3 100644 --- a/src/main/java/com/fujitsu/dc/core/bar/jackson/JSONLinks.java +++ b/src/main/java/io/personium/core/bar/jackson/JSONLinks.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.bar.jackson; +package io.personium.core.bar.jackson; import java.util.Map; diff --git a/src/main/java/com/fujitsu/dc/core/bar/jackson/JSONManifest.java b/src/main/java/io/personium/core/bar/jackson/JSONManifest.java similarity index 90% rename from src/main/java/com/fujitsu/dc/core/bar/jackson/JSONManifest.java rename to src/main/java/io/personium/core/bar/jackson/JSONManifest.java index f2ff35612..b7c0c25f2 100644 --- a/src/main/java/com/fujitsu/dc/core/bar/jackson/JSONManifest.java +++ b/src/main/java/io/personium/core/bar/jackson/JSONManifest.java @@ -14,12 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.bar.jackson; +package io.personium.core.bar.jackson; import org.codehaus.jackson.annotate.JsonProperty; import org.json.simple.JSONObject; -import com.fujitsu.dc.core.utils.ODataUtils; +import io.personium.core.utils.ODataUtils; /** * barファイル内のmanifest.json読み込み用Mapping定義クラス. @@ -120,7 +120,7 @@ public void setSchema(String schema) { */ public boolean checkSchema() { // schemaの値がnull、またはURL形式でない場合はエラーを返却する。 - // TODO: box schemaの末尾/の必須を緩和することを見越してisValidSchemaUriを使わない + // box schemaの末尾/の必須を緩和することを見越してisValidSchemaUriを使わない if (this.getSchema() == null || !(ODataUtils.isValidUri(this.getSchema()))) { return false; diff --git a/src/main/java/com/fujitsu/dc/core/bar/jackson/JSONMappedObject.java b/src/main/java/io/personium/core/bar/jackson/JSONMappedObject.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/bar/jackson/JSONMappedObject.java rename to src/main/java/io/personium/core/bar/jackson/JSONMappedObject.java index 24da761f7..b25f320af 100644 --- a/src/main/java/com/fujitsu/dc/core/bar/jackson/JSONMappedObject.java +++ b/src/main/java/io/personium/core/bar/jackson/JSONMappedObject.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.bar.jackson; +package io.personium.core.bar.jackson; import org.json.simple.JSONObject; diff --git a/src/main/java/com/fujitsu/dc/core/bar/jackson/JSONRelations.java b/src/main/java/io/personium/core/bar/jackson/JSONRelations.java similarity index 93% rename from src/main/java/com/fujitsu/dc/core/bar/jackson/JSONRelations.java rename to src/main/java/io/personium/core/bar/jackson/JSONRelations.java index e3b8ac09d..9fef1f4c2 100644 --- a/src/main/java/com/fujitsu/dc/core/bar/jackson/JSONRelations.java +++ b/src/main/java/io/personium/core/bar/jackson/JSONRelations.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.bar.jackson; +package io.personium.core.bar.jackson; import org.codehaus.jackson.annotate.JsonProperty; import org.json.simple.JSONObject; diff --git a/src/main/java/com/fujitsu/dc/core/bar/jackson/JSONRoles.java b/src/main/java/io/personium/core/bar/jackson/JSONRoles.java similarity index 93% rename from src/main/java/com/fujitsu/dc/core/bar/jackson/JSONRoles.java rename to src/main/java/io/personium/core/bar/jackson/JSONRoles.java index ae444ff56..77de5f1fa 100644 --- a/src/main/java/com/fujitsu/dc/core/bar/jackson/JSONRoles.java +++ b/src/main/java/io/personium/core/bar/jackson/JSONRoles.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.bar.jackson; +package io.personium.core.bar.jackson; import org.codehaus.jackson.annotate.JsonProperty; import org.json.simple.JSONObject; diff --git a/src/main/java/com/fujitsu/dc/core/bar/jackson/JSONUserDataLinks.java b/src/main/java/io/personium/core/bar/jackson/JSONUserDataLinks.java similarity index 94% rename from src/main/java/com/fujitsu/dc/core/bar/jackson/JSONUserDataLinks.java rename to src/main/java/io/personium/core/bar/jackson/JSONUserDataLinks.java index 6b3c4e1bf..1e74cdd1c 100644 --- a/src/main/java/com/fujitsu/dc/core/bar/jackson/JSONUserDataLinks.java +++ b/src/main/java/io/personium/core/bar/jackson/JSONUserDataLinks.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.bar.jackson; +package io.personium.core.bar.jackson; import java.util.Map; diff --git a/src/main/java/com/fujitsu/dc/core/bar/jackson/package-info.java b/src/main/java/io/personium/core/bar/jackson/package-info.java similarity index 91% rename from src/main/java/com/fujitsu/dc/core/bar/jackson/package-info.java rename to src/main/java/io/personium/core/bar/jackson/package-info.java index 92920c77c..c3ef58ea2 100644 --- a/src/main/java/com/fujitsu/dc/core/bar/jackson/package-info.java +++ b/src/main/java/io/personium/core/bar/jackson/package-info.java @@ -17,5 +17,5 @@ /** * barファイルのMapping定義のクラス群です. */ -package com.fujitsu.dc.core.bar.jackson; +package io.personium.core.bar.jackson; diff --git a/src/main/java/com/fujitsu/dc/core/bar/package-info.java b/src/main/java/io/personium/core/bar/package-info.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/bar/package-info.java rename to src/main/java/io/personium/core/bar/package-info.java index 4573dfe64..9be4555c0 100644 --- a/src/main/java/com/fujitsu/dc/core/bar/package-info.java +++ b/src/main/java/io/personium/core/bar/package-info.java @@ -17,5 +17,5 @@ /** * classes related to bar file install & export. */ -package com.fujitsu.dc.core.bar; +package io.personium.core.bar; diff --git a/src/main/java/com/fujitsu/dc/core/event/EventBus.java b/src/main/java/io/personium/core/event/EventBus.java similarity index 83% rename from src/main/java/com/fujitsu/dc/core/event/EventBus.java rename to src/main/java/io/personium/core/event/EventBus.java index 88995e24d..9bea4d717 100644 --- a/src/main/java/com/fujitsu/dc/core/event/EventBus.java +++ b/src/main/java/io/personium/core/event/EventBus.java @@ -14,12 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.event; +package io.personium.core.event; import java.util.HashMap; import java.util.Map; -import com.fujitsu.dc.core.model.Cell; +import io.personium.core.model.Cell; /** @@ -37,15 +37,15 @@ public final class EventBus { */ public EventBus(Cell cell) { // TODO 本当は、Cellの設定を読み込んで、それぞれのイベントをどのレベルまでログ取得するべきかきめる。 - this.eventLoggers.put("access", new EventLogger(cell, DcEvent.Level.WARN)); - this.eventLoggers.put("client", new EventLogger(cell, DcEvent.Level.INFO)); + this.eventLoggers.put("access", new EventLogger(cell, PersoniumEvent.Level.WARN)); + this.eventLoggers.put("client", new EventLogger(cell, PersoniumEvent.Level.INFO)); } /** * イベントを投げる. * @param ev イベント */ - public void post(final DcEvent ev) { + public void post(final PersoniumEvent ev) { // 非同期で Subscriberに通知してゆく処理。 // JMS ? Netty あたりを使って Engineに通知を出したい。 // ログの出力。 diff --git a/src/main/java/com/fujitsu/dc/core/event/EventLogger.java b/src/main/java/io/personium/core/event/EventLogger.java similarity index 82% rename from src/main/java/com/fujitsu/dc/core/event/EventLogger.java rename to src/main/java/io/personium/core/event/EventLogger.java index dce7633ec..b789c20a4 100644 --- a/src/main/java/com/fujitsu/dc/core/event/EventLogger.java +++ b/src/main/java/io/personium/core/event/EventLogger.java @@ -14,12 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.event; +package io.personium.core.event; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.core.model.Cell; +import io.personium.core.model.Cell; /** * Eventのログ機構. @@ -42,15 +42,15 @@ public EventLogger(final Cell cell, final int logLevel) { * イベントの情報をログに出力する. * @param ev ログに出力するイベント */ - public void log(final DcEvent ev) { + public void log(final PersoniumEvent ev) { int evLv = ev.getLevel(); if (evLv >= this.logLevel) { // Do Logging - if (evLv == DcEvent.Level.ERROR) { + if (evLv == PersoniumEvent.Level.ERROR) { log.error(cell.getId() + ev.toLogMessage()); - } else if (evLv == DcEvent.Level.WARN) { + } else if (evLv == PersoniumEvent.Level.WARN) { log.warn(cell.getId() + ev.toLogMessage()); - } else if (evLv == DcEvent.Level.INFO) { + } else if (evLv == PersoniumEvent.Level.INFO) { log.info(cell.getId() + ev.toLogMessage()); } } diff --git a/src/main/java/com/fujitsu/dc/core/event/EventUtils.java b/src/main/java/io/personium/core/event/EventUtils.java similarity index 87% rename from src/main/java/com/fujitsu/dc/core/event/EventUtils.java rename to src/main/java/io/personium/core/event/EventUtils.java index f7d5710df..6eded861b 100644 --- a/src/main/java/com/fujitsu/dc/core/event/EventUtils.java +++ b/src/main/java/io/personium/core/event/EventUtils.java @@ -14,17 +14,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.event; +package io.personium.core.event; import java.io.File; import java.util.ArrayList; import java.util.List; -import com.fujitsu.dc.common.es.util.IndexNameEncoder; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.model.file.BinaryDataAccessException; -import com.fujitsu.dc.core.model.file.BinaryDataAccessor; -import com.fujitsu.dc.core.rs.cell.LogResource; +import io.personium.common.es.util.IndexNameEncoder; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.model.file.BinaryDataAccessException; +import io.personium.core.model.file.BinaryDataAccessor; +import io.personium.core.rs.cell.LogResource; /** * イベント用ユーティリティクラス. @@ -53,7 +53,7 @@ public static StringBuilder getEventLogDir(String cellId, String owner) { } StringBuilder logDir = new StringBuilder(); - logDir.append(DcCoreConfig.getEventLogCurrentDir()); + logDir.append(PersoniumUnitConfig.getEventLogCurrentDir()); logDir.append(File.separator); logDir.append(unitUserName); logDir.append(File.separator); @@ -87,7 +87,7 @@ public static void deleteEventLog(String cellId, String owner) throws BinaryData // ログの一覧を取得 List logFiles = getLogFileList(cellId, owner); BinaryDataAccessor accessor = new BinaryDataAccessor("", null, - DcCoreConfig.getPhysicalDeleteMode(), DcCoreConfig.getFsyncEnabled()); + PersoniumUnitConfig.getPhysicalDeleteMode(), PersoniumUnitConfig.getFsyncEnabled()); // ファイル論理削除 for (String logFile : logFiles) { diff --git a/src/main/java/com/fujitsu/dc/core/event/DcEvent.java b/src/main/java/io/personium/core/event/PersoniumEvent.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/event/DcEvent.java rename to src/main/java/io/personium/core/event/PersoniumEvent.java index 79705aba5..40b2a19d3 100644 --- a/src/main/java/com/fujitsu/dc/core/event/DcEvent.java +++ b/src/main/java/io/personium/core/event/PersoniumEvent.java @@ -14,12 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.event; +package io.personium.core.event; /** * イベント. */ -public class DcEvent { +public class PersoniumEvent { String name; String schema; int level; @@ -54,7 +54,7 @@ public static class Level { * @param object 対象 * @param result 結果 */ - public DcEvent(final String name, + public PersoniumEvent(final String name, final String schema, final int level, final String subject, diff --git a/src/main/java/com/fujitsu/dc/core/event/package-info.java b/src/main/java/io/personium/core/event/package-info.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/event/package-info.java rename to src/main/java/io/personium/core/event/package-info.java index 48c4936db..bbf77a39a 100644 --- a/src/main/java/com/fujitsu/dc/core/event/package-info.java +++ b/src/main/java/io/personium/core/event/package-info.java @@ -17,4 +17,4 @@ /** * イベント関連のクラス群. */ -package com.fujitsu.dc.core.event; +package io.personium.core.event; diff --git a/src/main/java/com/fujitsu/dc/core/eventbus/JSONEvent.java b/src/main/java/io/personium/core/eventbus/JSONEvent.java similarity index 93% rename from src/main/java/com/fujitsu/dc/core/eventbus/JSONEvent.java rename to src/main/java/io/personium/core/eventbus/JSONEvent.java index 26bff5db9..73c9683a4 100644 --- a/src/main/java/com/fujitsu/dc/core/eventbus/JSONEvent.java +++ b/src/main/java/io/personium/core/eventbus/JSONEvent.java @@ -14,12 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.eventbus; +package io.personium.core.eventbus; import org.codehaus.jackson.annotate.JsonProperty; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.model.ctl.Event; +import io.personium.core.model.ctl.Common; +import io.personium.core.model.ctl.Event; /** * barファイル内のRole定義用JSONファイル読み込み用Mapping定義クラス. diff --git a/src/main/java/com/fujitsu/dc/core/eventbus/DcEventBus.java b/src/main/java/io/personium/core/eventbus/PersoniumEventBus.java similarity index 87% rename from src/main/java/com/fujitsu/dc/core/eventbus/DcEventBus.java rename to src/main/java/io/personium/core/eventbus/PersoniumEventBus.java index 7bdb97ca9..ddd606419 100644 --- a/src/main/java/com/fujitsu/dc/core/eventbus/DcEventBus.java +++ b/src/main/java/io/personium/core/eventbus/PersoniumEventBus.java @@ -14,20 +14,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.eventbus; +package io.personium.core.eventbus; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.MDC; -import com.fujitsu.dc.common.es.util.IndexNameEncoder; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.ctl.Event; +import io.personium.common.es.util.IndexNameEncoder; +import io.personium.core.model.Cell; +import io.personium.core.model.ctl.Event; /** * イベントバス用クラス. */ -public class DcEventBus { +public class PersoniumEventBus { private static final int IDX_1ST_START = 0; private static final int IDX_1ST_END = 2; @@ -35,15 +35,15 @@ public class DcEventBus { private static final int IDX_2ND_END = 4; private Logger logger; - private DcEventBus() { - this.logger = LoggerFactory.getLogger("com.fujitsu.dc.core.eventbus"); + private PersoniumEventBus() { + this.logger = LoggerFactory.getLogger("io.personium.core.eventbus"); } /** * コンストラクタ. * @param cell セル */ - public DcEventBus(final Cell cell) { + public PersoniumEventBus(final Cell cell) { this(); String unitUserName = getUnitUserName(cell.getOwner()); String prefix1 = cell.getId().substring(IDX_1ST_START, IDX_1ST_END); diff --git a/src/main/java/com/fujitsu/dc/core/eventbus/package-info.java b/src/main/java/io/personium/core/eventbus/package-info.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/eventbus/package-info.java rename to src/main/java/io/personium/core/eventbus/package-info.java index b309fedcd..2b438fc52 100644 --- a/src/main/java/com/fujitsu/dc/core/eventbus/package-info.java +++ b/src/main/java/io/personium/core/eventbus/package-info.java @@ -17,4 +17,4 @@ /** * イベントバス関連のクラス群. */ -package com.fujitsu.dc.core.eventbus; +package io.personium.core.eventbus; diff --git a/src/main/java/com/fujitsu/dc/core/eventlog/ArchiveLogCollection.java b/src/main/java/io/personium/core/eventlog/ArchiveLogCollection.java similarity index 89% rename from src/main/java/com/fujitsu/dc/core/eventlog/ArchiveLogCollection.java rename to src/main/java/io/personium/core/eventlog/ArchiveLogCollection.java index 999780a71..9d0dcb84d 100644 --- a/src/main/java/com/fujitsu/dc/core/eventlog/ArchiveLogCollection.java +++ b/src/main/java/io/personium/core/eventlog/ArchiveLogCollection.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.eventlog; +package io.personium.core.eventlog; import java.io.File; import java.io.IOException; @@ -34,10 +34,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.event.EventUtils; -import com.fujitsu.dc.core.model.Cell; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.event.EventUtils; +import io.personium.core.model.Cell; /** * Archiveされたログファイルを格納するコレクション用のクラス. @@ -66,7 +66,7 @@ public ArchiveLogCollection(Cell cell, UriInfo uriInfo) { // archiveコレクションのURLを生成 StringBuilder urlSb = new StringBuilder(); UriBuilder uriBuilder = uriInfo.getBaseUriBuilder(); - uriBuilder.scheme(DcCoreConfig.getUnitScheme()); + uriBuilder.scheme(PersoniumUnitConfig.getUnitScheme()); urlSb.append(uriBuilder.build().toASCIIString()); urlSb.append(uriInfo.getPath()); this.url = urlSb.toString(); @@ -110,16 +110,16 @@ public void createFileInformation() { ZipEntry entry = (ZipEntry) emu.nextElement(); if (null == entry) { log.info("Zip file entry is null."); - throw DcCoreException.Event.ARCHIVE_FILE_CANNOT_OPEN; + throw PersoniumCoreException.Event.ARCHIVE_FILE_CANNOT_OPEN; } size += entry.getSize(); } } catch (ZipException e) { log.info("ZipException", e); - throw DcCoreException.Event.ARCHIVE_FILE_CANNOT_OPEN; + throw PersoniumCoreException.Event.ARCHIVE_FILE_CANNOT_OPEN; } catch (IOException e) { log.info("IOException", e); - throw DcCoreException.Event.ARCHIVE_FILE_CANNOT_OPEN; + throw PersoniumCoreException.Event.ARCHIVE_FILE_CANNOT_OPEN; } finally { IOUtils.closeQuietly(zipFile); } diff --git a/src/main/java/com/fujitsu/dc/core/eventlog/ArchiveLogFile.java b/src/main/java/io/personium/core/eventlog/ArchiveLogFile.java similarity index 93% rename from src/main/java/com/fujitsu/dc/core/eventlog/ArchiveLogFile.java rename to src/main/java/io/personium/core/eventlog/ArchiveLogFile.java index b84a42f6f..f4bdf11fa 100644 --- a/src/main/java/com/fujitsu/dc/core/eventlog/ArchiveLogFile.java +++ b/src/main/java/io/personium/core/eventlog/ArchiveLogFile.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.eventlog; +package io.personium.core.eventlog; /** diff --git a/src/main/java/com/fujitsu/dc/core/eventlog/package-info.java b/src/main/java/io/personium/core/eventlog/package-info.java similarity index 91% rename from src/main/java/com/fujitsu/dc/core/eventlog/package-info.java rename to src/main/java/io/personium/core/eventlog/package-info.java index bf64001f1..c87085249 100644 --- a/src/main/java/com/fujitsu/dc/core/eventlog/package-info.java +++ b/src/main/java/io/personium/core/eventlog/package-info.java @@ -17,4 +17,4 @@ /** * classes for Event Logging. */ -package com.fujitsu.dc.core.eventlog; +package io.personium.core.eventlog; diff --git a/src/main/java/com/fujitsu/dc/core/exceptions/ODataErrorMessage.java b/src/main/java/io/personium/core/exceptions/ODataErrorMessage.java similarity index 95% rename from src/main/java/com/fujitsu/dc/core/exceptions/ODataErrorMessage.java rename to src/main/java/io/personium/core/exceptions/ODataErrorMessage.java index a1c90e3ef..414fc5fe5 100644 --- a/src/main/java/com/fujitsu/dc/core/exceptions/ODataErrorMessage.java +++ b/src/main/java/io/personium/core/exceptions/ODataErrorMessage.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.exceptions; +package io.personium.core.exceptions; import java.util.Locale; diff --git a/src/main/java/com/fujitsu/dc/core/exceptions/package-info.java b/src/main/java/io/personium/core/exceptions/package-info.java similarity index 91% rename from src/main/java/com/fujitsu/dc/core/exceptions/package-info.java rename to src/main/java/io/personium/core/exceptions/package-info.java index cd1b7f6fc..dd4e8d924 100644 --- a/src/main/java/com/fujitsu/dc/core/exceptions/package-info.java +++ b/src/main/java/io/personium/core/exceptions/package-info.java @@ -17,5 +17,5 @@ /** * 例外クラス群. */ -package com.fujitsu.dc.core.exceptions; +package io.personium.core.exceptions; diff --git a/src/main/java/com/fujitsu/dc/core/http/header/ByteRangeSpec.java b/src/main/java/io/personium/core/http/header/ByteRangeSpec.java similarity index 96% rename from src/main/java/com/fujitsu/dc/core/http/header/ByteRangeSpec.java rename to src/main/java/io/personium/core/http/header/ByteRangeSpec.java index 5ac327de1..f900c7e0b 100644 --- a/src/main/java/com/fujitsu/dc/core/http/header/ByteRangeSpec.java +++ b/src/main/java/io/personium/core/http/header/ByteRangeSpec.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.http.header; +package io.personium.core.http.header; import java.util.regex.Matcher; import java.util.regex.Pattern; diff --git a/src/main/java/com/fujitsu/dc/core/http/header/RangeHeaderHandler.java b/src/main/java/io/personium/core/http/header/RangeHeaderHandler.java similarity index 96% rename from src/main/java/com/fujitsu/dc/core/http/header/RangeHeaderHandler.java rename to src/main/java/io/personium/core/http/header/RangeHeaderHandler.java index cf0eb8b1d..2d7cdedb5 100644 --- a/src/main/java/com/fujitsu/dc/core/http/header/RangeHeaderHandler.java +++ b/src/main/java/io/personium/core/http/header/RangeHeaderHandler.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.http.header; +package io.personium.core.http.header; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/com/fujitsu/dc/core/http/header/package-info.java b/src/main/java/io/personium/core/http/header/package-info.java similarity index 91% rename from src/main/java/com/fujitsu/dc/core/http/header/package-info.java rename to src/main/java/io/personium/core/http/header/package-info.java index 91878a1a4..4282046c3 100644 --- a/src/main/java/com/fujitsu/dc/core/http/header/package-info.java +++ b/src/main/java/io/personium/core/http/header/package-info.java @@ -17,5 +17,5 @@ /** * classes for parsing / generating HTTP headers. */ -package com.fujitsu.dc.core.http.header; +package io.personium.core.http.header; diff --git a/src/main/java/com/fujitsu/dc/core/jersey/filter/DcCoreContainerFilter.java b/src/main/java/io/personium/core/jersey/filter/PersoniumCoreContainerFilter.java similarity index 81% rename from src/main/java/com/fujitsu/dc/core/jersey/filter/DcCoreContainerFilter.java rename to src/main/java/io/personium/core/jersey/filter/PersoniumCoreContainerFilter.java index ae745c577..f958c2645 100644 --- a/src/main/java/com/fujitsu/dc/core/jersey/filter/DcCoreContainerFilter.java +++ b/src/main/java/io/personium/core/jersey/filter/PersoniumCoreContainerFilter.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.jersey.filter; +package io.personium.core.jersey.filter; import java.util.ArrayList; import java.util.List; @@ -32,12 +32,12 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.common.utils.DcCoreUtils.HttpHeaders; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.DcReadDeleteModeManager; -import com.fujitsu.dc.core.model.lock.CellLockManager; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.common.utils.PersoniumCoreUtils.HttpHeaders; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.PersoniumReadDeleteModeManager; +import io.personium.core.model.lock.CellLockManager; import com.sun.jersey.core.header.InBoundHeaders; import com.sun.jersey.spi.container.ContainerRequest; import com.sun.jersey.spi.container.ContainerRequestFilter; @@ -47,9 +47,9 @@ /** * 本アプリのリクエスト及びレスポンスに対してかけるフィルター. */ -public final class DcCoreContainerFilter implements ContainerRequestFilter, ContainerResponseFilter { +public final class PersoniumCoreContainerFilter implements ContainerRequestFilter, ContainerResponseFilter { - static Logger log = LoggerFactory.getLogger(DcCoreContainerFilter.class); + static Logger log = LoggerFactory.getLogger(PersoniumCoreContainerFilter.class); // Acceptヘッダーが取り得る値の正規表現 static Pattern acceptHeaderValueRegex = Pattern.compile("\\A\\p{ASCII}*\\z"); @@ -86,11 +86,11 @@ public ContainerRequest filter(ContainerRequest request) { // リクエストヘッダーの不正値をチェックする checkRequestHeader(request); - // DcCoreConfig.setUnitRootIfNotSet(this.httpServletRequest); + // PersoniumCoreConfig.setUnitRootIfNotSet(this.httpServletRequest); // PCSの動作モードがReadDeleteOnlyモードの場合は、参照系リクエストのみ許可する // 許可されていない場合は例外を発生させてExceptionMapperにて処理する - DcReadDeleteModeManager.checkReadDeleteOnlyMode(request.getMethod(), request.getPathSegments()); + PersoniumReadDeleteModeManager.checkReadDeleteOnlyMode(request.getMethod(), request.getPathSegments()); return request; } @@ -122,7 +122,7 @@ public ContainerResponse filter(final ContainerRequest request, final ContainerR private void methodOverride(final ContainerRequest request) { if (request.getMethod().equalsIgnoreCase(HttpMethod.POST)) { // メソッドオーバーライド - String method = request.getRequestHeaders().getFirst(DcCoreUtils.HttpHeaders.X_HTTP_METHOD_OVERRIDE); + String method = request.getRequestHeaders().getFirst(PersoniumCoreUtils.HttpHeaders.X_HTTP_METHOD_OVERRIDE); if (method != null && !method.isEmpty()) { request.setMethod(method); } @@ -135,7 +135,7 @@ private void methodOverride(final ContainerRequest request) { */ private void headerOverride(final ContainerRequest request) { // ヘッダオーバーライド - List overrideHeaderList = request.getRequestHeaders().get(DcCoreUtils.HttpHeaders.X_OVERRIDE); + List overrideHeaderList = request.getRequestHeaders().get(PersoniumCoreUtils.HttpHeaders.X_OVERRIDE); if (overrideHeaderList == null) { return; } @@ -173,9 +173,9 @@ private void headerOverride(final ContainerRequest request) { * @param request 加工するリクエスト */ private void uriOverride(final ContainerRequest request) { - String xForwardedProto = request.getHeaderValue(DcCoreUtils.HttpHeaders.X_FORWARDED_PROTO); - String xForwardedHost = request.getHeaderValue(DcCoreUtils.HttpHeaders.X_FORWARDED_HOST); - String xForwardedPath = request.getHeaderValue(DcCoreUtils.HttpHeaders.X_FORWARDED_PATH); + String xForwardedProto = request.getHeaderValue(PersoniumCoreUtils.HttpHeaders.X_FORWARDED_PROTO); + String xForwardedHost = request.getHeaderValue(PersoniumCoreUtils.HttpHeaders.X_FORWARDED_HOST); + String xForwardedPath = request.getHeaderValue(PersoniumCoreUtils.HttpHeaders.X_FORWARDED_PATH); UriBuilder bub = request.getBaseUriBuilder(); UriBuilder rub = request.getRequestUriBuilder(); @@ -202,7 +202,7 @@ private void uriOverride(final ContainerRequest request) { /** * 全てのレスポンスに共通するレスポンスヘッダーを追加する. * Access-Control-Allow-Origin, Access-Control-Allow-Headers
- * X-Dc-Version
+ * X-Personium-Version
* @param request * @param response */ @@ -215,8 +215,8 @@ private void addResponseHeaders(final ContainerRequest request, final ContainerR mm.remove(HttpHeaders.ACCESS_CONTROL_ALLOW_HEADERS); } mm.putSingle(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, HttpHeaders.Value.ASTERISK); - // X-Dc-Version - mm.putSingle(HttpHeaders.X_DC_VERSION, DcCoreConfig.getCoreVersion()); + // X-Personium-Version + mm.putSingle(HttpHeaders.X_PERSONIUM_VERSION, PersoniumUnitConfig.getCoreVersion()); } /** @@ -226,7 +226,7 @@ private void addResponseHeaders(final ContainerRequest request, final ContainerR */ private void requestLog(final ContainerRequest request) { StringBuilder sb = new StringBuilder(); - sb.append("[" + DcCoreConfig.getCoreVersion() + "] " + "Started. "); + sb.append("[" + PersoniumUnitConfig.getCoreVersion() + "] " + "Started. "); sb.append(request.getMethod()); sb.append(" "); sb.append(request.getRequestUri().toString()); @@ -241,7 +241,7 @@ private void requestLog(final ContainerRequest request) { */ private void responseLog(final ContainerResponse response) { StringBuilder sb = new StringBuilder(); - sb.append("[" + DcCoreConfig.getCoreVersion() + "] " + "Completed. "); + sb.append("[" + PersoniumUnitConfig.getCoreVersion() + "] " + "Completed. "); sb.append(response.getStatus()); sb.append(" "); @@ -262,18 +262,18 @@ private void responseOptionsMethod(ContainerRequest request) { String authValue = request.getHeaderValue(org.apache.http.HttpHeaders.AUTHORIZATION); String methodName = request.getMethod(); if (authValue == null && HttpMethod.OPTIONS.equals(methodName)) { - Response res = DcCoreUtils.responseBuilderForOptions( + Response res = PersoniumCoreUtils.responseBuilderForOptions( HttpMethod.GET, HttpMethod.POST, HttpMethod.PUT, HttpMethod.DELETE, HttpMethod.HEAD, - com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.MERGE, - com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.MKCOL, - com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.MOVE, - com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPFIND, - com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPPATCH, - com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.ACL + io.personium.common.utils.PersoniumCoreUtils.HttpMethod.MERGE, + io.personium.common.utils.PersoniumCoreUtils.HttpMethod.MKCOL, + io.personium.common.utils.PersoniumCoreUtils.HttpMethod.MOVE, + io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPFIND, + io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPPATCH, + io.personium.common.utils.PersoniumCoreUtils.HttpMethod.ACL ).build(); // 例外を発行することでServletへ制御を渡さない @@ -305,7 +305,7 @@ private void checkRequestHeader(ContainerRequest request) { request.setHeaders(newHeaders); String acceptValue = request.getHeaderValue(org.apache.http.HttpHeaders.ACCEPT); if (acceptValue != null && !acceptHeaderValueRegex.matcher(acceptValue).matches()) { - DcCoreException exception = DcCoreException.OData.BAD_REQUEST_HEADER_VALUE.params( + PersoniumCoreException exception = PersoniumCoreException.OData.BAD_REQUEST_HEADER_VALUE.params( org.apache.http.HttpHeaders.ACCEPT, acceptValue); throw exception; } diff --git a/src/main/java/com/fujitsu/dc/core/jersey/filter/package-info.java b/src/main/java/io/personium/core/jersey/filter/package-info.java similarity index 91% rename from src/main/java/com/fujitsu/dc/core/jersey/filter/package-info.java rename to src/main/java/io/personium/core/jersey/filter/package-info.java index 194d5e2c5..0be8c43f7 100644 --- a/src/main/java/com/fujitsu/dc/core/jersey/filter/package-info.java +++ b/src/main/java/io/personium/core/jersey/filter/package-info.java @@ -17,5 +17,5 @@ /** * 本アプリで用いるJerseyフィルタ群. */ -package com.fujitsu.dc.core.jersey.filter; +package io.personium.core.jersey.filter; diff --git a/src/main/java/com/fujitsu/dc/core/model/Box.java b/src/main/java/io/personium/core/model/Box.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/model/Box.java rename to src/main/java/io/personium/core/model/Box.java index 746413556..1e772cba6 100644 --- a/src/main/java/com/fujitsu/dc/core/model/Box.java +++ b/src/main/java/io/personium/core/model/Box.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model; +package io.personium.core.model; import java.util.List; @@ -27,9 +27,9 @@ import org.odata4j.edm.EdmProperty; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.model.ctl.CtlSchema; -import com.fujitsu.dc.core.odata.OEntityWrapper; +import io.personium.core.model.ctl.Common; +import io.personium.core.model.ctl.CtlSchema; +import io.personium.core.odata.OEntityWrapper; /** @@ -185,7 +185,7 @@ public static List> createSchemaAnnotation(final String name) { * Name Definition of property. */ public static final EdmProperty.Builder P_PATH_NAME = EdmProperty.newBuilder("Name") - .setAnnotations(Common.DC_FORMAT_NAME) + .setAnnotations(Common.P_FORMAT_NAME) .setNullable(false) .setType(EdmSimpleType.STRING); /** diff --git a/src/main/java/com/fujitsu/dc/core/model/BoxCmp.java b/src/main/java/io/personium/core/model/BoxCmp.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/model/BoxCmp.java rename to src/main/java/io/personium/core/model/BoxCmp.java index d7f83ad20..9602186f3 100644 --- a/src/main/java/com/fujitsu/dc/core/model/BoxCmp.java +++ b/src/main/java/io/personium/core/model/BoxCmp.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model; +package io.personium.core.model; /** * Boxに対応する部品のインターフェース. diff --git a/src/main/java/com/fujitsu/dc/core/model/BoxRsCmp.java b/src/main/java/io/personium/core/model/BoxRsCmp.java similarity index 86% rename from src/main/java/com/fujitsu/dc/core/model/BoxRsCmp.java rename to src/main/java/io/personium/core/model/BoxRsCmp.java index 4c0213ad3..505a22969 100644 --- a/src/main/java/com/fujitsu/dc/core/model/BoxRsCmp.java +++ b/src/main/java/io/personium/core/model/BoxRsCmp.java @@ -14,9 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model; +package io.personium.core.model; -import com.fujitsu.dc.core.auth.AccessContext; +import io.personium.core.auth.AccessContext; /** @@ -31,14 +31,14 @@ public class BoxRsCmp extends DavRsCmp { /** * コンストラクタ. + * @param cellRsCmp CellRsCmp * @param davCmp DavCmp - * @param cell Cell * @param accessContext AccessContext * @param box ボックス */ - public BoxRsCmp(final DavCmp davCmp, final Cell cell, final AccessContext accessContext, final Box box) { - super(null, davCmp); - this.cell = cell; + public BoxRsCmp(final CellRsCmp cellRsCmp, final DavCmp davCmp, final AccessContext accessContext, final Box box) { + super(cellRsCmp, davCmp); + this.cell = cellRsCmp.getCell(); this.accessContext = accessContext; this.box = box; this.davCmp = davCmp; diff --git a/src/main/java/com/fujitsu/dc/core/model/BoxUrlRsCmp.java b/src/main/java/io/personium/core/model/BoxUrlRsCmp.java similarity index 75% rename from src/main/java/com/fujitsu/dc/core/model/BoxUrlRsCmp.java rename to src/main/java/io/personium/core/model/BoxUrlRsCmp.java index 4bd95e325..6022811a9 100644 --- a/src/main/java/com/fujitsu/dc/core/model/BoxUrlRsCmp.java +++ b/src/main/java/io/personium/core/model/BoxUrlRsCmp.java @@ -14,13 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model; +package io.personium.core.model; -import com.fujitsu.dc.core.DcCoreAuthzException; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.auth.OAuth2Helper.AcceptableAuthScheme; -import com.fujitsu.dc.core.auth.Privilege; +import io.personium.core.PersoniumCoreAuthzException; +import io.personium.core.PersoniumCoreException; +import io.personium.core.auth.AccessContext; +import io.personium.core.auth.OAuth2Helper.AcceptableAuthScheme; +import io.personium.core.auth.Privilege; /** * Box URL取得リソース オブジェクトから処理の委譲を受けてDav関連の永続化を除く処理を行うクラス. @@ -29,13 +29,14 @@ public class BoxUrlRsCmp extends BoxRsCmp { /** * コンストラクタ. + * @param cellRsCmp CellRsCmp * @param davCmp DavCmp - * @param cell Cell * @param accessContext AccessContext * @param box ボックス */ - public BoxUrlRsCmp(final DavCmp davCmp, final Cell cell, final AccessContext accessContext, final Box box) { - super(davCmp, cell, accessContext, box); + public BoxUrlRsCmp(final CellRsCmp cellRsCmp, final DavCmp davCmp, + final AccessContext accessContext, final Box box) { + super(cellRsCmp, davCmp, accessContext, box); } /** @@ -65,9 +66,9 @@ public void checkAccessContext(final AccessContext ac, Privilege privilege) { if (AccessContext.TYPE_INVALID.equals(ac.getType())) { ac.throwInvalidTokenException(allowedAuthScheme); } else if (AccessContext.TYPE_ANONYMOUS.equals(ac.getType())) { - throw DcCoreAuthzException.AUTHORIZATION_REQUIRED.realm(ac.getRealm(), allowedAuthScheme); + throw PersoniumCoreAuthzException.AUTHORIZATION_REQUIRED.realm(ac.getRealm(), allowedAuthScheme); } - throw DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + throw PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; } } diff --git a/src/main/java/com/fujitsu/dc/core/model/Cell.java b/src/main/java/io/personium/core/model/Cell.java similarity index 90% rename from src/main/java/com/fujitsu/dc/core/model/Cell.java rename to src/main/java/io/personium/core/model/Cell.java index f9cbfef51..75e6d0682 100644 --- a/src/main/java/com/fujitsu/dc/core/model/Cell.java +++ b/src/main/java/io/personium/core/model/Cell.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model; +package io.personium.core.model; import java.util.Collections; import java.util.List; @@ -24,11 +24,11 @@ import org.odata4j.edm.EdmProperty; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.common.auth.token.IExtRoleContainingToken; -import com.fujitsu.dc.common.auth.token.Role; -import com.fujitsu.dc.core.event.EventBus; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.odata.OEntityWrapper; +import io.personium.common.auth.token.IExtRoleContainingToken; +import io.personium.common.auth.token.Role; +import io.personium.core.event.EventBus; +import io.personium.core.model.ctl.Common; +import io.personium.core.odata.OEntityWrapper; import java.util.Arrays; @@ -180,7 +180,7 @@ public interface Cell { */ EdmProperty.Builder P_PATH_NAME = EdmProperty.newBuilder("Name") .setNullable(false) - .setAnnotations(Common.DC_FORMAT_NAME) + .setAnnotations(Common.P_FORMAT_NAME) .setType(EdmSimpleType.STRING); /** diff --git a/src/main/java/com/fujitsu/dc/core/model/CellCmp.java b/src/main/java/io/personium/core/model/CellCmp.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/model/CellCmp.java rename to src/main/java/io/personium/core/model/CellCmp.java index 97fa3e52d..de71838a7 100644 --- a/src/main/java/com/fujitsu/dc/core/model/CellCmp.java +++ b/src/main/java/io/personium/core/model/CellCmp.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model; +package io.personium.core.model; /** * Cellに対応する部品のインターフェース. diff --git a/src/main/java/com/fujitsu/dc/core/model/CellRsCmp.java b/src/main/java/io/personium/core/model/CellRsCmp.java similarity index 86% rename from src/main/java/com/fujitsu/dc/core/model/CellRsCmp.java rename to src/main/java/io/personium/core/model/CellRsCmp.java index a5695307f..36a9b5c93 100644 --- a/src/main/java/com/fujitsu/dc/core/model/CellRsCmp.java +++ b/src/main/java/io/personium/core/model/CellRsCmp.java @@ -14,13 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model; +package io.personium.core.model; -import com.fujitsu.dc.core.DcCoreAuthzException; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.auth.OAuth2Helper.AcceptableAuthScheme; -import com.fujitsu.dc.core.auth.Privilege; +import io.personium.core.PersoniumCoreAuthzException; +import io.personium.core.PersoniumCoreException; +import io.personium.core.auth.AccessContext; +import io.personium.core.auth.OAuth2Helper.AcceptableAuthScheme; +import io.personium.core.auth.Privilege; /** * JaxRS Resource オブジェクトから処理の委譲を受けてDav関連の永続化を除く処理を行うクラス. @@ -120,9 +120,9 @@ public void checkAccessContext(final AccessContext ac, Privilege privilege) { if (AccessContext.TYPE_INVALID.equals(ac.getType())) { ac.throwInvalidTokenException(getAcceptableAuthScheme()); } else if (AccessContext.TYPE_ANONYMOUS.equals(ac.getType())) { - throw DcCoreAuthzException.AUTHORIZATION_REQUIRED.realm(ac.getRealm(), getAcceptableAuthScheme()); + throw PersoniumCoreAuthzException.AUTHORIZATION_REQUIRED.realm(ac.getRealm(), getAcceptableAuthScheme()); } - throw DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + throw PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; } } diff --git a/src/main/java/com/fujitsu/dc/core/model/DavCmp.java b/src/main/java/io/personium/core/model/DavCmp.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/model/DavCmp.java rename to src/main/java/io/personium/core/model/DavCmp.java index 5b8a82d0d..96cd78638 100644 --- a/src/main/java/com/fujitsu/dc/core/model/DavCmp.java +++ b/src/main/java/io/personium/core/model/DavCmp.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package com.fujitsu.dc.core.model; +package io.personium.core.model; import java.io.InputStream; import java.io.Reader; @@ -27,9 +27,9 @@ import org.apache.wink.webdav.model.Multistatus; import org.apache.wink.webdav.model.Propertyupdate; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.jaxb.Acl; -import com.fujitsu.dc.core.odata.DcODataProducer; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.jaxb.Acl; +import io.personium.core.odata.PersoniumODataProducer; /** @@ -273,14 +273,14 @@ public interface DavCmp { * データ操作用ODataProducerを返します. * @return ODataProducer */ - DcODataProducer getODataProducer(); + PersoniumODataProducer getODataProducer(); /** * スキーマ操作用ODataProducerを返します. * @param cell Cell * @return ODataProducer */ - DcODataProducer getSchemaODataProducer(Cell cell); + PersoniumODataProducer getSchemaODataProducer(Cell cell); /** * @return ETag String. @@ -309,5 +309,5 @@ public interface DavCmp { * メッセージの付加情報は、ここでは設定せずに呼び出し元で設定すること。 * @return NotFound例外 */ - DcCoreException getNotFoundException(); + PersoniumCoreException getNotFoundException(); } diff --git a/src/main/java/com/fujitsu/dc/core/model/DavCommon.java b/src/main/java/io/personium/core/model/DavCommon.java similarity index 95% rename from src/main/java/com/fujitsu/dc/core/model/DavCommon.java rename to src/main/java/io/personium/core/model/DavCommon.java index 40dbb1b01..013547812 100644 --- a/src/main/java/com/fujitsu/dc/core/model/DavCommon.java +++ b/src/main/java/io/personium/core/model/DavCommon.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model; +package io.personium.core.model; import java.util.regex.Matcher; import java.util.regex.Pattern; diff --git a/src/main/java/com/fujitsu/dc/core/model/DavDestination.java b/src/main/java/io/personium/core/model/DavDestination.java similarity index 89% rename from src/main/java/com/fujitsu/dc/core/model/DavDestination.java rename to src/main/java/io/personium/core/model/DavDestination.java index adcb61375..fa72b56ec 100644 --- a/src/main/java/com/fujitsu/dc/core/model/DavDestination.java +++ b/src/main/java/io/personium/core/model/DavDestination.java @@ -14,14 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model; +package io.personium.core.model; import java.net.URI; import java.net.URISyntaxException; import java.util.List; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; /** * Davのあて先情報を管理するクラス. @@ -115,10 +115,10 @@ private void checkDepthLimit() { */ private void checkParentChildCount(DavCmp currentCmp, DavCmp parentCmp) { if (!currentCmp.exists() - && DcCoreConfig.getMaxChildResourceCount() <= parentCmp.getChildrenCount()) { + && PersoniumUnitConfig.getMaxChildResourceCount() <= parentCmp.getChildrenCount()) { // 移動先にリソースが存在しない、かつ、移動先の親の子要素数がすでに最大値に達している場合 // ※移動先にすでにリソースが存在する(上書き)の場合は、移動先のリソース作成時に最大値に関するチェックは行われているので、ここでは実施しない - throw DcCoreException.Dav.COLLECTION_CHILDRESOURCE_ERROR; + throw PersoniumCoreException.Dav.COLLECTION_CHILDRESOURCE_ERROR; } } @@ -129,7 +129,7 @@ private void checkParentChildCount(DavCmp currentCmp, DavCmp parentCmp) { private void checkHasParent(List destinationPaths, int hierarchyNumber) { if (hierarchyNumber < destinationPaths.size() - 1) { // 移動先のパスの途中のリソースが存在しない場合、409エラーとする - throw DcCoreException.Dav.HAS_NOT_PARENT.params(destinationPaths.get(hierarchyNumber)); + throw PersoniumCoreException.Dav.HAS_NOT_PARENT.params(destinationPaths.get(hierarchyNumber)); } } @@ -142,31 +142,31 @@ private void checkIsProhibitedResource(String overwrite, if (DavCommon.OVERWRITE_FALSE.equalsIgnoreCase(overwrite)) { // OverwriteヘッダにFが指定された場合は上書き不可のためエラーとする - throw DcCoreException.Dav.DESTINATION_ALREADY_EXISTS; + throw PersoniumCoreException.Dav.DESTINATION_ALREADY_EXISTS; } else if (DavCmp.TYPE_COL_SVC.equals(parentCmp.getType()) && DavCmp.SERVICE_SRC_COLLECTION.equals(currentCmp.getName())) { // Serviceソースコレクションへの上書きは行えないため、エラーとする - throw DcCoreException.Dav.SERVICE_SOURCE_COLLECTION_PROHIBITED_TO_OVERWRITE; + throw PersoniumCoreException.Dav.SERVICE_SOURCE_COLLECTION_PROHIBITED_TO_OVERWRITE; } else if (!DavCmp.TYPE_DAV_FILE.equals(currentCmp.getType())) { // 現状の仕様ではコレクションの上書きは行えないため、エラーとする - throw DcCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; + throw PersoniumCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; } } else { // 移動後のリソースが新規に作成される場合に必要なチェック if (DavCmp.TYPE_COL_ODATA.equals(parentCmp.getType())) { // 親のリソースがODataコレクションであるため移動できない - throw DcCoreException.Dav.RESOURCE_PROHIBITED_TO_MOVE_ODATA_COLLECTION; + throw PersoniumCoreException.Dav.RESOURCE_PROHIBITED_TO_MOVE_ODATA_COLLECTION; } else if (DavCmp.TYPE_DAV_FILE.equals(parentCmp.getType())) { // 親のリソースがWebDavファイルであるため移動できない - throw DcCoreException.Dav.RESOURCE_PROHIBITED_TO_MOVE_FILE; + throw PersoniumCoreException.Dav.RESOURCE_PROHIBITED_TO_MOVE_FILE; } else if (DavCmp.TYPE_COL_SVC.equals(parentCmp.getType())) { // 親のリソースがServiceコレクションであるため移動できない - throw DcCoreException.Dav.RESOURCE_PROHIBITED_TO_MOVE_SERVICE_COLLECTION; + throw PersoniumCoreException.Dav.RESOURCE_PROHIBITED_TO_MOVE_SERVICE_COLLECTION; } } @@ -174,7 +174,7 @@ private void checkIsProhibitedResource(String overwrite, && !DavCmp.TYPE_DAV_FILE.equals(sourceResourceType)) { // ServiceSourceコレクション配下へコレクションは移動できない // 例)ServiceSourceコレクション/__src/collection - throw DcCoreException.Dav.SERVICE_SOURCE_COLLECTION_PROHIBITED_TO_CONTAIN_COLLECTION; + throw PersoniumCoreException.Dav.SERVICE_SOURCE_COLLECTION_PROHIBITED_TO_CONTAIN_COLLECTION; } } diff --git a/src/main/java/com/fujitsu/dc/core/model/DavMoveResource.java b/src/main/java/io/personium/core/model/DavMoveResource.java similarity index 82% rename from src/main/java/com/fujitsu/dc/core/model/DavMoveResource.java rename to src/main/java/io/personium/core/model/DavMoveResource.java index 310f79a9d..a58e5fad1 100644 --- a/src/main/java/com/fujitsu/dc/core/model/DavMoveResource.java +++ b/src/main/java/io/personium/core/model/DavMoveResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model; +package io.personium.core.model; import java.net.URI; import java.net.URISyntaxException; @@ -24,8 +24,8 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.ResponseBuilder; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; /** * JaxRS Resource オブジェクトから処理の委譲を受けてDavのMoveに関する処理を行うクラス. @@ -70,7 +70,7 @@ public Response doMove() { davDestination = new DavDestination(destination, this.getAccessContext().getBaseUri(), boxRsCmp); } catch (URISyntaxException e) { // URI 形式でない - throw DcCoreException.Dav.INVALID_REQUEST_HEADER.params(org.apache.http.HttpHeaders.DESTINATION, + throw PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params(org.apache.http.HttpHeaders.DESTINATION, destination); } @@ -83,11 +83,15 @@ public Response doMove() { private BoxRsCmp getBoxRsCmp() { // 最上位にあるBoxのリソース情報を取得する DavRsCmp davRsCmp = this; - for (int i = 0; i <= DcCoreConfig.getMaxCollectionDepth(); i++) { + for (int i = 0; i <= PersoniumUnitConfig.getMaxCollectionDepth(); i++) { DavRsCmp parent = davRsCmp.getParent(); if (null == parent) { break; } + // Boxが取れない場合は終了 + if (null == parent.getBox()) { + break; + } davRsCmp = parent; } @@ -104,37 +108,37 @@ private BoxRsCmp getBoxRsCmp() { void validateHeaders() { // Depth ヘッダ if (!DavCommon.DEPTH_INFINITY.equalsIgnoreCase(depth)) { - throw DcCoreException.Dav.INVALID_DEPTH_HEADER.params(depth); + throw PersoniumCoreException.Dav.INVALID_DEPTH_HEADER.params(depth); } // Overwrite ヘッダ if (!DavCommon.OVERWRITE_FALSE.equalsIgnoreCase(overwrite) && !DavCommon.OVERWRITE_TRUE.equalsIgnoreCase(overwrite)) { - throw DcCoreException.Dav.INVALID_REQUEST_HEADER.params(org.apache.http.HttpHeaders.OVERWRITE, overwrite); + throw PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params(org.apache.http.HttpHeaders.OVERWRITE, overwrite); } // Destination ヘッダ if (destination == null || destination.length() <= 0) { - throw DcCoreException.Dav.REQUIRED_REQUEST_HEADER_NOT_EXIST + throw PersoniumCoreException.Dav.REQUIRED_REQUEST_HEADER_NOT_EXIST .params(org.apache.http.HttpHeaders.DESTINATION); } if (this.getUrl().equals(destination)) { // 移動元と移動先が等しい場合はエラーとする - throw DcCoreException.Dav.DESTINATION_EQUALS_SOURCE_URL.params(destination); + throw PersoniumCoreException.Dav.DESTINATION_EQUALS_SOURCE_URL.params(destination); } DavPath destinationPath = getDestination(); if (!this.getAccessContext().getBaseUri().equals(destinationPath.getBaseUri())) { // スキーマ、ホストが移動元、移動先で異なる場合はエラーとする - throw DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + throw PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( org.apache.http.HttpHeaders.DESTINATION, destination); } if (!this.getCell().getName().equals(destinationPath.getCellName()) || !this.getBox().getName().equals(destinationPath.getBoxName())) { // Cell、Box が移動元、移動先で異なる場合はエラーとする - throw DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + throw PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( org.apache.http.HttpHeaders.DESTINATION, destination); } } @@ -149,7 +153,7 @@ private DavPath getDestination() { destUri = new URI(destination); } catch (URISyntaxException e) { // URI 形式でない - throw DcCoreException.Dav.INVALID_REQUEST_HEADER.params(org.apache.http.HttpHeaders.DESTINATION, + throw PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params(org.apache.http.HttpHeaders.DESTINATION, destination); } return new DavPath(destUri, this.getAccessContext().getBaseUri()); diff --git a/src/main/java/com/fujitsu/dc/core/model/DavPath.java b/src/main/java/io/personium/core/model/DavPath.java similarity index 95% rename from src/main/java/com/fujitsu/dc/core/model/DavPath.java rename to src/main/java/io/personium/core/model/DavPath.java index 87524f057..a1b4285c1 100644 --- a/src/main/java/com/fujitsu/dc/core/model/DavPath.java +++ b/src/main/java/io/personium/core/model/DavPath.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model; +package io.personium.core.model; import java.net.URI; import java.util.ArrayList; diff --git a/src/main/java/com/fujitsu/dc/core/model/DavRsCmp.java b/src/main/java/io/personium/core/model/DavRsCmp.java similarity index 88% rename from src/main/java/com/fujitsu/dc/core/model/DavRsCmp.java rename to src/main/java/io/personium/core/model/DavRsCmp.java index 499f5f74e..bbd130004 100644 --- a/src/main/java/com/fujitsu/dc/core/model/DavRsCmp.java +++ b/src/main/java/io/personium/core/model/DavRsCmp.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model; +package io.personium.core.model; import java.io.BufferedReader; import java.io.ByteArrayInputStream; @@ -58,23 +58,23 @@ import org.w3c.dom.Element; -import com.fujitsu.dc.common.auth.token.Role; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreAuthzException; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.auth.BoxPrivilege; -import com.fujitsu.dc.core.auth.OAuth2Helper; -import com.fujitsu.dc.core.auth.OAuth2Helper.AcceptableAuthScheme; -import com.fujitsu.dc.core.auth.Privilege; -import com.fujitsu.dc.core.model.jaxb.Acl; -import com.fujitsu.dc.core.model.jaxb.ObjectIo; -import com.fujitsu.dc.core.rs.box.DavCollectionResource; -import com.fujitsu.dc.core.rs.box.DavFileResource; -import com.fujitsu.dc.core.rs.box.DcEngineSvcCollectionResource; -import com.fujitsu.dc.core.rs.box.NullResource; -import com.fujitsu.dc.core.rs.box.ODataSvcCollectionResource; -import com.fujitsu.dc.core.utils.ResourceUtils; +import io.personium.common.auth.token.Role; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumCoreAuthzException; +import io.personium.core.PersoniumCoreException; +import io.personium.core.auth.AccessContext; +import io.personium.core.auth.BoxPrivilege; +import io.personium.core.auth.OAuth2Helper; +import io.personium.core.auth.OAuth2Helper.AcceptableAuthScheme; +import io.personium.core.auth.Privilege; +import io.personium.core.model.jaxb.Acl; +import io.personium.core.model.jaxb.ObjectIo; +import io.personium.core.rs.box.DavCollectionResource; +import io.personium.core.rs.box.DavFileResource; +import io.personium.core.rs.box.PersoniumEngineSvcCollectionResource; +import io.personium.core.rs.box.NullResource; +import io.personium.core.rs.box.ODataSvcCollectionResource; +import io.personium.core.utils.ResourceUtils; /** * JaxRS Resource オブジェクトから処理の委譲を受けてDav関連の永続化を除く処理を行うクラス. @@ -136,7 +136,7 @@ public Object nextPath(final String nextPath, final HttpServletRequest request) } else if (DavCmp.TYPE_COL_ODATA.equals(type)) { return new ODataSvcCollectionResource(this, nextCmp); } else if (DavCmp.TYPE_COL_SVC.equals(type)) { - return new DcEngineSvcCollectionResource(this, nextCmp); + return new PersoniumEngineSvcCollectionResource(this, nextCmp); } return null; @@ -249,7 +249,7 @@ public final Response doPropfind(final Reader requestBodyXml, final String depth br = new BufferedReader(requestBodyXml); propfind = Propfind.unmarshal(br); } catch (Exception e1) { - throw DcCoreException.Dav.XML_ERROR.reason(e1); + throw PersoniumCoreException.Dav.XML_ERROR.reason(e1); } } else { log.debug("Content-Length 0"); @@ -258,11 +258,11 @@ public final Response doPropfind(final Reader requestBodyXml, final String depth // Depthヘッダの有効な値は 0, 1 // infinityの場合はサポートしないので403で返す if ("infinity".equals(depth)) { - throw DcCoreException.Dav.PROPFIND_FINITE_DEPTH; + throw PersoniumCoreException.Dav.PROPFIND_FINITE_DEPTH; } else if (depth == null) { - throw DcCoreException.Dav.INVALID_DEPTH_HEADER.params("null"); + throw PersoniumCoreException.Dav.INVALID_DEPTH_HEADER.params("null"); } else if (!("0".equals(depth) || "1".equals(depth))) { - throw DcCoreException.Dav.INVALID_DEPTH_HEADER.params(depth); + throw PersoniumCoreException.Dav.INVALID_DEPTH_HEADER.params(depth); } String reqUri = this.getUrl(); @@ -331,7 +331,7 @@ public final Response doProppatch(final Reader reqBodyXml) { br = new BufferedReader(reqBodyXml); pu = Propertyupdate.unmarshal(br); } catch (Exception e1) { - throw DcCoreException.Dav.XML_ERROR.reason(e1); + throw PersoniumCoreException.Dav.XML_ERROR.reason(e1); } // 実際の処理 @@ -412,14 +412,14 @@ public Response options() { // アクセス制御 this.checkAccessContext(this.getAccessContext(), BoxPrivilege.READ); - return DcCoreUtils.responseBuilderForOptions( + return PersoniumCoreUtils.responseBuilderForOptions( HttpMethod.GET, HttpMethod.PUT, HttpMethod.DELETE, - com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.MKCOL, - com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPFIND, - com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPPATCH, - com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.ACL + io.personium.common.utils.PersoniumCoreUtils.HttpMethod.MKCOL, + io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPFIND, + io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPPATCH, + io.personium.common.utils.PersoniumCoreUtils.HttpMethod.ACL ).build(); } @@ -450,9 +450,9 @@ public void checkAccessContext(final AccessContext ac, Privilege privilege) { if (AccessContext.TYPE_INVALID.equals(ac.getType())) { ac.throwInvalidTokenException(allowedAuthScheme); } else if (AccessContext.TYPE_ANONYMOUS.equals(ac.getType())) { - throw DcCoreAuthzException.AUTHORIZATION_REQUIRED.realm(ac.getRealm(), allowedAuthScheme); + throw PersoniumCoreAuthzException.AUTHORIZATION_REQUIRED.realm(ac.getRealm(), allowedAuthScheme); } - throw DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + throw PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; } } @@ -542,8 +542,8 @@ static final org.apache.wink.webdav.model.Response createDavResponse(final Strin Resourcetype colRt = of.createResourcetype(); colRt.setCollection(of.createCollection()); List listElement = colRt.getAny(); - QName qname = new QName(DcCoreUtils.XmlConst.NS_DC1, DcCoreUtils.XmlConst.ODATA, - DcCoreUtils.XmlConst.NS_PREFIX_DC1); + QName qname = new QName(PersoniumCoreUtils.XmlConst.NS_PERSONIUM, PersoniumCoreUtils.XmlConst.ODATA, + PersoniumCoreUtils.XmlConst.NS_PREFIX_PERSONIUM); Element element = WebDAVModelHelper.createElement(qname); listElement.add(element); ret.setPropertyOk(colRt); @@ -553,8 +553,8 @@ static final org.apache.wink.webdav.model.Response createDavResponse(final Strin Resourcetype colRt = of.createResourcetype(); colRt.setCollection(of.createCollection()); List listElement = colRt.getAny(); - QName qname = new QName(DcCoreUtils.XmlConst.NS_DC1, DcCoreUtils.XmlConst.SERVICE, - DcCoreUtils.XmlConst.NS_PREFIX_DC1); + QName qname = new QName(PersoniumCoreUtils.XmlConst.NS_PERSONIUM, PersoniumCoreUtils.XmlConst.SERVICE, + PersoniumCoreUtils.XmlConst.NS_PREFIX_PERSONIUM); Element element = WebDAVModelHelper.createElement(qname); listElement.add(element); ret.setPropertyOk(colRt); @@ -620,7 +620,7 @@ private static Element parseProp(String value) { ByteArrayInputStream is = new ByteArrayInputStream(value.getBytes(CharEncoding.UTF_8)); doc = builder.parse(is); } catch (Exception e1) { - throw DcCoreException.Dav.DAV_INCONSISTENCY_FOUND.reason(e1); + throw PersoniumCoreException.Dav.DAV_INCONSISTENCY_FOUND.reason(e1); } Element e = doc.getDocumentElement(); return e; diff --git a/src/main/java/com/fujitsu/dc/core/model/ModelFactory.java b/src/main/java/io/personium/core/model/ModelFactory.java similarity index 76% rename from src/main/java/com/fujitsu/dc/core/model/ModelFactory.java rename to src/main/java/io/personium/core/model/ModelFactory.java index 8ec61f222..d2da9a2a0 100644 --- a/src/main/java/com/fujitsu/dc/core/model/ModelFactory.java +++ b/src/main/java/io/personium/core/model/ModelFactory.java @@ -14,19 +14,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model; +package io.personium.core.model; import javax.ws.rs.core.UriInfo; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.model.impl.es.CellEsImpl; -import com.fujitsu.dc.core.model.impl.es.odata.CellCtlODataProducer; -import com.fujitsu.dc.core.model.impl.es.odata.UnitCtlODataProducer; -import com.fujitsu.dc.core.model.impl.es.odata.UserDataODataProducer; -import com.fujitsu.dc.core.model.impl.es.odata.UserSchemaODataProducer; -import com.fujitsu.dc.core.model.impl.fs.BoxCmpFsImpl; -import com.fujitsu.dc.core.model.impl.fs.CellCmpFsImpl; -import com.fujitsu.dc.core.odata.DcODataProducer; +import io.personium.core.auth.AccessContext; +import io.personium.core.model.impl.es.CellEsImpl; +import io.personium.core.model.impl.es.odata.CellCtlODataProducer; +import io.personium.core.model.impl.es.odata.UnitCtlODataProducer; +import io.personium.core.model.impl.es.odata.UserDataODataProducer; +import io.personium.core.model.impl.es.odata.UserSchemaODataProducer; +import io.personium.core.model.impl.fs.BoxCmpFsImpl; +import io.personium.core.model.impl.fs.CellCmpFsImpl; +import io.personium.core.odata.PersoniumODataProducer; /** * モデルオブジェクトのファクトリークラス. @@ -87,7 +87,7 @@ public static class ODataCtl { * @param ac アクセスコンテキスト * @return Unit管理エンティティを扱うODataProducer */ - public static DcODataProducer unitCtl(AccessContext ac) { + public static PersoniumODataProducer unitCtl(AccessContext ac) { return new UnitCtlODataProducer(ac); } @@ -96,7 +96,7 @@ public static DcODataProducer unitCtl(AccessContext ac) { * @param cell CellのCell * @return Cell管理エンティティを扱うODataProducer */ - public static DcODataProducer cellCtl(final Cell cell) { + public static PersoniumODataProducer cellCtl(final Cell cell) { return new CellCtlODataProducer(cell); } @@ -106,7 +106,7 @@ public static DcODataProducer cellCtl(final Cell cell) { * @param davCmp DavCmp * @return ODataProducer */ - public static DcODataProducer userSchema(final Cell cell, final DavCmp davCmp) { + public static PersoniumODataProducer userSchema(final Cell cell, final DavCmp davCmp) { return new UserSchemaODataProducer(cell, davCmp); } @@ -116,7 +116,7 @@ public static DcODataProducer userSchema(final Cell cell, final DavCmp davCmp) { * @param davCmp DavCmp * @return ODataProducer */ - public static DcODataProducer userData(final Cell cell, final DavCmp davCmp) { + public static PersoniumODataProducer userData(final Cell cell, final DavCmp davCmp) { return new UserDataODataProducer(cell, davCmp); } diff --git a/src/main/java/com/fujitsu/dc/core/model/ctl/Account.java b/src/main/java/io/personium/core/model/ctl/Account.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/model/ctl/Account.java rename to src/main/java/io/personium/core/model/ctl/Account.java index 0e5eda97a..e1a7d93e9 100644 --- a/src/main/java/com/fujitsu/dc/core/model/ctl/Account.java +++ b/src/main/java/io/personium/core/model/ctl/Account.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.ctl; +package io.personium.core.model.ctl; import org.core4j.Enumerable; import org.odata4j.edm.EdmEntityType; @@ -62,7 +62,7 @@ private Account() { * Nameプロパティの定義体. */ public static final EdmProperty.Builder P_NAME = EdmProperty.newBuilder("Name").setType(EdmSimpleType.STRING) - .setNullable(false).setAnnotations(Common.DC_FORMAT_NAME_WITH_SIGN); + .setNullable(false).setAnnotations(Common.P_FORMAT_NAME_WITH_SIGN); /** * LastAuthenticatedプロパティの定義体. @@ -74,7 +74,7 @@ private Account() { * Typeプロパティの定義体. */ public static final EdmProperty.Builder P_TYPE = EdmProperty.newBuilder("Type").setType(EdmSimpleType.STRING) - .setDefaultValue(TYPE_VALUE_BASIC).setAnnotations(Common.DC_FORMAT_ACCOUNT_TYPE); + .setDefaultValue(TYPE_VALUE_BASIC).setAnnotations(Common.P_FORMAT_ACCOUNT_TYPE); /** * Cellプロパティの定義体. diff --git a/src/main/java/com/fujitsu/dc/core/model/ctl/AssociationEnd.java b/src/main/java/io/personium/core/model/ctl/AssociationEnd.java similarity index 89% rename from src/main/java/com/fujitsu/dc/core/model/ctl/AssociationEnd.java rename to src/main/java/io/personium/core/model/ctl/AssociationEnd.java index f4092e54c..6fe5201be 100644 --- a/src/main/java/com/fujitsu/dc/core/model/ctl/AssociationEnd.java +++ b/src/main/java/io/personium/core/model/ctl/AssociationEnd.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.ctl; +package io.personium.core.model.ctl; import org.core4j.Enumerable; import org.odata4j.edm.EdmEntityType; @@ -38,7 +38,7 @@ private AssociationEnd() { public static final EdmProperty.Builder P_ASSOCIATION_NAME = EdmProperty.newBuilder("Name") .setType(EdmSimpleType.STRING) .setNullable(false) - .setAnnotations(Common.DC_FORMAT_NAME); + .setAnnotations(Common.P_FORMAT_NAME); /** * Multiplicityプロパティの定義体. @@ -46,7 +46,7 @@ private AssociationEnd() { public static final EdmProperty.Builder P_MULTIPLICITY = EdmProperty.newBuilder("Multiplicity") .setType(EdmSimpleType.STRING) .setNullable(false) - .setAnnotations(Common.DC_FORMAT_MULTIPLICITY); + .setAnnotations(Common.P_FORMAT_MULTIPLICITY); /** * _EntityType/Nameプロパティの定義体. @@ -54,7 +54,7 @@ private AssociationEnd() { public static final EdmProperty.Builder P_ENTITYTYPE_NAME = EdmProperty.newBuilder("_EntityType.Name") .setType(EdmSimpleType.STRING) .setNullable(false) - .setAnnotations(Common.DC_FORMAT_NAME); + .setAnnotations(Common.P_FORMAT_NAME); /** * EntityType Builder. diff --git a/src/main/java/com/fujitsu/dc/core/model/ctl/Common.java b/src/main/java/io/personium/core/model/ctl/Common.java similarity index 54% rename from src/main/java/com/fujitsu/dc/core/model/ctl/Common.java rename to src/main/java/io/personium/core/model/ctl/Common.java index 65ab9a302..bc024f7d0 100644 --- a/src/main/java/com/fujitsu/dc/core/model/ctl/Common.java +++ b/src/main/java/io/personium/core/model/ctl/Common.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.ctl; +package io.personium.core.model.ctl; import java.util.ArrayList; import java.util.List; @@ -25,7 +25,7 @@ import org.odata4j.edm.EdmProperty; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.common.utils.DcCoreUtils; +import io.personium.common.utils.PersoniumCoreUtils; /** * Edm 定義体で共通的に使う定数群を定義. @@ -64,17 +64,17 @@ private Common() { public static final EdmProperty.Builder P_ID = EdmProperty.newBuilder("__id") .setType(EdmSimpleType.STRING).setDefaultValue("UUID()"); /** 拡張スキーマFormat定義. */ - public static final String DC_FORMAT = "Format"; + public static final String P_FORMAT = "Format"; /** 拡張スキーマFormat正規表現定義. */ - public static final String DC_FORMAT_PATTERN_REGEX = "regEx"; + public static final String P_FORMAT_PATTERN_REGEX = "regEx"; /** 拡張スキーマFormat定義. */ - public static final String DC_FORMAT_PATTERN_URI = "uri"; + public static final String P_FORMAT_PATTERN_URI = "uri"; /** 拡張スキーマFormat定義. */ - public static final String DC_FORMAT_PATTERN_SCHEMA_URI = "schema-uri"; + public static final String P_FORMAT_PATTERN_SCHEMA_URI = "schema-uri"; /** 拡張スキーマFormat定義. */ - public static final String DC_FORMAT_PATTERN_CELL_URL = "cell-url"; + public static final String P_FORMAT_PATTERN_CELL_URL = "cell-url"; /** 拡張スキーマFormat定義.1つ以上のスペース区切り英数字. */ - public static final String DC_FORMAT_PATTERN_USUSST = "unordered-set-of-unique-space-separated-tokens"; + public static final String P_FORMAT_PATTERN_USUSST = "unordered-set-of-unique-space-separated-tokens"; /** 先頭が-,_以外で始まる半角英数大小文字,-,_が1文字から128文字. */ public static final String PATTERN_NAME = "^[a-zA-Z0-9][a-zA-Z0-9-_]{0,127}$"; /** 先頭が半角記号以外で始まる半角英数大小文字,半角記号(-_!#$%*+/=^`{|}~.@)が1文字から128文字. */ @@ -110,63 +110,63 @@ private Common() { public static final int MAX_EVENT_VALUE_LENGTH = 1024 * 50; /** - * Name項目に対するdc:Formatの定義. + * Name項目に対するp:Formatの定義. */ - public static final List> DC_FORMAT_NAME = new ArrayList>(); + public static final List> P_FORMAT_NAME = new ArrayList>(); /** - * 半角記号を許容する項目に対するdc:Formatの定義. + * 半角記号を許容する項目に対するp:Formatの定義. */ - public static final List> DC_FORMAT_NAME_WITH_SIGN = new ArrayList>(); + public static final List> P_FORMAT_NAME_WITH_SIGN = new ArrayList>(); /** - * RelationのName項目に対するdc:Formatの定義. + * RelationのName項目に対するp:Formatの定義. */ - public static final List> DC_FORMAT_RELATION_NAME = new ArrayList>(); + public static final List> P_FORMAT_RELATION_NAME = new ArrayList>(); /** - * dc:FormatのURI定義. + * p:FormatのURI定義. */ - public static final List> DC_FORMAT_URI = new ArrayList>(); + public static final List> P_FORMAT_URI = new ArrayList>(); /** - * dc:FormatのSchema URI定義. + * p:FormatのSchema URI定義. */ - public static final List> DC_FORMAT_SCHEMA_URI = new ArrayList>(); + public static final List> P_FORMAT_SCHEMA_URI = new ArrayList>(); /** - * dc:FormatのCell URL定義. + * p:FormatのCell URL定義. */ - public static final List> DC_FORMAT_CELL_URL = new ArrayList>(); + public static final List> P_FORMAT_CELL_URL = new ArrayList>(); /** - * Multiplicity項目に対するdc:Formatの定義. + * Multiplicity項目に対するp:Formatの定義. */ - public static final List> DC_FORMAT_MULTIPLICITY = new ArrayList>(); + public static final List> P_FORMAT_MULTIPLICITY = new ArrayList>(); /** - * ID項目に対するdc:Formatの定義. + * ID項目に対するp:Formatの定義. */ - public static final List> DC_FORMAT_ID = new ArrayList>(); + public static final List> P_FORMAT_ID = new ArrayList>(); /** - * InReplyTo項目に対するdc:Formatの定義. + * InReplyTo項目に対するp:Formatの定義. */ - public static final List> DC_FORMAT_IN_REPLY_TO = new ArrayList>(); + public static final List> P_FORMAT_IN_REPLY_TO = new ArrayList>(); /** - * MessageType項目に対するdc:Formatの定義. + * MessageType項目に対するp:Formatの定義. */ - public static final List> DC_FORMAT_MESSAGE_TYPE = new ArrayList>(); + public static final List> P_FORMAT_MESSAGE_TYPE = new ArrayList>(); /** - * MessageTitle項目に対するdc:Formatの定義. + * MessageTitle項目に対するp:Formatの定義. */ - public static final List> DC_FORMAT_MESSAGE_TITLE = new ArrayList>(); + public static final List> P_FORMAT_MESSAGE_TITLE = new ArrayList>(); /** - * MessagePriority項目に対するdc:Formatの定義. + * MessagePriority項目に対するp:Formatの定義. */ - public static final List> DC_FORMAT_MESSAGE_PRIORITY = new ArrayList>(); + public static final List> P_FORMAT_MESSAGE_PRIORITY = new ArrayList>(); /** - * AccountType項目に対するdc:Formatの定義. + * AccountType項目に対するp:Formatの定義. */ - public static final List> DC_FORMAT_ACCOUNT_TYPE = new ArrayList>(); + public static final List> P_FORMAT_ACCOUNT_TYPE = new ArrayList>(); /** * DC名前空間. */ - public static final PrefixedNamespace DC_NAMESPACE = new PrefixedNamespace(DcCoreUtils.XmlConst.NS_DC1, - DcCoreUtils.XmlConst.NS_PREFIX_DC1); + public static final PrefixedNamespace P_NAMESPACE = new PrefixedNamespace(PersoniumCoreUtils.XmlConst.NS_PERSONIUM, + PersoniumCoreUtils.XmlConst.NS_PREFIX_PERSONIUM); /** * published プロパティの定義体. @@ -180,149 +180,149 @@ private Common() { .setType(EdmSimpleType.DATETIME).setDefaultValue(SYSUTCDATETIME).setPrecision(3); static { - DC_FORMAT_NAME.add(createFormatNameAnnotation()); - DC_FORMAT_NAME_WITH_SIGN.add(createFormatNameWithSignAnnotation()); - DC_FORMAT_URI.add(createFormatUriAnnotation()); - DC_FORMAT_SCHEMA_URI.add(createFormatSchemaUriAnnotation()); - DC_FORMAT_CELL_URL.add(createFormatCellUrlAnnotation()); - DC_FORMAT_MULTIPLICITY.add(createFormatMultiplicityAnnotation()); - DC_FORMAT_ID.add(createFormatIdAnnotation()); - DC_FORMAT_RELATION_NAME.add(createFormatRelationNameAnnotation()); - DC_FORMAT_IN_REPLY_TO.add(createFormatInReplyToAnnotation()); - DC_FORMAT_MESSAGE_TYPE.add(createFormatMessageTypeAnnotation()); - DC_FORMAT_MESSAGE_TITLE.add(createFormatMessageTitleAnnotation()); - DC_FORMAT_MESSAGE_PRIORITY.add(createFormatMessagePriorityAnnotation()); - DC_FORMAT_ACCOUNT_TYPE.add(createFormatAccountTypeAnnotation()); + P_FORMAT_NAME.add(createFormatNameAnnotation()); + P_FORMAT_NAME_WITH_SIGN.add(createFormatNameWithSignAnnotation()); + P_FORMAT_URI.add(createFormatUriAnnotation()); + P_FORMAT_SCHEMA_URI.add(createFormatSchemaUriAnnotation()); + P_FORMAT_CELL_URL.add(createFormatCellUrlAnnotation()); + P_FORMAT_MULTIPLICITY.add(createFormatMultiplicityAnnotation()); + P_FORMAT_ID.add(createFormatIdAnnotation()); + P_FORMAT_RELATION_NAME.add(createFormatRelationNameAnnotation()); + P_FORMAT_IN_REPLY_TO.add(createFormatInReplyToAnnotation()); + P_FORMAT_MESSAGE_TYPE.add(createFormatMessageTypeAnnotation()); + P_FORMAT_MESSAGE_TITLE.add(createFormatMessageTitleAnnotation()); + P_FORMAT_MESSAGE_PRIORITY.add(createFormatMessagePriorityAnnotation()); + P_FORMAT_ACCOUNT_TYPE.add(createFormatAccountTypeAnnotation()); } /** - * Name項目に対するdc:FormatのAnnotationを返却. + * Name項目に対するp:FormatのAnnotationを返却. * @return EdmAnnotation */ public static EdmAnnotation createFormatNameAnnotation() { return new EdmAnnotationAttribute( - DC_NAMESPACE.getUri(), DC_NAMESPACE.getPrefix(), - DC_FORMAT, DC_FORMAT_PATTERN_REGEX + "('" + Common.PATTERN_NAME + "')"); + P_NAMESPACE.getUri(), P_NAMESPACE.getPrefix(), + P_FORMAT, P_FORMAT_PATTERN_REGEX + "('" + Common.PATTERN_NAME + "')"); } /** - * Name項目に対するdc:FormatのAnnotationを返却. + * Name項目に対するp:FormatのAnnotationを返却. * @return EdmAnnotation */ public static EdmAnnotation createFormatNameWithSignAnnotation() { return new EdmAnnotationAttribute( - DC_NAMESPACE.getUri(), DC_NAMESPACE.getPrefix(), - DC_FORMAT, DC_FORMAT_PATTERN_REGEX + "('" + Common.PATTERN_NAME_WITH_SIGN + "')"); + P_NAMESPACE.getUri(), P_NAMESPACE.getPrefix(), + P_FORMAT, P_FORMAT_PATTERN_REGEX + "('" + Common.PATTERN_NAME_WITH_SIGN + "')"); } /** - * RelationのName項目に対するdc:FormatのAnnotationを返却. + * RelationのName項目に対するp:FormatのAnnotationを返却. * @return EdmAnnotation */ public static EdmAnnotation createFormatRelationNameAnnotation() { return new EdmAnnotationAttribute( - DC_NAMESPACE.getUri(), DC_NAMESPACE.getPrefix(), - DC_FORMAT, DC_FORMAT_PATTERN_REGEX + "('" + Common.PATTERN_RELATION_NAME + "')"); + P_NAMESPACE.getUri(), P_NAMESPACE.getPrefix(), + P_FORMAT, P_FORMAT_PATTERN_REGEX + "('" + Common.PATTERN_RELATION_NAME + "')"); } /** - * dc:FormatのURIのAnnotationを返却. + * p:FormatのURIのAnnotationを返却. * @return EdmAnnotation */ public static EdmAnnotation createFormatUriAnnotation() { return new EdmAnnotationAttribute( - DC_NAMESPACE.getUri(), DC_NAMESPACE.getPrefix(), - DC_FORMAT, DC_FORMAT_PATTERN_URI); + P_NAMESPACE.getUri(), P_NAMESPACE.getPrefix(), + P_FORMAT, P_FORMAT_PATTERN_URI); } /** - * dc:FormatのSchema URIのAnnotationを返却. + * p:FormatのSchema URIのAnnotationを返却. * @return EdmAnnotation */ public static EdmAnnotation createFormatSchemaUriAnnotation() { return new EdmAnnotationAttribute( - DC_NAMESPACE.getUri(), DC_NAMESPACE.getPrefix(), - DC_FORMAT, DC_FORMAT_PATTERN_SCHEMA_URI); + P_NAMESPACE.getUri(), P_NAMESPACE.getPrefix(), + P_FORMAT, P_FORMAT_PATTERN_SCHEMA_URI); } /** - * dc:FormatのCell URLのAnnotationを返却. + * p:FormatのCell URLのAnnotationを返却. * @return EdmAnnotation */ public static EdmAnnotation createFormatCellUrlAnnotation() { return new EdmAnnotationAttribute( - DC_NAMESPACE.getUri(), DC_NAMESPACE.getPrefix(), - DC_FORMAT, DC_FORMAT_PATTERN_CELL_URL); + P_NAMESPACE.getUri(), P_NAMESPACE.getPrefix(), + P_FORMAT, P_FORMAT_PATTERN_CELL_URL); } /** - * dc:FormatのMultiplicityのAnnotationを返却. + * p:FormatのMultiplicityのAnnotationを返却. * @return EdmAnnotation */ public static EdmAnnotation createFormatMultiplicityAnnotation() { return new EdmAnnotationAttribute( - DC_NAMESPACE.getUri(), DC_NAMESPACE.getPrefix(), - DC_FORMAT, DC_FORMAT_PATTERN_REGEX + "('" + Common.PATTERN_MULTIPLICITY + "')"); + P_NAMESPACE.getUri(), P_NAMESPACE.getPrefix(), + P_FORMAT, P_FORMAT_PATTERN_REGEX + "('" + Common.PATTERN_MULTIPLICITY + "')"); } /** - * ID項目に対するdc:FormatのAnnotationを返却. + * ID項目に対するp:FormatのAnnotationを返却. * @return EdmAnnotation */ public static EdmAnnotation createFormatIdAnnotation() { return new EdmAnnotationAttribute( - DC_NAMESPACE.getUri(), DC_NAMESPACE.getPrefix(), - DC_FORMAT, DC_FORMAT_PATTERN_REGEX + "('" + Common.PATTERN_ID + "')"); + P_NAMESPACE.getUri(), P_NAMESPACE.getPrefix(), + P_FORMAT, P_FORMAT_PATTERN_REGEX + "('" + Common.PATTERN_ID + "')"); } /** - * InReplyTo項目に対するdc:FormatのAnnotationを返却. + * InReplyTo項目に対するp:FormatのAnnotationを返却. * @return EdmAnnotation */ public static EdmAnnotation createFormatInReplyToAnnotation() { return new EdmAnnotationAttribute( - DC_NAMESPACE.getUri(), DC_NAMESPACE.getPrefix(), - DC_FORMAT, DC_FORMAT_PATTERN_REGEX + "('" + Common.PATTERN_IN_REPLY_TO + "')"); + P_NAMESPACE.getUri(), P_NAMESPACE.getPrefix(), + P_FORMAT, P_FORMAT_PATTERN_REGEX + "('" + Common.PATTERN_IN_REPLY_TO + "')"); } /** - * MessageType項目に対するdc:FormatのAnnotationを返却. + * MessageType項目に対するp:FormatのAnnotationを返却. * @return EdmAnnotation */ public static EdmAnnotation createFormatMessageTypeAnnotation() { return new EdmAnnotationAttribute( - DC_NAMESPACE.getUri(), DC_NAMESPACE.getPrefix(), - DC_FORMAT, DC_FORMAT_PATTERN_REGEX + "('" + Common.PATTERN_MESSAGE_TYPE + "')"); + P_NAMESPACE.getUri(), P_NAMESPACE.getPrefix(), + P_FORMAT, P_FORMAT_PATTERN_REGEX + "('" + Common.PATTERN_MESSAGE_TYPE + "')"); } /** - * MessageTitle項目に対するdc:FormatのAnnotationを返却. + * MessageTitle項目に対するp:FormatのAnnotationを返却. * @return EdmAnnotation */ public static EdmAnnotation createFormatMessageTitleAnnotation() { return new EdmAnnotationAttribute( - DC_NAMESPACE.getUri(), DC_NAMESPACE.getPrefix(), - DC_FORMAT, DC_FORMAT_PATTERN_REGEX + "('" + Common.PATTERN_MESSAGE_TITLE + "')"); + P_NAMESPACE.getUri(), P_NAMESPACE.getPrefix(), + P_FORMAT, P_FORMAT_PATTERN_REGEX + "('" + Common.PATTERN_MESSAGE_TITLE + "')"); } /** - * Message Priority 項目に対するdc:FormatのAnnotationを返却. + * Message Priority 項目に対するp:FormatのAnnotationを返却. * @return EdmAnnotation */ public static EdmAnnotation createFormatMessagePriorityAnnotation() { return new EdmAnnotationAttribute( - DC_NAMESPACE.getUri(), DC_NAMESPACE.getPrefix(), - DC_FORMAT, DC_FORMAT_PATTERN_REGEX + "('" + Common.PATTERN_MESSAGE_PRIORITY + "')"); + P_NAMESPACE.getUri(), P_NAMESPACE.getPrefix(), + P_FORMAT, P_FORMAT_PATTERN_REGEX + "('" + Common.PATTERN_MESSAGE_PRIORITY + "')"); } /** - * Account Type 項目に対するdc:FormatのAnnotationを返却. + * Account Type 項目に対するp:FormatのAnnotationを返却. * @return EdmAnnotation */ public static EdmAnnotation createFormatAccountTypeAnnotation() { return new EdmAnnotationAttribute( - DC_NAMESPACE.getUri(), DC_NAMESPACE.getPrefix(), - DC_FORMAT, DC_FORMAT_PATTERN_USUSST + "('" + Account.TYPE_VALUE_BASIC + "', '" + P_NAMESPACE.getUri(), P_NAMESPACE.getPrefix(), + P_FORMAT, P_FORMAT_PATTERN_USUSST + "('" + Account.TYPE_VALUE_BASIC + "', '" + Account.TYPE_VALUE_OIDC_GOOGLE + "')"); } } diff --git a/src/main/java/com/fujitsu/dc/core/model/ctl/ComplexType.java b/src/main/java/io/personium/core/model/ctl/ComplexType.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/model/ctl/ComplexType.java rename to src/main/java/io/personium/core/model/ctl/ComplexType.java index d28918482..35f95009b 100644 --- a/src/main/java/com/fujitsu/dc/core/model/ctl/ComplexType.java +++ b/src/main/java/io/personium/core/model/ctl/ComplexType.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.ctl; +package io.personium.core.model.ctl; import org.core4j.Enumerable; import org.odata4j.edm.EdmEntityType; @@ -38,7 +38,7 @@ private ComplexType() { public static final EdmProperty.Builder P_COMPLEXTYPE_NAME = EdmProperty.newBuilder("Name") .setType(EdmSimpleType.STRING) .setNullable(false) - .setAnnotations(Common.DC_FORMAT_NAME); + .setAnnotations(Common.P_FORMAT_NAME); /** * EntityType Builder. diff --git a/src/main/java/com/fujitsu/dc/core/model/ctl/ComplexTypeProperty.java b/src/main/java/io/personium/core/model/ctl/ComplexTypeProperty.java similarity index 93% rename from src/main/java/com/fujitsu/dc/core/model/ctl/ComplexTypeProperty.java rename to src/main/java/io/personium/core/model/ctl/ComplexTypeProperty.java index eb42cd42b..120f36bd1 100644 --- a/src/main/java/com/fujitsu/dc/core/model/ctl/ComplexTypeProperty.java +++ b/src/main/java/io/personium/core/model/ctl/ComplexTypeProperty.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.ctl; +package io.personium.core.model.ctl; import org.core4j.Enumerable; import org.odata4j.edm.EdmEntityType; @@ -42,14 +42,14 @@ private ComplexTypeProperty() { */ public static final EdmProperty.Builder P_NAME = EdmProperty.newBuilder("Name").setType(EdmSimpleType.STRING) .setNullable(false) - .setAnnotations(Common.DC_FORMAT_NAME); + .setAnnotations(Common.P_FORMAT_NAME); /** * _ComplexType/Nameプロパティの定義体. */ public static final EdmProperty.Builder P_COMPLEXTYPE_NAME = EdmProperty.newBuilder("_ComplexType.Name") .setNullable(false) .setType(EdmSimpleType.STRING) - .setAnnotations(Common.DC_FORMAT_NAME); + .setAnnotations(Common.P_FORMAT_NAME); /** * Typeプロパティの定義体. */ diff --git a/src/main/java/com/fujitsu/dc/core/model/ctl/CtlSchema.java b/src/main/java/io/personium/core/model/ctl/CtlSchema.java similarity index 95% rename from src/main/java/com/fujitsu/dc/core/model/ctl/CtlSchema.java rename to src/main/java/io/personium/core/model/ctl/CtlSchema.java index 8c88f8067..f5bd84df0 100644 --- a/src/main/java/com/fujitsu/dc/core/model/ctl/CtlSchema.java +++ b/src/main/java/io/personium/core/model/ctl/CtlSchema.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.ctl; +package io.personium.core.model.ctl; import java.util.ArrayList; import java.util.HashMap; @@ -45,9 +45,9 @@ import org.odata4j.edm.EdmType; import org.odata4j.producer.edm.Edm; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.odata.OEntityWrapper; +import io.personium.core.model.Box; +import io.personium.core.model.Cell; +import io.personium.core.odata.OEntityWrapper; /** * 制御エンティティ群のスキーマ情報. @@ -71,14 +71,14 @@ private CtlSchema() { } /** - * 複合Uniqueキー制約(DcによるCSDL拡張)のためのCSDL拡張アノテーションを作成して返します. + * 複合Uniqueキー制約(PersoniumによるCSDL拡張)のためのCSDL拡張アノテーションを作成して返します. * @param name UK名 * @return Annotationのリスト */ public static List> createNamedUkAnnotation(final String name) { List> ret = new ArrayList>(); - ret.add(new EdmAnnotationAttribute(Common.DC_NAMESPACE.getUri(), - Common.DC_NAMESPACE.getPrefix(), + ret.add(new EdmAnnotationAttribute(Common.P_NAMESPACE.getUri(), + Common.P_NAMESPACE.getPrefix(), "Unique", name)); return ret; } @@ -90,8 +90,8 @@ public static List> createNamedUkAnnotation(final String name) */ public static List> createIsDecleardAnnotation(final String name) { List> ret = new ArrayList>(); - ret.add(new EdmAnnotationAttribute(Common.DC_NAMESPACE.getUri(), - Common.DC_NAMESPACE.getPrefix(), + ret.add(new EdmAnnotationAttribute(Common.P_NAMESPACE.getUri(), + Common.P_NAMESPACE.getPrefix(), "IsDeclared", name)); return ret; } @@ -103,8 +103,8 @@ public static List> createIsDecleardAnnotation(final String nam */ public static List> createFormatAnnotation(final String name) { List> ret = new ArrayList>(); - ret.add(new EdmAnnotationAttribute(Common.DC_NAMESPACE.getUri(), - Common.DC_NAMESPACE.getPrefix(), + ret.add(new EdmAnnotationAttribute(Common.P_NAMESPACE.getUri(), + Common.P_NAMESPACE.getPrefix(), "Format", name)); return ret; } @@ -256,7 +256,7 @@ public static EdmDataServices.Builder getEdmDataServicesForMessage() { public static final EdmProperty.Builder P_ID = EdmProperty.newBuilder("__id") .setType(EdmSimpleType.STRING).setDefaultValue("UUID()") .setNullable(false) - .setAnnotations(Common.DC_FORMAT_ID); + .setAnnotations(Common.P_FORMAT_ID); /** * UserCtlデータサービスのEdmDataServices オブジェクトを返します. @@ -436,7 +436,7 @@ private static EdmDataServices.Builder createDataServices(final String edmNs, } EdmDataServices.Builder ret = EdmDataServices.newBuilder() - .addNamespaces(Enumerable.create(Common.DC_NAMESPACE).toList()) + .addNamespaces(Enumerable.create(Common.P_NAMESPACE).toList()) .addSchemas(schema).setVersion(ODataVersion.V2); return ret; } diff --git a/src/main/java/com/fujitsu/dc/core/model/ctl/EntityType.java b/src/main/java/io/personium/core/model/ctl/EntityType.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/model/ctl/EntityType.java rename to src/main/java/io/personium/core/model/ctl/EntityType.java index 0f9af0ada..828023a14 100644 --- a/src/main/java/com/fujitsu/dc/core/model/ctl/EntityType.java +++ b/src/main/java/io/personium/core/model/ctl/EntityType.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.ctl; +package io.personium.core.model.ctl; import org.core4j.Enumerable; import org.odata4j.edm.EdmEntityType; @@ -39,7 +39,7 @@ private EntityType() { public static final EdmProperty.Builder P_ENTITYTYPE_NAME = EdmProperty.newBuilder("Name") .setType(EdmSimpleType.STRING) .setNullable(false) - .setAnnotations(Common.DC_FORMAT_NAME); + .setAnnotations(Common.P_FORMAT_NAME); /** * EntityType Builder. diff --git a/src/main/java/com/fujitsu/dc/core/model/ctl/Event.java b/src/main/java/io/personium/core/model/ctl/Event.java similarity index 94% rename from src/main/java/com/fujitsu/dc/core/model/ctl/Event.java rename to src/main/java/io/personium/core/model/ctl/Event.java index 49ca294e7..f761b6fb5 100644 --- a/src/main/java/com/fujitsu/dc/core/model/ctl/Event.java +++ b/src/main/java/io/personium/core/model/ctl/Event.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.ctl; +package io.personium.core.model.ctl; import org.json.simple.JSONObject; diff --git a/src/main/java/com/fujitsu/dc/core/model/ctl/ExtCell.java b/src/main/java/io/personium/core/model/ctl/ExtCell.java similarity index 91% rename from src/main/java/com/fujitsu/dc/core/model/ctl/ExtCell.java rename to src/main/java/io/personium/core/model/ctl/ExtCell.java index 12be852f9..e65fabd8e 100644 --- a/src/main/java/com/fujitsu/dc/core/model/ctl/ExtCell.java +++ b/src/main/java/io/personium/core/model/ctl/ExtCell.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.ctl; +package io.personium.core.model.ctl; import org.core4j.Enumerable; import org.odata4j.edm.EdmEntityType; @@ -39,7 +39,7 @@ private ExtCell() { public static final EdmProperty.Builder P_URL = EdmProperty .newBuilder("Url") .setNullable(false) - .setAnnotations(Common.DC_FORMAT_CELL_URL) + .setAnnotations(Common.P_FORMAT_CELL_URL) .setType(EdmSimpleType.STRING); /** diff --git a/src/main/java/com/fujitsu/dc/core/model/ctl/ExtRole.java b/src/main/java/io/personium/core/model/ctl/ExtRole.java similarity index 89% rename from src/main/java/com/fujitsu/dc/core/model/ctl/ExtRole.java rename to src/main/java/io/personium/core/model/ctl/ExtRole.java index 08d35c3b7..1ee85736d 100644 --- a/src/main/java/com/fujitsu/dc/core/model/ctl/ExtRole.java +++ b/src/main/java/io/personium/core/model/ctl/ExtRole.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.ctl; +package io.personium.core.model.ctl; import org.core4j.Enumerable; import org.odata4j.edm.EdmEntityType; @@ -35,21 +35,21 @@ private ExtRole() { * ExtRole プロパティの定義体. */ public static final EdmProperty.Builder P_EXT_ROLE = EdmProperty.newBuilder("ExtRole") - .setAnnotations(Common.DC_FORMAT_URI) + .setAnnotations(Common.P_FORMAT_URI) .setType(EdmSimpleType.STRING).setNullable(false); /** * _Relation.Name プロパティの定義体. */ public static final EdmProperty.Builder P_RELATION_NAME = EdmProperty.newBuilder("_Relation.Name") .setType(EdmSimpleType.STRING) - .setAnnotations(Common.DC_FORMAT_RELATION_NAME) + .setAnnotations(Common.P_FORMAT_RELATION_NAME) .setNullable(false); /** * _Relation._Box.Name プロパティの定義体. */ public static final EdmProperty.Builder P_RELATION_BOX_NAME = EdmProperty.newBuilder("_Relation._Box.Name") .setType(EdmSimpleType.STRING) - .setAnnotations(Common.DC_FORMAT_NAME) + .setAnnotations(Common.P_FORMAT_NAME) .setNullable(true); /** * EntityType Builder. diff --git a/src/main/java/com/fujitsu/dc/core/model/ctl/Property.java b/src/main/java/io/personium/core/model/ctl/Property.java similarity index 93% rename from src/main/java/com/fujitsu/dc/core/model/ctl/Property.java rename to src/main/java/io/personium/core/model/ctl/Property.java index 084d19ae0..747237a4a 100644 --- a/src/main/java/com/fujitsu/dc/core/model/ctl/Property.java +++ b/src/main/java/io/personium/core/model/ctl/Property.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.ctl; +package io.personium.core.model.ctl; import org.core4j.Enumerable; import org.odata4j.edm.EdmEntityType; @@ -43,14 +43,14 @@ private Property() { */ public static final EdmProperty.Builder P_NAME = EdmProperty.newBuilder("Name").setType(EdmSimpleType.STRING) .setNullable(false) - .setAnnotations(Common.DC_FORMAT_NAME); + .setAnnotations(Common.P_FORMAT_NAME); /** * _EntityType/Nameプロパティの定義体. */ public static final EdmProperty.Builder P_ENTITYTYPE_NAME = EdmProperty.newBuilder("_EntityType.Name") .setType(EdmSimpleType.STRING) .setNullable(false) - .setAnnotations(Common.DC_FORMAT_NAME); + .setAnnotations(Common.P_FORMAT_NAME); /** * Typeプロパティの定義体. */ @@ -90,7 +90,7 @@ private Property() { public static final EdmProperty.Builder P_UNIQUE_KEY = EdmProperty.newBuilder("UniqueKey") .setNullable(true) .setType(EdmSimpleType.STRING) - .setAnnotations(Common.DC_FORMAT_NAME); + .setAnnotations(Common.P_FORMAT_NAME); /** * IsDeclaredプロパティの定義体. */ diff --git a/src/main/java/com/fujitsu/dc/core/model/ctl/ReceivedMessage.java b/src/main/java/io/personium/core/model/ctl/ReceivedMessage.java similarity index 88% rename from src/main/java/com/fujitsu/dc/core/model/ctl/ReceivedMessage.java rename to src/main/java/io/personium/core/model/ctl/ReceivedMessage.java index 33d683cad..48dcd951a 100644 --- a/src/main/java/com/fujitsu/dc/core/model/ctl/ReceivedMessage.java +++ b/src/main/java/io/personium/core/model/ctl/ReceivedMessage.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.ctl; +package io.personium.core.model.ctl; import org.core4j.Enumerable; import org.odata4j.edm.EdmEntityType; @@ -68,28 +68,28 @@ protected ReceivedMessage() { public static final EdmProperty.Builder P_ID = EdmProperty.newBuilder("__id") .setType(EdmSimpleType.STRING) .setNullable(false) - .setAnnotations(Common.DC_FORMAT_IN_REPLY_TO); + .setAnnotations(Common.P_FORMAT_IN_REPLY_TO); /** * _Box.Nameプロパティの定義体. */ public static final EdmProperty.Builder P_BOX_NAME = EdmProperty.newBuilder("_Box.Name") .setType(EdmSimpleType.STRING) .setNullable(true) - .setAnnotations(Common.DC_FORMAT_NAME); + .setAnnotations(Common.P_FORMAT_NAME); /** * InReplyToプロパティの定義体. */ public static final EdmProperty.Builder P_IN_REPLY_TO = EdmProperty.newBuilder("InReplyTo") .setType(EdmSimpleType.STRING) .setNullable(true) - .setAnnotations(Common.DC_FORMAT_IN_REPLY_TO); + .setAnnotations(Common.P_FORMAT_IN_REPLY_TO); /** * Fromプロパティの定義体. */ public static final EdmProperty.Builder P_FROM = EdmProperty.newBuilder("From") .setType(EdmSimpleType.STRING) .setNullable(false) - .setAnnotations(Common.DC_FORMAT_URI); + .setAnnotations(Common.P_FORMAT_URI); /** * MulticastToプロパティの定義体. */ @@ -102,14 +102,14 @@ protected ReceivedMessage() { public static final EdmProperty.Builder P_TYPE = EdmProperty.newBuilder("Type") .setType(EdmSimpleType.STRING) .setNullable(false) - .setAnnotations(Common.DC_FORMAT_MESSAGE_TYPE); + .setAnnotations(Common.P_FORMAT_MESSAGE_TYPE); /** * Titleプロパティの定義体. */ public static final EdmProperty.Builder P_TITLE = EdmProperty.newBuilder("Title") .setType(EdmSimpleType.STRING) .setNullable(false) - .setAnnotations(Common.DC_FORMAT_MESSAGE_TITLE); + .setAnnotations(Common.P_FORMAT_MESSAGE_TITLE); /** * Bodyプロパティの定義体. */ @@ -122,7 +122,7 @@ protected ReceivedMessage() { public static final EdmProperty.Builder P_PRIORITY = EdmProperty.newBuilder("Priority") .setType(EdmSimpleType.INT32) .setNullable(false) - .setAnnotations(Common.DC_FORMAT_MESSAGE_PRIORITY); + .setAnnotations(Common.P_FORMAT_MESSAGE_PRIORITY); /** * Statusプロパティの定義体. */ @@ -135,14 +135,14 @@ protected ReceivedMessage() { public static final EdmProperty.Builder P_REQUEST_RELATION = EdmProperty.newBuilder("RequestRelation") .setType(EdmSimpleType.STRING) .setNullable(true) - .setAnnotations(Common.DC_FORMAT_URI); + .setAnnotations(Common.P_FORMAT_URI); /** * RequestRelationTargetプロパティの定義体. */ public static final EdmProperty.Builder P_REQUEST_RELATION_TARGET = EdmProperty.newBuilder("RequestRelationTarget") .setType(EdmSimpleType.STRING) .setNullable(true) - .setAnnotations(Common.DC_FORMAT_URI); + .setAnnotations(Common.P_FORMAT_URI); /** * EntityType Builder. diff --git a/src/main/java/com/fujitsu/dc/core/model/ctl/ReceivedMessagePort.java b/src/main/java/io/personium/core/model/ctl/ReceivedMessagePort.java similarity index 95% rename from src/main/java/com/fujitsu/dc/core/model/ctl/ReceivedMessagePort.java rename to src/main/java/io/personium/core/model/ctl/ReceivedMessagePort.java index 4b34e603a..7829532c0 100644 --- a/src/main/java/com/fujitsu/dc/core/model/ctl/ReceivedMessagePort.java +++ b/src/main/java/io/personium/core/model/ctl/ReceivedMessagePort.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.ctl; +package io.personium.core.model.ctl; import org.core4j.Enumerable; import org.odata4j.edm.EdmEntityType; diff --git a/src/main/java/com/fujitsu/dc/core/model/ctl/Relation.java b/src/main/java/io/personium/core/model/ctl/Relation.java similarity index 87% rename from src/main/java/com/fujitsu/dc/core/model/ctl/Relation.java rename to src/main/java/io/personium/core/model/ctl/Relation.java index ef885798e..1e784a570 100644 --- a/src/main/java/com/fujitsu/dc/core/model/ctl/Relation.java +++ b/src/main/java/io/personium/core/model/ctl/Relation.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.ctl; +package io.personium.core.model.ctl; import org.core4j.Enumerable; import org.odata4j.edm.EdmEntityType; @@ -38,14 +38,14 @@ private Relation() { */ public static final EdmProperty.Builder P_ROLE_NAME = EdmProperty.newBuilder("Name") .setType(EdmSimpleType.STRING) - .setNullable(false).setAnnotations(Common.DC_FORMAT_RELATION_NAME); + .setNullable(false).setAnnotations(Common.P_FORMAT_RELATION_NAME); /** * EntityType Builder. */ public static final EdmEntityType.Builder EDM_TYPE_BUILDER = EdmEntityType.newBuilder() .setNamespace(Common.EDM_NS_CELL_CTL).setName(EDM_TYPE_NAME) - .addProperties(Enumerable.create(P_ROLE_NAME, Common.P_BOX_NAME.setAnnotations(Common.DC_FORMAT_NAME), + .addProperties(Enumerable.create(P_ROLE_NAME, Common.P_BOX_NAME.setAnnotations(Common.P_FORMAT_NAME), Common.P_PUBLISHED, Common.P_UPDATED).toList()) .addKeys(P_ROLE_NAME.getName(), Common.P_BOX_NAME.getName()); diff --git a/src/main/java/com/fujitsu/dc/core/model/ctl/Role.java b/src/main/java/io/personium/core/model/ctl/Role.java similarity index 88% rename from src/main/java/com/fujitsu/dc/core/model/ctl/Role.java rename to src/main/java/io/personium/core/model/ctl/Role.java index 17a613c38..eda2878fd 100644 --- a/src/main/java/com/fujitsu/dc/core/model/ctl/Role.java +++ b/src/main/java/io/personium/core/model/ctl/Role.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.ctl; +package io.personium.core.model.ctl; import org.core4j.Enumerable; import org.odata4j.edm.EdmEntityType; @@ -37,14 +37,14 @@ private Role() { * Nameプロパティの定義体. */ public static final EdmProperty.Builder P_NAME = EdmProperty.newBuilder("Name").setType(EdmSimpleType.STRING) - .setNullable(false).setAnnotations(Common.DC_FORMAT_NAME); + .setNullable(false).setAnnotations(Common.P_FORMAT_NAME); /** * EntityType Builder. */ public static final EdmEntityType.Builder EDM_TYPE_BUILDER = EdmEntityType.newBuilder() .setNamespace(Common.EDM_NS_CELL_CTL).setName(EDM_TYPE_NAME) - .addProperties(Enumerable.create(P_NAME, Common.P_BOX_NAME.setAnnotations(Common.DC_FORMAT_NAME), + .addProperties(Enumerable.create(P_NAME, Common.P_BOX_NAME.setAnnotations(Common.P_FORMAT_NAME), Common.P_PUBLISHED, Common.P_UPDATED).toList()) .addKeys(P_NAME.getName(), Common.P_BOX_NAME.getName()); } diff --git a/src/main/java/com/fujitsu/dc/core/model/ctl/SentMessage.java b/src/main/java/io/personium/core/model/ctl/SentMessage.java similarity index 89% rename from src/main/java/com/fujitsu/dc/core/model/ctl/SentMessage.java rename to src/main/java/io/personium/core/model/ctl/SentMessage.java index 29d4af50e..b29b5e9e3 100644 --- a/src/main/java/com/fujitsu/dc/core/model/ctl/SentMessage.java +++ b/src/main/java/io/personium/core/model/ctl/SentMessage.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.ctl; +package io.personium.core.model.ctl; import org.core4j.Enumerable; import org.odata4j.edm.EdmComplexType; @@ -49,7 +49,7 @@ protected SentMessage() { public static final EdmProperty.Builder P_IN_REPLY_TO = EdmProperty.newBuilder("InReplyTo") .setType(EdmSimpleType.STRING) .setNullable(true) - .setAnnotations(Common.DC_FORMAT_IN_REPLY_TO); + .setAnnotations(Common.P_FORMAT_IN_REPLY_TO); /** * Toプロパティの定義体. */ @@ -62,7 +62,7 @@ protected SentMessage() { public static final EdmProperty.Builder P_TO_RELATION = EdmProperty.newBuilder("ToRelation") .setType(EdmSimpleType.STRING) .setNullable(true) - .setAnnotations(Common.DC_FORMAT_RELATION_NAME); + .setAnnotations(Common.P_FORMAT_RELATION_NAME); /** * Typeプロパティの定義体. */ @@ -70,7 +70,7 @@ protected SentMessage() { .setType(EdmSimpleType.STRING) .setNullable(true) .setDefaultValue(ReceivedMessage.TYPE_MESSAGE) - .setAnnotations(Common.DC_FORMAT_MESSAGE_TYPE); + .setAnnotations(Common.P_FORMAT_MESSAGE_TYPE); /** * Titleプロパティの定義体. */ @@ -78,7 +78,7 @@ protected SentMessage() { .setType(EdmSimpleType.STRING) .setNullable(true) .setDefaultValue("") - .setAnnotations(Common.DC_FORMAT_MESSAGE_TITLE); + .setAnnotations(Common.P_FORMAT_MESSAGE_TITLE); /** * Bodyプロパティの定義体. */ @@ -93,21 +93,21 @@ protected SentMessage() { .setType(EdmSimpleType.INT32) .setNullable(true) .setDefaultValue("3") - .setAnnotations(Common.DC_FORMAT_MESSAGE_PRIORITY); + .setAnnotations(Common.P_FORMAT_MESSAGE_PRIORITY); /** * RequestRelationプロパティの定義体. */ public static final EdmProperty.Builder P_REQUEST_RELATION = EdmProperty.newBuilder("RequestRelation") .setType(EdmSimpleType.STRING) .setNullable(true) - .setAnnotations(Common.DC_FORMAT_URI); + .setAnnotations(Common.P_FORMAT_URI); /** * RequestRelationTargetプロパティの定義体. */ public static final EdmProperty.Builder P_REQUEST_RELATION_TARGET = EdmProperty.newBuilder("RequestRelationTarget") .setType(EdmSimpleType.STRING) .setNullable(true) - .setAnnotations(Common.DC_FORMAT_URI); + .setAnnotations(Common.P_FORMAT_URI); /** * Result/Toプロパティの定義体. @@ -115,7 +115,7 @@ protected SentMessage() { public static final EdmProperty.Builder P_RESULT_TO = EdmProperty.newBuilder("To") .setType(EdmSimpleType.STRING) .setNullable(true) - .setAnnotations(Common.DC_FORMAT_URI); + .setAnnotations(Common.P_FORMAT_URI); /** * Result/Codeプロパティの定義体. */ diff --git a/src/main/java/com/fujitsu/dc/core/model/ctl/SentMessagePort.java b/src/main/java/io/personium/core/model/ctl/SentMessagePort.java similarity index 95% rename from src/main/java/com/fujitsu/dc/core/model/ctl/SentMessagePort.java rename to src/main/java/io/personium/core/model/ctl/SentMessagePort.java index dd6887da7..c9f6be3b0 100644 --- a/src/main/java/com/fujitsu/dc/core/model/ctl/SentMessagePort.java +++ b/src/main/java/io/personium/core/model/ctl/SentMessagePort.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.ctl; +package io.personium.core.model.ctl; import org.core4j.Enumerable; import org.odata4j.edm.EdmEntityType; diff --git a/src/main/java/com/fujitsu/dc/core/model/ctl/package-info.java b/src/main/java/io/personium/core/model/ctl/package-info.java similarity index 91% rename from src/main/java/com/fujitsu/dc/core/model/ctl/package-info.java rename to src/main/java/io/personium/core/model/ctl/package-info.java index 0e2bb5a36..4ef8595e1 100644 --- a/src/main/java/com/fujitsu/dc/core/model/ctl/package-info.java +++ b/src/main/java/io/personium/core/model/ctl/package-info.java @@ -17,5 +17,5 @@ /** * Model classes of OData information used in Cell-level APIs. */ -package com.fujitsu.dc.core.model.ctl; +package io.personium.core.model.ctl; diff --git a/src/main/java/com/fujitsu/dc/core/model/file/StreamingOutputForDavFile.java b/src/main/java/io/personium/core/model/file/StreamingOutputForDavFile.java similarity index 91% rename from src/main/java/com/fujitsu/dc/core/model/file/StreamingOutputForDavFile.java rename to src/main/java/io/personium/core/model/file/StreamingOutputForDavFile.java index 09420e339..4f085a630 100644 --- a/src/main/java/com/fujitsu/dc/core/model/file/StreamingOutputForDavFile.java +++ b/src/main/java/io/personium/core/model/file/StreamingOutputForDavFile.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.file; +package io.personium.core.model.file; import java.io.BufferedInputStream; import java.io.FileInputStream; @@ -32,7 +32,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.core.DcCoreConfig; +import io.personium.core.PersoniumUnitConfig; /** * Davファイルの内容を Responseに返却する際に利用する StreamingOutputクラス. 内部的には、読み込み専用にハードリンクを作成し、出力完了後に削除する。 @@ -44,12 +44,12 @@ public class StreamingOutputForDavFile implements StreamingOutput { /** * Davファイルの読み書き時、ハードリンク作成/ファイル名改変時の最大リトライ回数. */ - private static int maxRetryCount = DcCoreConfig.getDavFileOperationRetryCount(); + private static int maxRetryCount = PersoniumUnitConfig.getDavFileOperationRetryCount(); /** * Davファイルの読み書き時、ハードリンク作成/ファイル名改変時のリトライ間隔(msec). */ - private static long retryInterval = DcCoreConfig.getDavFileOperationRetryInterval(); + private static long retryInterval = PersoniumUnitConfig.getDavFileOperationRetryInterval(); /** * 読み込み用のハードリンクのパス. diff --git a/src/main/java/com/fujitsu/dc/core/model/file/StreamingOutputForDavFileWithRange.java b/src/main/java/io/personium/core/model/file/StreamingOutputForDavFileWithRange.java similarity index 83% rename from src/main/java/com/fujitsu/dc/core/model/file/StreamingOutputForDavFileWithRange.java rename to src/main/java/io/personium/core/model/file/StreamingOutputForDavFileWithRange.java index 6d6759157..129d49332 100644 --- a/src/main/java/com/fujitsu/dc/core/model/file/StreamingOutputForDavFileWithRange.java +++ b/src/main/java/io/personium/core/model/file/StreamingOutputForDavFileWithRange.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.file; +package io.personium.core.model.file; import java.io.IOException; import java.io.OutputStream; @@ -25,10 +25,10 @@ import org.apache.commons.io.IOUtils; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.DcCoreLog; -import com.fujitsu.dc.core.http.header.ByteRangeSpec; -import com.fujitsu.dc.core.http.header.RangeHeaderHandler; +import io.personium.core.PersoniumCoreException; +import io.personium.core.PersoniumCoreLog; +import io.personium.core.http.header.ByteRangeSpec; +import io.personium.core.http.header.RangeHeaderHandler; /** * Davファイルの内容を Responseに返却する際に利用する StreamingOutputクラス. 内部的には、読み込み専用にハードリンクを作成し、出力完了後に削除する。 @@ -66,17 +66,17 @@ public void write(OutputStream output) throws IOException, WebApplicationExcepti long last = brs.getLastBytePos(); // Rangeの先頭まで読み飛ばし if (hardLinkInput.skip(first) != first) { - DcCoreLog.Dav.FILE_TOO_SHORT + PersoniumCoreLog.Dav.FILE_TOO_SHORT .params("skip failed", fileSize, range.getRangeHeaderField()).writeLog(); - throw DcCoreException.Dav.FS_INCONSISTENCY_FOUND; + throw PersoniumCoreException.Dav.FS_INCONSISTENCY_FOUND; } // Rangeの終端まで返却 for (long pos = first; pos < last + 1; pos++) { chr = hardLinkInput.read(); if (chr == -1) { - DcCoreLog.Dav.FILE_TOO_SHORT + PersoniumCoreLog.Dav.FILE_TOO_SHORT .params("too short.size", fileSize, range.getRangeHeaderField()).writeLog(); - throw DcCoreException.Dav.FS_INCONSISTENCY_FOUND; + throw PersoniumCoreException.Dav.FS_INCONSISTENCY_FOUND; } output.write((char) chr); } diff --git a/src/main/java/com/fujitsu/dc/core/model/file/UniqueNameComposer.java b/src/main/java/io/personium/core/model/file/UniqueNameComposer.java similarity index 96% rename from src/main/java/com/fujitsu/dc/core/model/file/UniqueNameComposer.java rename to src/main/java/io/personium/core/model/file/UniqueNameComposer.java index cdf617c26..2be070def 100644 --- a/src/main/java/com/fujitsu/dc/core/model/file/UniqueNameComposer.java +++ b/src/main/java/io/personium/core/model/file/UniqueNameComposer.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.file; +package io.personium.core.model.file; import java.net.NetworkInterface; import java.net.SocketException; diff --git a/src/main/java/com/fujitsu/dc/core/model/file/package-info.java b/src/main/java/io/personium/core/model/file/package-info.java similarity index 91% rename from src/main/java/com/fujitsu/dc/core/model/file/package-info.java rename to src/main/java/io/personium/core/model/file/package-info.java index 6ed12b60b..b1f9969df 100644 --- a/src/main/java/com/fujitsu/dc/core/model/file/package-info.java +++ b/src/main/java/io/personium/core/model/file/package-info.java @@ -17,5 +17,5 @@ /** * DavFileの読み込みを行うために利用するクラス群. */ -package com.fujitsu.dc.core.model.file; +package io.personium.core.model.file; diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/BoxCmpEsImpl.java b/src/main/java/io/personium/core/model/impl/es/BoxCmpEsImpl.java similarity index 82% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/BoxCmpEsImpl.java rename to src/main/java/io/personium/core/model/impl/es/BoxCmpEsImpl.java index a0c97a418..3be30306d 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/BoxCmpEsImpl.java +++ b/src/main/java/io/personium/core/model/impl/es/BoxCmpEsImpl.java @@ -14,17 +14,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es; +package io.personium.core.model.impl.es; import org.apache.wink.webdav.model.ObjectFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.BoxCmp; -import com.fujitsu.dc.core.model.DavCmp; -import com.fujitsu.dc.core.model.impl.es.accessor.DavNodeAccessor; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.Box; +import io.personium.core.model.BoxCmp; +import io.personium.core.model.DavCmp; +import io.personium.core.model.impl.es.accessor.DavNodeAccessor; /** * Boxに対応した処理を扱う部品のESを使った実装. @@ -76,7 +76,7 @@ private void createRootDoc() { } @Override - public DcCoreException getNotFoundException() { - return DcCoreException.Dav.BOX_NOT_FOUND; + public PersoniumCoreException getNotFoundException() { + return PersoniumCoreException.Dav.BOX_NOT_FOUND; } } diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/CellCmpEsImpl.java b/src/main/java/io/personium/core/model/impl/es/CellCmpEsImpl.java similarity index 74% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/CellCmpEsImpl.java rename to src/main/java/io/personium/core/model/impl/es/CellCmpEsImpl.java index 652443e7c..eed786249 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/CellCmpEsImpl.java +++ b/src/main/java/io/personium/core/model/impl/es/CellCmpEsImpl.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es; +package io.personium.core.model.impl.es; import java.util.HashMap; import java.util.Map; @@ -24,17 +24,17 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.es.response.DcGetResponse; -import com.fujitsu.dc.common.es.response.DcIndexResponse; -import com.fujitsu.dc.common.es.response.DcSearchResponse; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.CellCmp; -import com.fujitsu.dc.core.model.impl.es.accessor.EntitySetAccessor; -import com.fujitsu.dc.core.model.impl.es.cache.CellCache; -import com.fujitsu.dc.core.model.impl.es.doc.CellDocHandler; -import com.fujitsu.dc.core.model.lock.Lock; -import com.fujitsu.dc.core.model.lock.LockManager; +import io.personium.common.es.response.PersoniumGetResponse; +import io.personium.common.es.response.PersoniumIndexResponse; +import io.personium.common.es.response.PersoniumSearchResponse; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.Cell; +import io.personium.core.model.CellCmp; +import io.personium.core.model.impl.es.accessor.EntitySetAccessor; +import io.personium.core.model.impl.es.cache.CellCache; +import io.personium.core.model.impl.es.doc.CellDocHandler; +import io.personium.core.model.lock.Lock; +import io.personium.core.model.lock.LockManager; /** * Cellに対応した処理を扱う部品のESを使った実装. @@ -81,8 +81,8 @@ private EntitySetAccessor getCellAccessor() { * @return Node取得結果 */ @Override - public DcGetResponse getNode() { - DcGetResponse res = this.getCellAccessor().get(this.nodeId); + public PersoniumGetResponse getNode() { + PersoniumGetResponse res = this.getCellAccessor().get(this.nodeId); return res; } @@ -91,8 +91,8 @@ public DcGetResponse getNode() { * @return 更新結果. */ @Override - public DcIndexResponse updateNodeWithVersion() { - DcIndexResponse resp; + public PersoniumIndexResponse updateNodeWithVersion() { + PersoniumIndexResponse resp; try { resp = this.getCellAccessor().update(this.nodeId, this.docHandler, this.version); } finally { @@ -106,8 +106,8 @@ public DcIndexResponse updateNodeWithVersion() { * @return 更新結果. */ @Override - public DcIndexResponse updateNode() { - DcIndexResponse resp; + public PersoniumIndexResponse updateNode() { + PersoniumIndexResponse resp; try { resp = this.getCellAccessor().update(this.nodeId, this.docHandler); } finally { @@ -121,8 +121,8 @@ public DcIndexResponse updateNode() { * @return 作成結果 */ @Override - public DcIndexResponse createNode() { - DcIndexResponse res; + public PersoniumIndexResponse createNode() { + PersoniumIndexResponse res; res = this.getCellAccessor().create(this.docHandler); return res; } @@ -146,7 +146,7 @@ public void makeEmpty() { * @return 子リソースの検索結果 */ @Override - public DcSearchResponse getChildResource() { + public PersoniumSearchResponse getChildResource() { // 子リソースの情報を取得する。 Map query = new HashMap(); Map query2 = new HashMap(); @@ -155,7 +155,7 @@ public DcSearchResponse getChildResource() { query2.put("term", query3); query.put("query", query2); - DcSearchResponse resp = this.getCellAccessor().search(query); + PersoniumSearchResponse resp = this.getCellAccessor().search(query); return resp; } @@ -187,7 +187,7 @@ public Lock lock() { } @Override - public DcCoreException getNotFoundException() { - return DcCoreException.Dav.CELL_NOT_FOUND; + public PersoniumCoreException getNotFoundException() { + return PersoniumCoreException.Dav.CELL_NOT_FOUND; } } diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/CellEsImpl.java b/src/main/java/io/personium/core/model/impl/es/CellEsImpl.java similarity index 84% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/CellEsImpl.java rename to src/main/java/io/personium/core/model/impl/es/CellEsImpl.java index 336040157..fff489a01 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/CellEsImpl.java +++ b/src/main/java/io/personium/core/model/impl/es/CellEsImpl.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es; +package io.personium.core.model.impl.es; import java.net.MalformedURLException; import java.net.URI; @@ -45,44 +45,44 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.auth.token.IExtRoleContainingToken; -import com.fujitsu.dc.common.auth.token.Role; -import com.fujitsu.dc.common.es.response.DcGetResponse; -import com.fujitsu.dc.common.es.response.DcSearchHit; -import com.fujitsu.dc.common.es.response.DcSearchHits; -import com.fujitsu.dc.common.es.response.DcSearchResponse; -import com.fujitsu.dc.common.es.util.IndexNameEncoder; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.DcCoreLog; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.auth.AuthUtils; -import com.fujitsu.dc.core.event.EventBus; -import com.fujitsu.dc.core.event.EventUtils; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.BoxCmp; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.ModelFactory; -import com.fujitsu.dc.core.model.ctl.Account; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.model.ctl.ExtCell; -import com.fujitsu.dc.core.model.ctl.ExtRole; -import com.fujitsu.dc.core.model.ctl.ReceivedMessage; -import com.fujitsu.dc.core.model.ctl.Relation; -import com.fujitsu.dc.core.model.ctl.SentMessage; -import com.fujitsu.dc.core.model.file.BinaryDataAccessException; -import com.fujitsu.dc.core.model.file.BinaryDataAccessor; -import com.fujitsu.dc.core.model.impl.es.accessor.CellAccessor; -import com.fujitsu.dc.core.model.impl.es.accessor.EntitySetAccessor; -import com.fujitsu.dc.core.model.impl.es.accessor.ODataLinkAccessor; -import com.fujitsu.dc.core.model.impl.es.cache.BoxCache; -import com.fujitsu.dc.core.model.impl.es.cache.CellCache; -import com.fujitsu.dc.core.model.impl.es.doc.CellDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.OEntityDocHandler; -import com.fujitsu.dc.core.model.impl.es.odata.CellCtlODataProducer; -import com.fujitsu.dc.core.model.lock.CellLockManager; -import com.fujitsu.dc.core.odata.OEntityWrapper; -import com.fujitsu.dc.core.utils.UriUtils; +import io.personium.common.auth.token.IExtRoleContainingToken; +import io.personium.common.auth.token.Role; +import io.personium.common.es.response.PersoniumGetResponse; +import io.personium.common.es.response.PersoniumSearchHit; +import io.personium.common.es.response.PersoniumSearchHits; +import io.personium.common.es.response.PersoniumSearchResponse; +import io.personium.common.es.util.IndexNameEncoder; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.PersoniumCoreLog; +import io.personium.core.auth.AccessContext; +import io.personium.core.auth.AuthUtils; +import io.personium.core.event.EventBus; +import io.personium.core.event.EventUtils; +import io.personium.core.model.Box; +import io.personium.core.model.BoxCmp; +import io.personium.core.model.Cell; +import io.personium.core.model.ModelFactory; +import io.personium.core.model.ctl.Account; +import io.personium.core.model.ctl.Common; +import io.personium.core.model.ctl.ExtCell; +import io.personium.core.model.ctl.ExtRole; +import io.personium.core.model.ctl.ReceivedMessage; +import io.personium.core.model.ctl.Relation; +import io.personium.core.model.ctl.SentMessage; +import io.personium.core.model.file.BinaryDataAccessException; +import io.personium.core.model.file.BinaryDataAccessor; +import io.personium.core.model.impl.es.accessor.CellAccessor; +import io.personium.core.model.impl.es.accessor.EntitySetAccessor; +import io.personium.core.model.impl.es.accessor.ODataLinkAccessor; +import io.personium.core.model.impl.es.cache.BoxCache; +import io.personium.core.model.impl.es.cache.CellCache; +import io.personium.core.model.impl.es.doc.CellDocHandler; +import io.personium.core.model.impl.es.doc.OEntityDocHandler; +import io.personium.core.model.impl.es.odata.CellCtlODataProducer; +import io.personium.core.model.lock.CellLockManager; +import io.personium.core.odata.OEntityWrapper; +import io.personium.core.utils.UriUtils; /** * Cell object implemented using ElasticSearch. @@ -98,7 +98,7 @@ public final class CellEsImpl implements Cell { /** * Esの検索結果出力上限. */ - private static final int TOP_NUM = DcCoreConfig.getEsTopNum(); + private static final int TOP_NUM = PersoniumUnitConfig.getEsTopNum(); /** * logger. @@ -230,7 +230,7 @@ public static Cell load(final UriInfo uriInfo) { public static Cell load(final String id, final UriInfo uriInfo) { log.debug(id); EntitySetAccessor esCells = EsModel.cell(); - DcGetResponse resp = esCells.get(id); + PersoniumGetResponse resp = esCells.get(id); if (resp.exists()) { CellEsImpl ret = new CellEsImpl(); ret.setJson(resp.getSource()); @@ -250,7 +250,7 @@ private static String getBaseUri(final UriInfo uriInfo, String cellName) { // URLを生成してSet StringBuilder urlSb = new StringBuilder(); UriBuilder uriBuilder = uriInfo.getBaseUriBuilder(); - uriBuilder.scheme(DcCoreConfig.getUnitScheme()); + uriBuilder.scheme(PersoniumUnitConfig.getUnitScheme()); urlSb.append(uriBuilder.build().toASCIIString()); urlSb.append(cellName); urlSb.append("/"); @@ -289,11 +289,11 @@ public static Cell findCell(String queryKey, String queryValue, UriInfo uriInfo) filter.put("term", term); source.put("query", QueryMapFactory.filteredQuery(null, filter)); - DcSearchResponse resp = ecCells.search(source); + PersoniumSearchResponse resp = ecCells.search(source); if ((resp == null) || (resp.getHits().getCount() == 0)) { return null; } - DcSearchHit hit = resp.getHits().getAt(0); + PersoniumSearchHit hit = resp.getHits().getAt(0); ret.setJson(hit.getSource()); ret.id = hit.getId(); @@ -307,7 +307,7 @@ public static Cell findCell(String queryKey, String queryValue, UriInfo uriInfo) log.info("Faild to cache Cell info."); } else { // その他のエラーの場合、サーバエラーとする - throw DcCoreException.Server.SERVER_CONNECTION_ERROR; + throw PersoniumCoreException.Server.SERVER_CONNECTION_ERROR; } } } else { @@ -345,7 +345,7 @@ public OEntityWrapper getAccount(final String username) { try { EntityResponse resp = op.getEntity("Account", key, null); oew = (OEntityWrapper) resp.getEntity(); - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { log.debug(dce.getMessage()); } return oew; @@ -384,13 +384,13 @@ public List getRoleListForAccount(final String username) { source.put("filter", QueryMapFactory.andFilter(filters)); source.put("query", query); - DcSearchHits hits = accountType.search(source).getHits(); + PersoniumSearchHits hits = accountType.search(source).getHits(); if (hits.getCount() == 0) { return null; } - DcSearchHit hit = hits.getHits()[0]; + PersoniumSearchHit hit = hits.getHits()[0]; List ret = new ArrayList(); ODataLinkAccessor links = EsModel.cellCtlLink(this); @@ -415,17 +415,17 @@ public List getRoleListForAccount(final String username) { // 検索結果件数設定 searchRoleSource.put("size", TOP_NUM); - DcSearchResponse res = links.search(searchRoleSource); + PersoniumSearchResponse res = links.search(searchRoleSource); if (res == null) { return ret; } - DcSearchHit[] hits2 = res.getHits().getHits(); - for (DcSearchHit hit2 : hits2) { + PersoniumSearchHit[] hits2 = res.getHits().getHits(); + for (PersoniumSearchHit hit2 : hits2) { Map row = hit2.getSource(); String role = (String) row.get("k2"); log.debug(this.id); EntitySetAccessor roleDao = EsModel.cellCtl(this, Role.EDM_TYPE_NAME); - DcGetResponse gRes = roleDao.get(role); + PersoniumGetResponse gRes = roleDao.get(role); if (gRes == null) { continue; } @@ -439,7 +439,7 @@ public List getRoleListForAccount(final String username) { if (boxId != null) { // Boxの検索 EntitySetAccessor box = EsModel.box(this); - DcGetResponse getRes = box.get(boxId); + PersoniumGetResponse getRes = box.get(boxId); if (getRes == null || !getRes.isExists()) { continue; } @@ -503,8 +503,8 @@ private void addRoleListExtCelltoRole(final IExtRoleContainingToken token, List< response = (EntitiesResponse) op.getNavProperty(ExtCell.EDM_TYPE_NAME, OEntityKey.create(extCellUrl), "_" + Role.EDM_TYPE_NAME, qi); - } catch (DcCoreException dce) { - if (DcCoreException.OData.NO_SUCH_ENTITY != dce) { + } catch (PersoniumCoreException dce) { + if (PersoniumCoreException.OData.NO_SUCH_ENTITY != dce) { throw dce; } } @@ -550,8 +550,8 @@ private void addRoleListExtCelltoRelationAndExtRole(final IExtRoleContainingToke response = (EntitiesResponse) op.getNavProperty(ExtCell.EDM_TYPE_NAME, OEntityKey.create(extCellUrl), "_" + Relation.EDM_TYPE_NAME, qi); - } catch (DcCoreException dce) { - if (DcCoreException.OData.NO_SUCH_ENTITY != dce) { + } catch (PersoniumCoreException dce) { + if (PersoniumCoreException.OData.NO_SUCH_ENTITY != dce) { throw dce; } } @@ -568,7 +568,7 @@ private void addRoleListExtCelltoRelationAndExtRole(final IExtRoleContainingToke OEntityWrapper entRelation = (OEntityWrapper) ent; // ExtCell-Relationのリンク情報をすべて見て今回アクセスしてきたセル向けのロールを洗い出す。 - DcSearchResponse res = serchRoleLinks(Relation.EDM_TYPE_NAME, entRelation.getUuid()); + PersoniumSearchResponse res = serchRoleLinks(Relation.EDM_TYPE_NAME, entRelation.getUuid()); if (res == null) { continue; } @@ -598,13 +598,13 @@ private void addRoleListExtCelltoRelationAndExtRole(final IExtRoleContainingToke } source.put("size", hitNum); - DcSearchHits extRoleHits = extRoleType.search(source).getHits(); + PersoniumSearchHits extRoleHits = extRoleType.search(source).getHits(); // ExtCellの設定が存在しないときは飛ばす // 件数取得後に削除される場合があるため、検索結果を再度確認しておく if (extRoleHits.getCount() == 0) { continue; } - for (DcSearchHit extRoleHit : extRoleHits.getHits()) { + for (PersoniumSearchHit extRoleHit : extRoleHits.getHits()) { Map extRoleSource = extRoleHit.getSource(); Map extRoleS = (Map) extRoleSource.get("s"); String esExtRole = (String) extRoleS.get(ExtRole.EDM_TYPE_NAME); @@ -615,7 +615,7 @@ private void addRoleListExtCelltoRelationAndExtRole(final IExtRoleContainingToke continue; } // ExtCell-Roleのリンク情報をすべて見て今回アクセスしてきたセル向けのロールを洗い出す。 - DcSearchResponse resExtRoleToRole = serchRoleLinks(ExtRole.EDM_TYPE_NAME, extRoleHit.getId()); + PersoniumSearchResponse resExtRoleToRole = serchRoleLinks(ExtRole.EDM_TYPE_NAME, extRoleHit.getId()); if (resExtRoleToRole == null) { continue; } @@ -633,7 +633,7 @@ private void addRoleListExtCelltoRelationAndExtRole(final IExtRoleContainingToke * 検索するuuid * @return 検索結果 */ - private DcSearchResponse serchRoleLinks(final String searchKey, final String searchValue) { + private PersoniumSearchResponse serchRoleLinks(final String searchKey, final String searchValue) { ODataLinkAccessor links = EsModel.cellCtlLink(this); // Relationに結びつくロールの検索 @@ -666,8 +666,8 @@ private DcSearchResponse serchRoleLinks(final String searchKey, final String sea * @param roles * 払い出すロールのリスト。ここに追加する(破壊的メソッド) */ - private void addRoles(DcSearchHit[] hits, List roles) { - for (DcSearchHit hit : hits) { + private void addRoles(PersoniumSearchHit[] hits, List roles) { + for (PersoniumSearchHit hit : hits) { Map src = hit.getSource(); String roleUuid = (String) src.get("k2"); @@ -686,7 +686,7 @@ private void addRoles(DcSearchHit[] hits, List roles) { @SuppressWarnings("unchecked") private void addRole(String uuid, List roles) { EntitySetAccessor roleDao = EsModel.cellCtl(this, Role.EDM_TYPE_NAME); - DcGetResponse gRes = roleDao.get(uuid); + PersoniumGetResponse gRes = roleDao.get(uuid); if (gRes == null) { return; } @@ -725,7 +725,7 @@ public String getDataBundleNameWithOutPrefix() { @Override public String getDataBundleName() { - String unitUserName = DcCoreConfig.getEsUnitPrefix() + "_" + getDataBundleNameWithOutPrefix(); + String unitUserName = PersoniumUnitConfig.getEsUnitPrefix() + "_" + getDataBundleNameWithOutPrefix(); return unitUserName; } @@ -847,7 +847,7 @@ public String roleResourceUrlToId(String roleUrl, String baseUrl) { rUrl = new URL(roleUrl); } } catch (MalformedURLException e) { - throw DcCoreException.Dav.ROLE_NOT_FOUND.reason(e); + throw PersoniumCoreException.Dav.ROLE_NOT_FOUND.reason(e); } Role role = null; @@ -855,13 +855,13 @@ public String roleResourceUrlToId(String roleUrl, String baseUrl) { role = new Role(rUrl); } catch (MalformedURLException e) { log.info("Role URL:" + rUrl.toString()); - throw DcCoreException.Dav.ROLE_NOT_FOUND; + throw PersoniumCoreException.Dav.ROLE_NOT_FOUND; } // ロールリソースのセルURL部分はACL設定対象のセルURLと異なるものを指定することは許さない if (!(this.getUrl().equals(role.getBaseUrl()))) { - DcCoreLog.Dav.ROLE_NOT_FOUND.params("Cell different").writeLog(); - throw DcCoreException.Dav.ROLE_NOT_FOUND; + PersoniumCoreLog.Dav.ROLE_NOT_FOUND.params("Cell different").writeLog(); + throw PersoniumCoreException.Dav.ROLE_NOT_FOUND; } // Roleの検索 List> queries = new ArrayList>(); @@ -875,7 +875,7 @@ public String roleResourceUrlToId(String roleUrl, String baseUrl) { // Roleがボックスと紐付く場合に、検索クエリを追加 Box targetBox = this.getBoxForName(role.getBoxName()); if (targetBox == null) { - throw DcCoreException.Dav.BOX_LINKED_BY_ROLE_NOT_FOUND.params(baseUrl); + throw PersoniumCoreException.Dav.BOX_LINKED_BY_ROLE_NOT_FOUND.params(baseUrl); } String boxId = targetBox.getId(); filters.add(QueryMapFactory.termQuery("l." + Box.EDM_TYPE_NAME, boxId)); @@ -889,28 +889,28 @@ public String roleResourceUrlToId(String roleUrl, String baseUrl) { source.put("filter", QueryMapFactory.andFilter(filters)); } source.put("query", query); - DcSearchHits hits = roleType.search(source).getHits(); + PersoniumSearchHits hits = roleType.search(source).getHits(); // 対象のRoleが存在しない場合はNull if (hits == null || hits.getCount() == 0) { - DcCoreLog.Dav.ROLE_NOT_FOUND.params("Not Hit").writeLog(); - throw DcCoreException.Dav.ROLE_NOT_FOUND; + PersoniumCoreLog.Dav.ROLE_NOT_FOUND.params("Not Hit").writeLog(); + throw PersoniumCoreException.Dav.ROLE_NOT_FOUND; } // 対象のRoleが複数件取得された場合は内部エラーとする if (hits.getAllPages() > 1) { - DcCoreLog.OData.FOUND_MULTIPLE_RECORDS.params(hits.getAllPages()).writeLog(); - throw DcCoreException.OData.DETECTED_INTERNAL_DATA_CONFLICT; + PersoniumCoreLog.OData.FOUND_MULTIPLE_RECORDS.params(hits.getAllPages()).writeLog(); + throw PersoniumCoreException.OData.DETECTED_INTERNAL_DATA_CONFLICT; } - DcSearchHit hit = hits.getHits()[0]; + PersoniumSearchHit hit = hits.getHits()[0]; return hit.getId(); } @Override public void delete(boolean recursive, String unitUserName) { // Cellに対するアクセス数を確認して、アクセスをロックする - int maxLoopCount = Integer.valueOf(DcCoreConfig.getCellLockRetryTimes()); - long interval = Long.valueOf(DcCoreConfig.getCellLockRetryInterval()); + int maxLoopCount = Integer.valueOf(PersoniumUnitConfig.getCellLockRetryTimes()); + long interval = Long.valueOf(PersoniumUnitConfig.getCellLockRetryInterval()); waitCellAccessible(this.id, maxLoopCount, interval); CellLockManager.setBulkDeletionStatus(this.id); @@ -947,10 +947,10 @@ private void waitCellAccessible(String cellId, int maxLoopCount, long interval) try { Thread.sleep(interval); } catch (InterruptedException e) { - throw DcCoreException.Misc.CONFLICT_CELLACCESS; + throw PersoniumCoreException.Misc.CONFLICT_CELLACCESS; } } - throw DcCoreException.Misc.CONFLICT_CELLACCESS; + throw PersoniumCoreException.Misc.CONFLICT_CELLACCESS; } private static final int DAVFILE_DEFAULT_FETCH_COUNT = 1000; @@ -967,8 +967,8 @@ public void makeEmpty() { // 1000件ずつ、WebDavファイルの管理情報件数まで以下を実施する int fetchCount = DAVFILE_DEFAULT_FETCH_COUNT; - BinaryDataAccessor accessor = new BinaryDataAccessor(DcCoreConfig.getBlobStoreRoot(), unitUserNameWithOutPrefix, - DcCoreConfig.getPhysicalDeleteMode(), DcCoreConfig.getFsyncEnabled()); + BinaryDataAccessor accessor = new BinaryDataAccessor(PersoniumUnitConfig.getBlobStoreRoot(), unitUserNameWithOutPrefix, + PersoniumUnitConfig.getPhysicalDeleteMode(), PersoniumUnitConfig.getFsyncEnabled()); for (int i = 0; i <= davfileCount; i += fetchCount) { // WebDavファイルのID一覧を取得する List davFileIdList = cellAccessor.getDavFileIdList(this.getId(), unitUserNameWithOutPrefix, diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/DavCmpEsImpl.java b/src/main/java/io/personium/core/model/impl/es/DavCmpEsImpl.java similarity index 83% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/DavCmpEsImpl.java rename to src/main/java/io/personium/core/model/impl/es/DavCmpEsImpl.java index 3bf7b9f5f..69457f625 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/DavCmpEsImpl.java +++ b/src/main/java/io/personium/core/model/impl/es/DavCmpEsImpl.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es; +package io.personium.core.model.impl.es; import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; @@ -53,49 +53,49 @@ import org.w3c.dom.Element; import org.w3c.dom.NodeList; -import com.fujitsu.dc.common.auth.token.Role; -import com.fujitsu.dc.common.es.response.DcActionResponse; -import com.fujitsu.dc.common.es.response.DcBulkItemResponse; -import com.fujitsu.dc.common.es.response.DcBulkResponse; -import com.fujitsu.dc.common.es.response.DcGetResponse; -import com.fujitsu.dc.common.es.response.DcIndexResponse; -import com.fujitsu.dc.common.es.response.DcSearchHit; -import com.fujitsu.dc.common.es.response.DcSearchHits; -import com.fujitsu.dc.common.es.response.DcSearchResponse; -import com.fujitsu.dc.common.es.util.DcUUID; -import com.fujitsu.dc.common.es.util.IndexNameEncoder; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.DcCoreLog; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.auth.BoxPrivilege; -import com.fujitsu.dc.core.auth.OAuth2Helper.Key; -import com.fujitsu.dc.core.http.header.ByteRangeSpec; -import com.fujitsu.dc.core.http.header.RangeHeaderHandler; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.DavCmp; -import com.fujitsu.dc.core.model.DavDestination; -import com.fujitsu.dc.core.model.ModelFactory; -import com.fujitsu.dc.core.model.ctl.ComplexType; -import com.fujitsu.dc.core.model.ctl.EntityType; -import com.fujitsu.dc.core.model.file.BinaryDataAccessException; -import com.fujitsu.dc.core.model.file.BinaryDataAccessor; -import com.fujitsu.dc.core.model.file.BinaryDataNotFoundException; -import com.fujitsu.dc.core.model.file.StreamingOutputForDavFile; -import com.fujitsu.dc.core.model.file.StreamingOutputForDavFileWithRange; -import com.fujitsu.dc.core.model.impl.es.accessor.DavMoveAccessor; -import com.fujitsu.dc.core.model.impl.es.accessor.DavNodeAccessor; -import com.fujitsu.dc.core.model.impl.es.accessor.EntitySetAccessor; -import com.fujitsu.dc.core.model.impl.es.doc.EsDocHandler; -import com.fujitsu.dc.core.model.impl.es.odata.UserSchemaODataProducer; -import com.fujitsu.dc.core.model.jaxb.Acl; -import com.fujitsu.dc.core.model.jaxb.ObjectIo; -import com.fujitsu.dc.core.model.lock.Lock; -import com.fujitsu.dc.core.model.lock.LockKeyComposer; -import com.fujitsu.dc.core.model.lock.LockManager; -import com.fujitsu.dc.core.odata.DcODataProducer; +import io.personium.common.auth.token.Role; +import io.personium.common.es.response.PersoniumActionResponse; +import io.personium.common.es.response.PersoniumBulkItemResponse; +import io.personium.common.es.response.PersoniumBulkResponse; +import io.personium.common.es.response.PersoniumGetResponse; +import io.personium.common.es.response.PersoniumIndexResponse; +import io.personium.common.es.response.PersoniumSearchHit; +import io.personium.common.es.response.PersoniumSearchHits; +import io.personium.common.es.response.PersoniumSearchResponse; +import io.personium.common.es.util.PersoniumUUID; +import io.personium.common.es.util.IndexNameEncoder; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.PersoniumCoreLog; +import io.personium.core.auth.AccessContext; +import io.personium.core.auth.BoxPrivilege; +import io.personium.core.auth.OAuth2Helper.Key; +import io.personium.core.http.header.ByteRangeSpec; +import io.personium.core.http.header.RangeHeaderHandler; +import io.personium.core.model.Box; +import io.personium.core.model.Cell; +import io.personium.core.model.DavCmp; +import io.personium.core.model.DavDestination; +import io.personium.core.model.ModelFactory; +import io.personium.core.model.ctl.ComplexType; +import io.personium.core.model.ctl.EntityType; +import io.personium.core.model.file.BinaryDataAccessException; +import io.personium.core.model.file.BinaryDataAccessor; +import io.personium.core.model.file.BinaryDataNotFoundException; +import io.personium.core.model.file.StreamingOutputForDavFile; +import io.personium.core.model.file.StreamingOutputForDavFileWithRange; +import io.personium.core.model.impl.es.accessor.DavMoveAccessor; +import io.personium.core.model.impl.es.accessor.DavNodeAccessor; +import io.personium.core.model.impl.es.accessor.EntitySetAccessor; +import io.personium.core.model.impl.es.doc.EsDocHandler; +import io.personium.core.model.impl.es.odata.UserSchemaODataProducer; +import io.personium.core.model.jaxb.Acl; +import io.personium.core.model.jaxb.ObjectIo; +import io.personium.core.model.lock.Lock; +import io.personium.core.model.lock.LockKeyComposer; +import io.personium.core.model.lock.LockManager; +import io.personium.core.odata.PersoniumODataProducer; /** * DavCmpのElastic Search実装. @@ -116,7 +116,7 @@ public class DavCmpEsImpl implements DavCmp, EsDocHandler { /** * Esの検索結果出力上限. */ - private static final int TOP_NUM = DcCoreConfig.getEsTopNum(); + private static final int TOP_NUM = PersoniumUnitConfig.getEsTopNum(); /** * ログ. @@ -228,8 +228,8 @@ public boolean isEmpty() { } return !(svcSourceCol.getChildrenCount() > 0); } - DcCoreLog.Misc.UNREACHABLE_CODE_ERROR.writeLog(); - throw DcCoreException.Server.UNKNOWN_ERROR; + PersoniumCoreLog.Misc.UNREACHABLE_CODE_ERROR.writeLog(); + throw PersoniumCoreException.Server.UNKNOWN_ERROR; } @Override @@ -286,7 +286,7 @@ public final boolean exists() { * Davの管理データ情報を最新化する. */ public final void load() { - DcGetResponse res = getNode(); + PersoniumGetResponse res = getNode(); if (res == null) { this.davNode = null; return; @@ -303,7 +303,7 @@ public final void load() { setMetadata(source); } catch (ParseException e) { // ESのJSONが壊れている状態。 - throw DcCoreException.Dav.FS_INCONSISTENCY_FOUND.reason(e); + throw PersoniumCoreException.Dav.FS_INCONSISTENCY_FOUND.reason(e); } } @@ -361,7 +361,7 @@ public final void loadAndCheckDavInconsistency() { load(); if (this.davNode == null) { // Boxから辿ってidで検索して、Davデータに不整合があった場合 - throw DcCoreException.Dav.DAV_INCONSISTENCY_FOUND; + throw PersoniumCoreException.Dav.DAV_INCONSISTENCY_FOUND; } } @@ -369,8 +369,8 @@ public final void loadAndCheckDavInconsistency() { * Nodeのデータを取得する. * @return Node取得結果 */ - public DcGetResponse getNode() { - DcGetResponse res = this.getEsColType().get(this.nodeId); + public PersoniumGetResponse getNode() { + PersoniumGetResponse res = this.getEsColType().get(this.nodeId); return res; } @@ -385,7 +385,7 @@ private Element parseProp(String value) { ByteArrayInputStream is = new ByteArrayInputStream(value.getBytes(CharEncoding.UTF_8)); doc = builder.parse(is); } catch (Exception e1) { - throw DcCoreException.Dav.DAV_INCONSISTENCY_FOUND.reason(e1); + throw PersoniumCoreException.Dav.DAV_INCONSISTENCY_FOUND.reason(e1); } Element e = doc.getDocumentElement(); return e; @@ -403,7 +403,7 @@ public DavNodeAccessor getEsColType() { * 子リソースの情報を取得する. * @return 子リソースの検索結果 */ - public DcSearchResponse getChildResource() { + public PersoniumSearchResponse getChildResource() { // 子リソースの情報を取得する。 Map source = new HashMap(); @@ -421,7 +421,7 @@ public DcSearchResponse getChildResource() { // 検索性能の問題もあるため、対応方針を決めて修正する必要がある source.put("size", TOP_NUM); - DcSearchResponse resp = this.getEsColType().search(source); + PersoniumSearchResponse resp = this.getEsColType().search(source); return resp; } @@ -454,13 +454,13 @@ public Multistatus proppatch(final Propertyupdate propUpdate, final String url) for (Prop prop : propsToSet) { if (null == prop) { - throw DcCoreException.Dav.XML_CONTENT_ERROR; + throw PersoniumCoreException.Dav.XML_CONTENT_ERROR; } List lpe = prop.getAny(); for (Element elem : lpe) { res.setProperty(elem, HttpStatus.SC_OK); String key = elem.getLocalName() + "@" + elem.getNamespaceURI(); - String value = DcCoreUtils.nodeToString(elem); + String value = PersoniumCoreUtils.nodeToString(elem); log.debug("key: " + key); log.debug("val: " + value); propsJson.put(key, value); @@ -470,7 +470,7 @@ public Multistatus proppatch(final Propertyupdate propUpdate, final String url) List propsToRemove = propUpdate.getPropsToRemove(); for (Prop prop : propsToRemove) { if (null == prop) { - throw DcCoreException.Dav.XML_CONTENT_ERROR; + throw PersoniumCoreException.Dav.XML_CONTENT_ERROR; } List lpe = prop.getAny(); for (Element elem : lpe) { @@ -490,7 +490,7 @@ public Multistatus proppatch(final Propertyupdate propUpdate, final String url) this.davNode.setUpdated(now); // 変更後JSONを書き出し。 setPropToJson(propsJson); - DcIndexResponse resp = updateNodeWithVersion(); + PersoniumIndexResponse resp = updateNodeWithVersion(); // ETAG生成用にVersionを反映 this.version = resp.version(); } finally { @@ -512,8 +512,8 @@ protected void setPropToJson(Map propsJson) { * バージョン指定でNodeの情報を更新する. * @return 更新結果. */ - public DcIndexResponse updateNodeWithVersion() { - DcIndexResponse resp; + public PersoniumIndexResponse updateNodeWithVersion() { + PersoniumIndexResponse resp; resp = this.getEsColType().update(this.nodeId, this.davNode, this.version); return resp; } @@ -522,8 +522,8 @@ public DcIndexResponse updateNodeWithVersion() { * バージョン指定でNodeファイルの情報を更新する. * @return 更新結果. */ - public DcIndexResponse updateNodeWithVersionForFile() { - DcIndexResponse resp; + public PersoniumIndexResponse updateNodeWithVersionForFile() { + PersoniumIndexResponse resp; resp = this.getEsColType().updateForFile(this.nodeId, this.davNode, this.version); return resp; } @@ -536,17 +536,17 @@ public final ResponseBuilder acl(final Reader reader) { try { aclToSet = ObjectIo.unmarshal(reader, Acl.class); } catch (Exception e1) { - throw DcCoreException.Dav.XML_CONTENT_ERROR.reason(e1); + throw PersoniumCoreException.Dav.XML_CONTENT_ERROR.reason(e1); } if (!aclToSet.validateAcl(isCellLevel())) { - throw DcCoreException.Dav.XML_VALIDATE_ERROR; + throw PersoniumCoreException.Dav.XML_VALIDATE_ERROR; } JSONParser parser = new JSONParser(); JSONObject aclJson = null; try { aclJson = (JSONObject) parser.parse(aclToSet.toJSON()); } catch (ParseException e) { - throw DcCoreException.Dav.XML_ERROR.reason(e); + throw PersoniumCoreException.Dav.XML_ERROR.reason(e); } // ロック Lock lock = this.lock(); @@ -588,7 +588,7 @@ public final ResponseBuilder acl(final Reader reader) { aclJson.remove(KEY_ACL_BASE); setAclToJson(aclJson); // このノードの更新を保存 - DcIndexResponse resp = updateNode(); + PersoniumIndexResponse resp = updateNode(); this.version = resp.getVersion(); this.acl = aclToSet; // レスポンス @@ -610,8 +610,8 @@ protected void setAclToJson(JSONObject aclJson) { * Nodeの情報を更新する. * @return 更新結果. */ - public DcIndexResponse updateNode() { - DcIndexResponse resp; + public PersoniumIndexResponse updateNode() { + PersoniumIndexResponse resp; resp = this.getEsColType().update(this.nodeId, this.davNode); return resp; } @@ -626,7 +626,7 @@ public final ResponseBuilder putForCreate(final String contentType, final InputS // 親DavNodeが存在するが、作成対象のDavNodeが存在する場合:他のリクエストによって作成されたたtめ、更新処理を実行 this.parent.load(); if (!this.parent.exists()) { - throw DcCoreException.Dav.HAS_NOT_PARENT.params(this.parent.getUrl()); + throw PersoniumCoreException.Dav.HAS_NOT_PARENT.params(this.parent.getUrl()); } this.nodeId = this.parent.davNode.getChildren().get(this.name); @@ -650,9 +650,9 @@ public final ResponseBuilder putForCreate(final String contentType, final InputS * Node情報を作成する. * @return 作成結果 */ - public DcActionResponse createNode() { - DcIndexResponse res = null; - String id = DcUUID.randomUUID(); + public PersoniumActionResponse createNode() { + PersoniumIndexResponse res = null; + String id = PersoniumUUID.randomUUID(); res = this.getEsColType().create(id, this.davNode); return res; } @@ -662,8 +662,8 @@ public DcActionResponse createNode() { * @param id ID * @return 作成結果 */ - public DcActionResponse createNodeWithId(String id) { - DcActionResponse res; + public PersoniumActionResponse createNodeWithId(String id) { + PersoniumActionResponse res; res = this.getEsColType().createForFile(id, this.davNode); return res; } @@ -710,26 +710,26 @@ final ResponseBuilder doPutForCreate(final String contentType, final InputStream // 親コレクション内のコレクション・ファイル数のチェック checkChildResourceCount(); - String newId = DcUUID.randomUUID(); + String newId = PersoniumUUID.randomUUID(); try { BinaryDataAccessor accessor = getBinaryDataAccessor(); long writtenBytes = accessor.create(bufferedInput, newId); data.put(KEY_CONTENT_LENGTH, writtenBytes); } catch (BinaryDataNotFoundException nex) { - throw DcCoreException.Dav.RESOURCE_NOT_FOUND.reason(nex); + throw PersoniumCoreException.Dav.RESOURCE_NOT_FOUND.reason(nex); } catch (BinaryDataAccessException ex) { - throw DcCoreException.Dav.FS_INCONSISTENCY_FOUND.reason(ex); + throw PersoniumCoreException.Dav.FS_INCONSISTENCY_FOUND.reason(ex); } // メタデータの保存処理. this.davNode = fileNode; - DcActionResponse res = createNodeWithId(newId); - if (res instanceof DcIndexResponse) { - this.nodeId = ((DcIndexResponse) res).getId(); - this.version = ((DcIndexResponse) res).version(); - } else if (res instanceof DcGetResponse) { - this.nodeId = ((DcGetResponse) res).getId(); - this.version = ((DcGetResponse) res).version(); + PersoniumActionResponse res = createNodeWithId(newId); + if (res instanceof PersoniumIndexResponse) { + this.nodeId = ((PersoniumIndexResponse) res).getId(); + this.version = ((PersoniumIndexResponse) res).version(); + } else if (res instanceof PersoniumGetResponse) { + this.nodeId = ((PersoniumGetResponse) res).getId(); + this.version = ((PersoniumGetResponse) res).version(); } // adding newNode to this nodeDocument; @@ -751,7 +751,7 @@ final ResponseBuilder doPutForUpdate(final String contentType, final InputStream // 指定etagがあり、かつそれが*ではなく内部データから導出されるものと異なるときはエラー if (etag != null && !"*".equals(etag) && !this.getEtag().equals(etag)) { - throw DcCoreException.Dav.ETAG_NOT_MATCH; + throw PersoniumCoreException.Dav.ETAG_NOT_MATCH; } // 内容の更新をする @@ -767,14 +767,14 @@ final ResponseBuilder doPutForUpdate(final String contentType, final InputStream long writtenBytes = accessor.update(bufferedInput, this.nodeId); data.put(KEY_CONTENT_LENGTH, writtenBytes); } catch (BinaryDataNotFoundException nex) { - throw DcCoreException.Dav.RESOURCE_NOT_FOUND.reason(nex); + throw PersoniumCoreException.Dav.RESOURCE_NOT_FOUND.reason(nex); } catch (BinaryDataAccessException ex) { - throw DcCoreException.Dav.FS_INCONSISTENCY_FOUND.reason(ex); + throw PersoniumCoreException.Dav.FS_INCONSISTENCY_FOUND.reason(ex); } this.davNode.setFile(data); // 更新内容を書きだす - DcIndexResponse res = updateNodeWithVersionForFile(); + PersoniumIndexResponse res = updateNodeWithVersionForFile(); this.version = res.getVersion(); return javax.ws.rs.core.Response.ok().status(HttpStatus.SC_NO_CONTENT).header(HttpHeaders.ETAG, this.getEtag()); @@ -804,27 +804,27 @@ public final ResponseBuilder get(final String rangeHeaderField) { // Rangeヘッダの範囲チェック if (!range.isSatisfiable()) { - DcCoreLog.Dav.REQUESTED_RANGE_NOT_SATISFIABLE.params(range.getRangeHeaderField()).writeLog(); - throw DcCoreException.Dav.REQUESTED_RANGE_NOT_SATISFIABLE; + PersoniumCoreLog.Dav.REQUESTED_RANGE_NOT_SATISFIABLE.params(range.getRangeHeaderField()).writeLog(); + throw PersoniumCoreException.Dav.REQUESTED_RANGE_NOT_SATISFIABLE; } if (range.getByteRangeSpecCount() > 1) { // MultiPartレスポンスには未対応 - throw DcCoreException.Misc.NOT_IMPLEMENTED.params("Range-MultiPart"); + throw PersoniumCoreException.Misc.NOT_IMPLEMENTED.params("Range-MultiPart"); } else { StreamingOutput sout = new StreamingOutputForDavFileWithRange(fileFullPath, fileSize, range); res = davFileResponseForRange(sout, fileSize, contentType, range); } } return res.header(HttpHeaders.ETAG, this.getEtag()) - .header(DcCoreUtils.HttpHeaders.ACCEPT_RANGES, RangeHeaderHandler.BYTES_UNIT); + .header(PersoniumCoreUtils.HttpHeaders.ACCEPT_RANGES, RangeHeaderHandler.BYTES_UNIT); } catch (BinaryDataNotFoundException nex) { this.load(); if (!this.exists()) { throw getNotFoundException().params(this.getUrl()); } - throw DcCoreException.Dav.DAV_UNAVAILABLE.reason(nex); + throw PersoniumCoreException.Dav.DAV_UNAVAILABLE.reason(nex); } } @@ -858,7 +858,7 @@ public ResponseBuilder davFileResponseForRange( // iPadのsafariにおいてChunkedのRangeレスポンスを処理できなかったので明にContent-Lengthを返却している。 return javax.ws.rs.core.Response.status(HttpStatus.SC_PARTIAL_CONTENT).entity(sout) - .header(DcCoreUtils.HttpHeaders.CONTENT_RANGE, brs.makeContentRangeHeaderField()) + .header(PersoniumCoreUtils.HttpHeaders.CONTENT_RANGE, brs.makeContentRangeHeaderField()) .header(HttpHeaders.CONTENT_LENGTH, brs.getContentLength()) .header(HttpHeaders.CONTENT_TYPE, contentType); } @@ -903,38 +903,38 @@ public final ResponseBuilder mkcol(final String type) { if (!this.parent.exists()) { // クリティカルなタイミングで先に親を削除されてしまい、 // 親が存在しないので409エラーとする - throw DcCoreException.Dav.HAS_NOT_PARENT.params(this.parent.getUrl()); + throw PersoniumCoreException.Dav.HAS_NOT_PARENT.params(this.parent.getUrl()); } if (this.parent.davNode.getChildren().get(this.name) != null) { // クリティカルなタイミングで先にコレクションを作られてしまい、 // すでに存在するのでEXCEPTION - throw DcCoreException.Dav.METHOD_NOT_ALLOWED; + throw PersoniumCoreException.Dav.METHOD_NOT_ALLOWED; } // コレクションの階層数のチェック DavCmpEsImpl current = this; int depth = 0; - int maxDepth = DcCoreConfig.getMaxCollectionDepth(); + int maxDepth = PersoniumUnitConfig.getMaxCollectionDepth(); while (null != current.parent) { current = current.parent; depth++; } if (depth > maxDepth) { // コレクション数の制限を超えたため、400エラーとする - throw DcCoreException.Dav.COLLECTION_DEPTH_ERROR; + throw PersoniumCoreException.Dav.COLLECTION_DEPTH_ERROR; } // 親コレクション内のコレクション・ファイル数のチェック checkChildResourceCount(); // 新しいノードを保存 - DcActionResponse resp = createNode(); - if (resp instanceof DcIndexResponse) { - this.nodeId = ((DcIndexResponse) resp).getId(); - this.version = ((DcIndexResponse) resp).version(); - } else if (resp instanceof DcGetResponse) { - this.nodeId = ((DcGetResponse) resp).getId(); - this.version = ((DcGetResponse) resp).version(); + PersoniumActionResponse resp = createNode(); + if (resp instanceof PersoniumIndexResponse) { + this.nodeId = ((PersoniumIndexResponse) resp).getId(); + this.version = ((PersoniumIndexResponse) resp).version(); + } else if (resp instanceof PersoniumGetResponse) { + this.nodeId = ((PersoniumGetResponse) resp).getId(); + this.version = ((PersoniumGetResponse) resp).version(); } // 親ノードにポインタを追加 @@ -970,7 +970,7 @@ public ResponseBuilder move(String etag, String overwrite, DavDestination davDes } // 指定etagがあり、かつそれが*ではなく内部データから導出されるものと異なるときはエラー if (etag != null && !"*".equals(etag) && !this.getEtag().equals(etag)) { - throw DcCoreException.Dav.ETAG_NOT_MATCH; + throw PersoniumCoreException.Dav.ETAG_NOT_MATCH; } // 移動元のDavNodeをリロードしたことにより親DavNodeが別のリソースに切り替わっている可能性があるため、リロードする。 @@ -1008,10 +1008,10 @@ public ResponseBuilder move(String etag, String overwrite, DavDestination davDes DavNode dstNode = ((DavCmpEsImpl) dstCmp).getDavNode(); accessor.setMoveRequest(this.name, dstCmp.getName(), srcNode, dstNode, srcParentNode, dstParentNode); - DcBulkResponse bulkResponse = accessor.move(); + PersoniumBulkResponse bulkResponse = accessor.move(); // バルクレスポンスの解析 - for (DcBulkItemResponse item : bulkResponse.items()) { + for (PersoniumBulkItemResponse item : bulkResponse.items()) { if (srcNode.getId().equals(item.getId())) { // Etag返却用に、ソースのノードを更新した時のElaticsearchのバージョンを付与しておく this.version = item.version(); @@ -1036,10 +1036,10 @@ public ResponseBuilder move(String etag, String overwrite, DavDestination davDes private void checkChildResourceCount() { // 親コレクション内のコレクション・ファイル数のチェック - int maxChildResource = DcCoreConfig.getMaxChildResourceCount(); + int maxChildResource = PersoniumUnitConfig.getMaxChildResourceCount(); if (this.parent.getChildrenCount() >= maxChildResource) { // コレクション内に作成可能なコレクション・ファイル数の制限を超えたため、400エラーとする - throw DcCoreException.Dav.COLLECTION_CHILDRESOURCE_ERROR; + throw PersoniumCoreException.Dav.COLLECTION_CHILDRESOURCE_ERROR; } } @@ -1072,7 +1072,7 @@ public final ResponseBuilder unlinkChild(final String childName, final Long asof public final ResponseBuilder delete(final String ifMatch, boolean recursive) { // 指定etagがあり、かつそれが*ではなく内部データから導出されるものと異なるときはエラー if (ifMatch != null && !"*".equals(ifMatch) && !this.getEtag().equals(ifMatch)) { - throw DcCoreException.Dav.ETAG_NOT_MATCH; + throw PersoniumCoreException.Dav.ETAG_NOT_MATCH; } long now = new Date().getTime(); // ロック @@ -1085,7 +1085,7 @@ public final ResponseBuilder delete(final String ifMatch, boolean recursive) { } // WebDAVコレクションであって子孫リソースがあったら、エラーとする if (TYPE_COL_WEBDAV.equals(this.getType()) && this.davNode.getChildren().size() > 0) { - throw DcCoreException.Dav.HAS_CHILDREN; + throw PersoniumCoreException.Dav.HAS_CHILDREN; } if (this.parent != null) { @@ -1104,7 +1104,7 @@ public final ResponseBuilder delete(final String ifMatch, boolean recursive) { if (srcCmp.exists() && srcCmp instanceof DavCmpEsImpl) { ((DavCmpEsImpl) srcCmp).deleteNode(); } else { - throw DcCoreException.Dav.DAV_INCONSISTENCY_FOUND; + throw PersoniumCoreException.Dav.DAV_INCONSISTENCY_FOUND; } } this.parent.unlinkChild(this.name, now); @@ -1136,7 +1136,7 @@ public void deleteNode(final String deleteNodeId) { try { accessor.delete(deleteNodeId); } catch (BinaryDataAccessException e) { - throw DcCoreException.Dav.FS_INCONSISTENCY_FOUND.reason(e); + throw PersoniumCoreException.Dav.FS_INCONSISTENCY_FOUND.reason(e); } } @@ -1153,8 +1153,8 @@ protected BinaryDataAccessor getBinaryDataAccessor() { unitUserName = IndexNameEncoder.encodeEsIndexName(owner); } - return new BinaryDataAccessor(DcCoreConfig.getBlobStoreRoot(), unitUserName, - DcCoreConfig.getPhysicalDeleteMode(), DcCoreConfig.getFsyncEnabled()); + return new BinaryDataAccessor(PersoniumUnitConfig.getBlobStoreRoot(), unitUserName, + PersoniumUnitConfig.getPhysicalDeleteMode(), PersoniumUnitConfig.getFsyncEnabled()); } @Override @@ -1173,12 +1173,12 @@ public final String getNodeId() { } @Override - public final DcODataProducer getODataProducer() { + public final PersoniumODataProducer getODataProducer() { return ModelFactory.ODataCtl.userData(this.cell, this); } @Override - public final DcODataProducer getSchemaODataProducer(Cell cellObject) { + public final PersoniumODataProducer getSchemaODataProducer(Cell cellObject) { return ModelFactory.ODataCtl.userSchema(cellObject, this); } @@ -1209,7 +1209,7 @@ private String roleResourceUrlToId(String roleUrl, String baseUrl) { url = new URL(roleUrl); } } catch (MalformedURLException e) { - throw DcCoreException.Dav.ROLE_NOT_FOUND.reason(e); + throw PersoniumCoreException.Dav.ROLE_NOT_FOUND.reason(e); } Role role = null; @@ -1217,13 +1217,13 @@ private String roleResourceUrlToId(String roleUrl, String baseUrl) { role = new Role(url); } catch (MalformedURLException e) { log.info("Role URL:" + url.toString()); - throw DcCoreException.Dav.ROLE_NOT_FOUND; + throw PersoniumCoreException.Dav.ROLE_NOT_FOUND; } // ロールリソースのセルURL部分はACL設定対象のセルURLと異なるものを指定することは許さない if (!(this.cell.getUrl().equals(role.getBaseUrl()))) { - DcCoreLog.Dav.ROLE_NOT_FOUND.params("Cell different").writeLog(); - throw DcCoreException.Dav.ROLE_NOT_FOUND; + PersoniumCoreLog.Dav.ROLE_NOT_FOUND.params("Cell different").writeLog(); + throw PersoniumCoreException.Dav.ROLE_NOT_FOUND; } // Roleの検索 List> queries = new ArrayList>(); @@ -1237,7 +1237,7 @@ private String roleResourceUrlToId(String roleUrl, String baseUrl) { // Roleがボックスと紐付く場合に、検索クエリを追加 Box targetBox = this.cell.getBoxForName(role.getBoxName()); if (targetBox == null) { - throw DcCoreException.Dav.BOX_LINKED_BY_ROLE_NOT_FOUND.params(baseUrl); + throw PersoniumCoreException.Dav.BOX_LINKED_BY_ROLE_NOT_FOUND.params(baseUrl); } String boxId = targetBox.getId(); filters.add(QueryMapFactory.termQuery(KEY_LINK + "." + Box.EDM_TYPE_NAME, boxId)); @@ -1251,20 +1251,20 @@ private String roleResourceUrlToId(String roleUrl, String baseUrl) { source.put("filter", QueryMapFactory.andFilter(filters)); } source.put("query", query); - DcSearchHits hits = roleType.search(source).getHits(); + PersoniumSearchHits hits = roleType.search(source).getHits(); // 対象のRoleが存在しない場合はNull if (hits == null || hits.getCount() == 0) { - DcCoreLog.Dav.ROLE_NOT_FOUND.params("Not Hit").writeLog(); - throw DcCoreException.Dav.ROLE_NOT_FOUND; + PersoniumCoreLog.Dav.ROLE_NOT_FOUND.params("Not Hit").writeLog(); + throw PersoniumCoreException.Dav.ROLE_NOT_FOUND; } // 対象のRoleが複数件取得された場合は内部エラーとする if (hits.getAllPages() > 1) { - DcCoreLog.OData.FOUND_MULTIPLE_RECORDS.params(hits.getAllPages()).writeLog(); - throw DcCoreException.OData.DETECTED_INTERNAL_DATA_CONFLICT; + PersoniumCoreLog.OData.FOUND_MULTIPLE_RECORDS.params(hits.getAllPages()).writeLog(); + throw PersoniumCoreException.OData.DETECTED_INTERNAL_DATA_CONFLICT; } - DcSearchHit hit = hits.getHits()[0]; + PersoniumSearchHit hit = hits.getHits()[0]; return hit.getId(); } @@ -1322,7 +1322,7 @@ private String roleIdToRoleResourceUrl(String roleId) { String schema = null; EntitySetAccessor roleType = EsModel.cellCtl(this.cell, Role.EDM_TYPE_NAME); - DcGetResponse hit = roleType.get(roleId); + PersoniumGetResponse hit = roleType.get(roleId); if (hit == null || !hit.isExists()) { // ロールが存在しない場合、nullを返す。 @@ -1379,7 +1379,7 @@ private String baseUrlToRoleResourceUrl(String baseUrlStr, String roloResourceUr baseUrl = new Role(new URL(baseUrlStr + "__")); roloResourceUrl = new Role(new URL(roloResourceUrlStr)); } catch (MalformedURLException e) { - throw DcCoreException.Dav.ROLE_NOT_FOUND.reason(e); + throw PersoniumCoreException.Dav.ROLE_NOT_FOUND.reason(e); } if (baseUrl.getBoxName().equals(roloResourceUrl.getBoxName())) { // base:xmlのBOXとロールリソースURLのBOXが同じ場合 @@ -1455,11 +1455,11 @@ public String getUrl() { public static Map searchBox(final Cell cellObj, final String boxId) { EntitySetAccessor boxType = EsModel.box(cellObj); - DcGetResponse getRes = boxType.get(boxId); + PersoniumGetResponse getRes = boxType.get(boxId); if (getRes == null || !getRes.isExists()) { - DcCoreLog.Dav.ROLE_NOT_FOUND.params("Box Id Not Hit").writeLog(); + PersoniumCoreLog.Dav.ROLE_NOT_FOUND.params("Box Id Not Hit").writeLog(); - throw DcCoreException.Dav.ROLE_NOT_FOUND; + throw PersoniumCoreException.Dav.ROLE_NOT_FOUND; } return getRes.getSource(); } @@ -1470,8 +1470,8 @@ public static Map searchBox(final Cell cellObj, final String box * メッセージの付加情報は、ここでは設定せずに呼び出し元で設定すること。 * @return NotFound例外 */ - public DcCoreException getNotFoundException() { - return DcCoreException.Dav.RESOURCE_NOT_FOUND; + public PersoniumCoreException getNotFoundException() { + return PersoniumCoreException.Dav.RESOURCE_NOT_FOUND; } @Override public Cell getCell() { diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/DavNode.java b/src/main/java/io/personium/core/model/impl/es/DavNode.java similarity index 94% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/DavNode.java rename to src/main/java/io/personium/core/model/impl/es/DavNode.java index d0c6b6304..64c4ad0f0 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/DavNode.java +++ b/src/main/java/io/personium/core/model/impl/es/DavNode.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es; +package io.personium.core.model.impl.es; import java.util.Date; import java.util.HashMap; @@ -24,8 +24,8 @@ import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; -import com.fujitsu.dc.common.es.EsBulkRequest; -import com.fujitsu.dc.core.DcCoreException; +import io.personium.common.es.EsBulkRequest; +import io.personium.core.PersoniumCoreException; /** * DavのNodeデータを扱うクラス. @@ -131,7 +131,7 @@ public static DavNode createFromJsonString(String id, String jsonStr) { source = (JSONObject) parser.parse(jsonStr); } catch (ParseException e) { // ESのJSONが壊れている状態。 - throw DcCoreException.Dav.DAV_INCONSISTENCY_FOUND.reason(e); + throw PersoniumCoreException.Dav.DAV_INCONSISTENCY_FOUND.reason(e); } DavNode davNode = new DavNode(); davNode.setId(id); diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/EsModel.java b/src/main/java/io/personium/core/model/impl/es/EsModel.java similarity index 77% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/EsModel.java rename to src/main/java/io/personium/core/model/impl/es/EsModel.java index bc82ac918..827758e4b 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/EsModel.java +++ b/src/main/java/io/personium/core/model/impl/es/EsModel.java @@ -14,26 +14,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es; +package io.personium.core.model.impl.es; import java.util.Map; -import com.fujitsu.dc.common.es.EsClient; -import com.fujitsu.dc.common.es.EsClient.Event; -import com.fujitsu.dc.common.es.EsIndex; -import com.fujitsu.dc.common.es.EsRequestLogInfo; -import com.fujitsu.dc.common.es.EsType; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreLog; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.impl.es.accessor.CellAccessor; -import com.fujitsu.dc.core.model.impl.es.accessor.DataSourceAccessor; -import com.fujitsu.dc.core.model.impl.es.accessor.DavNodeAccessor; -import com.fujitsu.dc.core.model.impl.es.accessor.EntitySetAccessor; -import com.fujitsu.dc.core.model.impl.es.accessor.ODataEntityAccessor; -import com.fujitsu.dc.core.model.impl.es.accessor.ODataLinkAccessor; -import com.fujitsu.dc.core.model.impl.es.odata.UserDataODataProducer; +import io.personium.common.es.EsClient; +import io.personium.common.es.EsClient.Event; +import io.personium.common.es.EsIndex; +import io.personium.common.es.EsRequestLogInfo; +import io.personium.common.es.EsType; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreLog; +import io.personium.core.model.Box; +import io.personium.core.model.Cell; +import io.personium.core.model.impl.es.accessor.CellAccessor; +import io.personium.core.model.impl.es.accessor.DataSourceAccessor; +import io.personium.core.model.impl.es.accessor.DavNodeAccessor; +import io.personium.core.model.impl.es.accessor.EntitySetAccessor; +import io.personium.core.model.impl.es.accessor.ODataEntityAccessor; +import io.personium.core.model.impl.es.accessor.ODataLinkAccessor; +import io.personium.core.model.impl.es.odata.UserDataODataProducer; /** * 本アプリでElasticSearchを扱うモデル. @@ -47,21 +47,21 @@ public class EsModel { EsClient.setEventHandler(Event.connected, new EsClient.EventHandler() { @Override public void handleEvent(EsRequestLogInfo logInfo, Object... params) { - DcCoreLog.Es.CONNECTED.params(params).writeLog(); + PersoniumCoreLog.Es.CONNECTED.params(params).writeLog(); } }); // ESへの登録以外のリクエスト後にログを出力するハンドラを設定 EsClient.setEventHandler(Event.afterRequest, new EsClient.EventHandler() { @Override public void handleEvent(EsRequestLogInfo logInfo, Object... params) { - DcCoreLog.Es.AFTER_REQUEST.params(params).writeLog(); + PersoniumCoreLog.Es.AFTER_REQUEST.params(params).writeLog(); } }); // ESへのインデックス作成前にログを出力するハンドラを設定 EsClient.setEventHandler(Event.creatingIndex, new EsClient.EventHandler() { @Override public void handleEvent(EsRequestLogInfo logInfo, Object... params) { - DcCoreLog.Es.CREATING_INDEX.params(params).writeLog(); + PersoniumCoreLog.Es.CREATING_INDEX.params(params).writeLog(); } }); // ESへの登録リクエスト後にログを出力するハンドラを設定 @@ -80,18 +80,18 @@ public void handleEvent(EsRequestLogInfo logInfo, Object... params) { uuid = (String) staticFields.get("__id"); } } - DcCoreLog.Es.AFTER_CREATE.params(logInfo.getIndex(), + PersoniumCoreLog.Es.AFTER_CREATE.params(logInfo.getIndex(), logInfo.getType(), logInfo.getId(), logInfo.getOpType(), uuid).writeLog(); - DcCoreLog.Es.AFTER_CREATE_BODY.params(logInfo.getDataAsString()).writeLog(); + PersoniumCoreLog.Es.AFTER_CREATE_BODY.params(logInfo.getDataAsString()).writeLog(); } else { - DcCoreLog.Es.AFTER_CREATE.params(logInfo.getIndex(), logInfo.getType(), + PersoniumCoreLog.Es.AFTER_CREATE.params(logInfo.getIndex(), logInfo.getType(), logInfo.getId(), logInfo.getOpType(), logInfo.getDataAsString()).writeLog(); } } }); - esClient = new EsClient(DcCoreConfig.getEsClusterName(), DcCoreConfig.getEsHosts()); + esClient = new EsClient(PersoniumUnitConfig.getEsClusterName(), PersoniumUnitConfig.getEsHosts()); } private EsModel() { @@ -110,9 +110,9 @@ public static EsClient client() { * @return Indexオブジェクト */ public static EsIndex idxAdmin() { - return esClient.idxAdmin(DcCoreConfig.getEsUnitPrefix(), - Integer.valueOf(DcCoreConfig.getESRetryTimes()), - Integer.valueOf(DcCoreConfig.getESRetryInterval())); + return esClient.idxAdmin(PersoniumUnitConfig.getEsUnitPrefix(), + Integer.valueOf(PersoniumUnitConfig.getESRetryTimes()), + Integer.valueOf(PersoniumUnitConfig.getESRetryInterval())); } /** @@ -121,10 +121,10 @@ public static EsIndex idxAdmin() { * @return Indexオブジェクト */ public static EsIndex idxUser(String userUri) { - return esClient.idxUser(DcCoreConfig.getEsUnitPrefix(), + return esClient.idxUser(PersoniumUnitConfig.getEsUnitPrefix(), userUri, - Integer.valueOf(DcCoreConfig.getESRetryTimes()), - Integer.valueOf(DcCoreConfig.getESRetryInterval())); + Integer.valueOf(PersoniumUnitConfig.getESRetryTimes()), + Integer.valueOf(PersoniumUnitConfig.getESRetryInterval())); } /** @@ -134,8 +134,8 @@ public static EsIndex idxUser(String userUri) { */ public static EsIndex idxUserWithUnitPrefix(String indexName) { return esClient.idxUser(indexName, - Integer.valueOf(DcCoreConfig.getESRetryTimes()), - Integer.valueOf(DcCoreConfig.getESRetryInterval())); + Integer.valueOf(PersoniumUnitConfig.getESRetryTimes()), + Integer.valueOf(PersoniumUnitConfig.getESRetryInterval())); } /** diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/QueryMapFactory.java b/src/main/java/io/personium/core/model/impl/es/QueryMapFactory.java similarity index 96% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/QueryMapFactory.java rename to src/main/java/io/personium/core/model/impl/es/QueryMapFactory.java index cd6367783..acf6053cf 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/QueryMapFactory.java +++ b/src/main/java/io/personium/core/model/impl/es/QueryMapFactory.java @@ -14,14 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es; +package io.personium.core.model.impl.es; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import com.fujitsu.dc.core.model.impl.es.doc.OEntityDocHandler; +import io.personium.core.model.impl.es.doc.OEntityDocHandler; /** * 検索に使用するためのMapを生成するFactoryクラス. diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/AbstractEntitySetAccessor.java b/src/main/java/io/personium/core/model/impl/es/accessor/AbstractEntitySetAccessor.java similarity index 75% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/AbstractEntitySetAccessor.java rename to src/main/java/io/personium/core/model/impl/es/accessor/AbstractEntitySetAccessor.java index 03d30c0dc..ec36b6502 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/AbstractEntitySetAccessor.java +++ b/src/main/java/io/personium/core/model/impl/es/accessor/AbstractEntitySetAccessor.java @@ -14,13 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.accessor; +package io.personium.core.model.impl.es.accessor; -import com.fujitsu.dc.common.es.EsIndex; -import com.fujitsu.dc.common.es.response.DcDeleteResponse; -import com.fujitsu.dc.common.es.response.DcIndexResponse; -import com.fujitsu.dc.common.es.util.DcUUID; -import com.fujitsu.dc.core.model.impl.es.doc.EntitySetDocHandler; +import io.personium.common.es.EsIndex; +import io.personium.common.es.response.PersoniumDeleteResponse; +import io.personium.common.es.response.PersoniumIndexResponse; +import io.personium.common.es.util.PersoniumUUID; +import io.personium.core.model.impl.es.doc.EntitySetDocHandler; /** * ODataEntityのアクセス処理の抽象クラス. @@ -68,8 +68,8 @@ protected AbstractEntitySetAccessor(EsIndex index, String name, String routingId * @return 登録結果 */ @Override - public DcIndexResponse create(final EntitySetDocHandler docHandler) { - String id = DcUUID.randomUUID(); + public PersoniumIndexResponse create(final EntitySetDocHandler docHandler) { + String id = PersoniumUUID.randomUUID(); return create(id, docHandler); } @@ -79,11 +79,11 @@ public DcIndexResponse create(final EntitySetDocHandler docHandler) { * @param docHandler 登録データ * @return 登録結果 */ - public DcIndexResponse create(String id, EntitySetDocHandler docHandler) { + public PersoniumIndexResponse create(String id, EntitySetDocHandler docHandler) { // マスタ書き込みでエラーが発生したためES更新を不可能とする prepareDataUpdate(getIndex().getName()); docHandler.setId(id); - DcIndexResponse response = create(id, docHandler.getSource(), docHandler); + PersoniumIndexResponse response = create(id, docHandler.getSource(), docHandler); createAds(docHandler); return response; } @@ -95,7 +95,7 @@ public DcIndexResponse create(String id, EntitySetDocHandler docHandler) { * @return 更新結果 */ @Override - public DcIndexResponse update(String id, EntitySetDocHandler docHandler) { + public PersoniumIndexResponse update(String id, EntitySetDocHandler docHandler) { return this.update(id, docHandler, -1); } @@ -106,10 +106,10 @@ public DcIndexResponse update(String id, EntitySetDocHandler docHandler) { * @param version バージョン情報 * @return 更新結果 */ - public DcIndexResponse update(String id, EntitySetDocHandler docHandler, long version) { + public PersoniumIndexResponse update(String id, EntitySetDocHandler docHandler, long version) { // マスタ書き込みでエラーが発生したためES更新を不可能とする prepareDataUpdate(getIndex().getName()); - DcIndexResponse response = update(id, docHandler.getSource(), version); + PersoniumIndexResponse response = update(id, docHandler.getSource(), version); updateAds(docHandler, response.getVersion()); return response; } @@ -120,7 +120,7 @@ public DcIndexResponse update(String id, EntitySetDocHandler docHandler, long ve * @return 削除結果 */ @Override - public DcDeleteResponse delete(final EntitySetDocHandler docHandler) { + public PersoniumDeleteResponse delete(final EntitySetDocHandler docHandler) { return this.delete(docHandler, -1); } @@ -131,12 +131,12 @@ public DcDeleteResponse delete(final EntitySetDocHandler docHandler) { * @return 削除結果 */ @Override - public DcDeleteResponse delete(EntitySetDocHandler docHandler, long version) { + public PersoniumDeleteResponse delete(EntitySetDocHandler docHandler, long version) { String id = docHandler.getId(); // マスタ書き込みでエラーが発生したためES更新を不可能とする super.prepareDataUpdate(getIndex().getName()); - DcDeleteResponse response = super.delete(id, version); + PersoniumDeleteResponse response = super.delete(id, version); deleteAds(docHandler, response.getVersion()); return response; } diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/CellAccessor.java b/src/main/java/io/personium/core/model/impl/es/accessor/CellAccessor.java similarity index 83% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/CellAccessor.java rename to src/main/java/io/personium/core/model/impl/es/accessor/CellAccessor.java index 73787e394..726bc233c 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/CellAccessor.java +++ b/src/main/java/io/personium/core/model/impl/es/accessor/CellAccessor.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.accessor; +package io.personium.core.model.impl.es.accessor; import java.sql.SQLException; import java.util.ArrayList; @@ -22,21 +22,21 @@ import java.util.List; import java.util.Map; -import com.fujitsu.dc.common.ads.AdsWriteFailureLogInfo; -import com.fujitsu.dc.common.es.EsIndex; -import com.fujitsu.dc.common.es.query.DcQueryBuilder; -import com.fujitsu.dc.common.es.query.DcQueryBuilders; -import com.fujitsu.dc.common.es.response.DcSearchHit; -import com.fujitsu.dc.common.es.response.DcSearchResponse; -import com.fujitsu.dc.common.es.response.EsClientException; -import com.fujitsu.dc.core.DcCoreLog; -import com.fujitsu.dc.core.model.DavCmp; -import com.fujitsu.dc.core.model.impl.es.EsModel; -import com.fujitsu.dc.core.model.impl.es.QueryMapFactory; -import com.fujitsu.dc.core.model.impl.es.ads.AdsException; -import com.fujitsu.dc.core.model.impl.es.doc.EntitySetDocHandler; -import com.fujitsu.dc.core.model.lock.Lock; -import com.fujitsu.dc.core.model.lock.LockKeyComposer; +import io.personium.common.ads.AdsWriteFailureLogInfo; +import io.personium.common.es.EsIndex; +import io.personium.common.es.query.PersoniumQueryBuilder; +import io.personium.common.es.query.PersoniumQueryBuilders; +import io.personium.common.es.response.PersoniumSearchHit; +import io.personium.common.es.response.PersoniumSearchResponse; +import io.personium.common.es.response.EsClientException; +import io.personium.core.PersoniumCoreLog; +import io.personium.core.model.DavCmp; +import io.personium.core.model.impl.es.EsModel; +import io.personium.core.model.impl.es.QueryMapFactory; +import io.personium.core.model.impl.es.ads.AdsException; +import io.personium.core.model.impl.es.doc.EntitySetDocHandler; +import io.personium.core.model.lock.Lock; +import io.personium.core.model.lock.LockKeyComposer; /** * Cellのアクセス処理を実装したクラス. @@ -67,7 +67,7 @@ public long getDavFileTotalCount(String cellId, String unitUserName) { Map countQuery = getDavFileFilterQuery(cellId); countQuery.put("size", 0); - DcSearchResponse response = accessor.searchForIndex(cellId, countQuery); + PersoniumSearchResponse response = accessor.searchForIndex(cellId, countQuery); return response.getHits().getAllPages(); } @@ -87,9 +87,9 @@ public List getDavFileIdList(String cellId, String unitUserName, int siz searchQuery.put("size", size); searchQuery.put("from", from); - DcSearchResponse response = accessor.searchForIndex(cellId, searchQuery); + PersoniumSearchResponse response = accessor.searchForIndex(cellId, searchQuery); List davFileIdList = new ArrayList(); - for (DcSearchHit hit : response.getHits().getHits()) { + for (PersoniumSearchHit hit : response.getHits().getHits()) { davFileIdList.add(hit.getId()); } return davFileIdList; @@ -128,7 +128,7 @@ public void cellBulkDeletion(String cellId, String unitUserName) { DataSourceAccessor accessor = EsModel.dsa(unitUserName); // セルIDを指定してelasticsearchからセル関連エンティティを一括削除する - DcQueryBuilder matchQuery = DcQueryBuilders.matchQuery("c", cellId); + PersoniumQueryBuilder matchQuery = PersoniumQueryBuilders.matchQuery("c", cellId); try { accessor.deleteByQuery(cellId, matchQuery); log.info("KVS Deletion Success."); @@ -164,12 +164,12 @@ protected void createAds(EntitySetDocHandler docHandler) { // Indexが存在しない場合はインデックスを作成する。 if (e.getCause() instanceof SQLException && MYSQL_BAD_TABLE_ERROR.equals(((SQLException) e.getCause()).getSQLState())) { - DcCoreLog.Server.ES_INDEX_NOT_EXIST.params(unitUserName).writeLog(); + PersoniumCoreLog.Server.ES_INDEX_NOT_EXIST.params(unitUserName).writeLog(); createAdsIndex(unitUserName); try { getAds().createCell(unitUserName, docHandler); } catch (AdsException e1) { - DcCoreLog.Server.DATA_STORE_ENTITY_CREATE_FAIL.params(e1.getMessage()).reason(e1).writeLog(); + PersoniumCoreLog.Server.DATA_STORE_ENTITY_CREATE_FAIL.params(e1.getMessage()).reason(e1).writeLog(); // Adsの登録に失敗した場合は、専用のログに書込む String lockKey = LockKeyComposer.fullKeyFromCategoryAndKey(Lock.CATEGORY_ODATA, @@ -181,7 +181,7 @@ protected void createAds(EntitySetDocHandler docHandler) { recordAdsWriteFailureLog(loginfo); } } else { - DcCoreLog.Server.DATA_STORE_ENTITY_CREATE_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.DATA_STORE_ENTITY_CREATE_FAIL.params(e.getMessage()).reason(e).writeLog(); // Adsの登録に失敗した場合は、専用のログに書込む String lockKey = LockKeyComposer.fullKeyFromCategoryAndKey(Lock.CATEGORY_ODATA, @@ -208,7 +208,7 @@ protected void updateAds(EntitySetDocHandler docHandler, long version) { try { getAds().updateCell(docHandler.getUnitUserName(), docHandler); } catch (AdsException e) { - DcCoreLog.Server.DATA_STORE_ENTITY_UPDATE_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.DATA_STORE_ENTITY_UPDATE_FAIL.params(e.getMessage()).reason(e).writeLog(); // Adsの登録に失敗した場合は、専用のログに書込む String lockKey = LockKeyComposer.fullKeyFromCategoryAndKey(Lock.CATEGORY_ODATA, @@ -237,7 +237,7 @@ protected void deleteAds(EntitySetDocHandler docHandler, long version) { try { getAds().deleteCell(unitUserName, id); } catch (AdsException e) { - DcCoreLog.Server.DATA_STORE_ENTITY_DELETE_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.DATA_STORE_ENTITY_DELETE_FAIL.params(e.getMessage()).reason(e).writeLog(); // Adsの登録に失敗した場合は、専用のログに書込む String lockKey = LockKeyComposer.fullKeyFromCategoryAndKey(Lock.CATEGORY_ODATA, diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/CellDeleteAccessor.java b/src/main/java/io/personium/core/model/impl/es/accessor/CellDeleteAccessor.java similarity index 70% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/CellDeleteAccessor.java rename to src/main/java/io/personium/core/model/impl/es/accessor/CellDeleteAccessor.java index d59e40e00..b6a863098 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/CellDeleteAccessor.java +++ b/src/main/java/io/personium/core/model/impl/es/accessor/CellDeleteAccessor.java @@ -14,21 +14,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.accessor; +package io.personium.core.model.impl.es.accessor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.ads.AdsWriteFailureLogException; -import com.fujitsu.dc.common.ads.AdsWriteFailureLogInfo; -import com.fujitsu.dc.common.ads.AdsWriteFailureLogWriter; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.DcCoreLog; -import com.fujitsu.dc.core.model.impl.es.ads.Ads; -import com.fujitsu.dc.core.model.impl.es.ads.AdsConnectionException; -import com.fujitsu.dc.core.model.impl.es.ads.AdsException; -import com.fujitsu.dc.core.model.impl.es.ads.JdbcAds; +import io.personium.common.ads.AdsWriteFailureLogException; +import io.personium.common.ads.AdsWriteFailureLogInfo; +import io.personium.common.ads.AdsWriteFailureLogWriter; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.PersoniumCoreLog; +import io.personium.core.model.impl.es.ads.Ads; +import io.personium.core.model.impl.es.ads.AdsConnectionException; +import io.personium.core.model.impl.es.ads.AdsException; +import io.personium.core.model.impl.es.ads.JdbcAds; /** * Cell削除管理テーブルのアクセス処理を実装したクラス. @@ -44,15 +44,15 @@ public class CellDeleteAccessor { */ public CellDeleteAccessor() { try { - if (DcCoreConfig.getEsAdsType().equals(DcCoreConfig.ES.ADS.TYPE_JDBC)) { + if (PersoniumUnitConfig.getEsAdsType().equals(PersoniumUnitConfig.ES.ADS.TYPE_JDBC)) { ads = new JdbcAds(); } else { ads = null; } } catch (AdsConnectionException e) { // 接続エラー時は接続エラーのログを出力する. - DcCoreLog.Server.ADS_CONNECTION_ERROR.params(e.getMessage()).reason(e).writeLog(); - throw DcCoreException.Server.ADS_CONNECTION_ERROR; + PersoniumCoreLog.Server.ADS_CONNECTION_ERROR.params(e.getMessage()).reason(e).writeLog(); + throw PersoniumCoreException.Server.ADS_CONNECTION_ERROR; } } @@ -100,17 +100,17 @@ public void insertCellDeleteRecord(String dbName, String cellId) { // Cell再帰削除のときは、DB名、Cell IDのみログに書込む // ※Cell再帰削除時にAdsに登録する情報としては、他にTable名があるが、ここでは意識しない AdsWriteFailureLogWriter adsWriteFailureLogWriter = AdsWriteFailureLogWriter.getInstance( - DcCoreConfig.getAdsWriteFailureLogDir(), - DcCoreConfig.getCoreVersion(), - DcCoreConfig.getAdsWriteFailureLogPhysicalDelete()); + PersoniumUnitConfig.getAdsWriteFailureLogDir(), + PersoniumUnitConfig.getCoreVersion(), + PersoniumUnitConfig.getAdsWriteFailureLogPhysicalDelete()); AdsWriteFailureLogInfo loginfo = new AdsWriteFailureLogInfo( dbName, null, null, null, cellId, AdsWriteFailureLogInfo.OperationKind.PCS_MANAGEMENT_INSERT, 0, 0); try { adsWriteFailureLogWriter.writeActiveFile(loginfo); } catch (AdsWriteFailureLogException e2) { - DcCoreLog.Server.WRITE_ADS_FAILURE_LOG_ERROR.reason(e2).writeLog(); - DcCoreLog.Server.WRITE_ADS_FAILURE_LOG_INFO.params(loginfo.toString()); + PersoniumCoreLog.Server.WRITE_ADS_FAILURE_LOG_ERROR.reason(e2).writeLog(); + PersoniumCoreLog.Server.WRITE_ADS_FAILURE_LOG_INFO.params(loginfo.toString()); } } diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/DataSourceAccessor.java b/src/main/java/io/personium/core/model/impl/es/accessor/DataSourceAccessor.java similarity index 68% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/DataSourceAccessor.java rename to src/main/java/io/personium/core/model/impl/es/accessor/DataSourceAccessor.java index de2cdb01a..f761fcdcc 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/DataSourceAccessor.java +++ b/src/main/java/io/personium/core/model/impl/es/accessor/DataSourceAccessor.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.accessor; +package io.personium.core.model.impl.es.accessor; import java.util.HashMap; import java.util.List; @@ -23,34 +23,34 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.ads.AdsWriteFailureLogException; -import com.fujitsu.dc.common.ads.AdsWriteFailureLogInfo; -import com.fujitsu.dc.common.ads.AdsWriteFailureLogWriter; -import com.fujitsu.dc.common.es.EsBulkRequest; -import com.fujitsu.dc.common.es.EsIndex; -import com.fujitsu.dc.common.es.EsType; -import com.fujitsu.dc.common.es.query.DcQueryBuilder; -import com.fujitsu.dc.common.es.response.DcActionResponse; -import com.fujitsu.dc.common.es.response.DcBulkItemResponse; -import com.fujitsu.dc.common.es.response.DcBulkResponse; -import com.fujitsu.dc.common.es.response.DcDeleteResponse; -import com.fujitsu.dc.common.es.response.DcGetResponse; -import com.fujitsu.dc.common.es.response.DcIndexResponse; -import com.fujitsu.dc.common.es.response.DcMultiSearchResponse; -import com.fujitsu.dc.common.es.response.DcSearchResponse; -import com.fujitsu.dc.common.es.response.EsClientException; -import com.fujitsu.dc.common.es.util.DcUUID; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.DcCoreLog; -import com.fujitsu.dc.core.model.impl.es.EsModel; -import com.fujitsu.dc.core.model.impl.es.ads.AdsConnectionException; -import com.fujitsu.dc.core.model.impl.es.ads.AdsException; -import com.fujitsu.dc.core.model.impl.es.ads.JdbcAds; -import com.fujitsu.dc.core.model.impl.es.doc.EntitySetDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.LinkDocHandler; -import com.fujitsu.dc.core.model.lock.Lock; -import com.fujitsu.dc.core.model.lock.LockKeyComposer; +import io.personium.common.ads.AdsWriteFailureLogException; +import io.personium.common.ads.AdsWriteFailureLogInfo; +import io.personium.common.ads.AdsWriteFailureLogWriter; +import io.personium.common.es.EsBulkRequest; +import io.personium.common.es.EsIndex; +import io.personium.common.es.EsType; +import io.personium.common.es.query.PersoniumQueryBuilder; +import io.personium.common.es.response.PersoniumActionResponse; +import io.personium.common.es.response.PersoniumBulkItemResponse; +import io.personium.common.es.response.PersoniumBulkResponse; +import io.personium.common.es.response.PersoniumDeleteResponse; +import io.personium.common.es.response.PersoniumGetResponse; +import io.personium.common.es.response.PersoniumIndexResponse; +import io.personium.common.es.response.PersoniumMultiSearchResponse; +import io.personium.common.es.response.PersoniumSearchResponse; +import io.personium.common.es.response.EsClientException; +import io.personium.common.es.util.PersoniumUUID; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.PersoniumCoreLog; +import io.personium.core.model.impl.es.EsModel; +import io.personium.core.model.impl.es.ads.AdsConnectionException; +import io.personium.core.model.impl.es.ads.AdsException; +import io.personium.core.model.impl.es.ads.JdbcAds; +import io.personium.core.model.impl.es.doc.EntitySetDocHandler; +import io.personium.core.model.impl.es.doc.LinkDocHandler; +import io.personium.core.model.lock.Lock; +import io.personium.core.model.lock.LockKeyComposer; /** * データストア層の基本処理を実装した基底クラス. @@ -71,15 +71,15 @@ public class DataSourceAccessor { public DataSourceAccessor(EsIndex index) { this.index = index; try { - if (DcCoreConfig.getEsAdsType().equals(DcCoreConfig.ES.ADS.TYPE_JDBC)) { + if (PersoniumUnitConfig.getEsAdsType().equals(PersoniumUnitConfig.ES.ADS.TYPE_JDBC)) { ads = new JdbcAds(); } else { ads = null; } } catch (AdsConnectionException ex) { // 初回接続エラー時は接続エラーのログを出力する. - DcCoreLog.Server.ADS_CONNECTION_ERROR.params(ex.getMessage()).reason(ex).writeLog(); - throw DcCoreException.Server.ADS_CONNECTION_ERROR; + PersoniumCoreLog.Server.ADS_CONNECTION_ERROR.params(ex.getMessage()).reason(ex).writeLog(); + throw PersoniumCoreException.Server.ADS_CONNECTION_ERROR; } } @@ -91,20 +91,20 @@ public DataSourceAccessor(EsIndex index) { */ protected DataSourceAccessor(EsIndex index, String name, String routingId) { this.index = index; - int times = Integer.valueOf(DcCoreConfig.getESRetryTimes()); - int interval = Integer.valueOf(DcCoreConfig.getESRetryInterval()); + int times = Integer.valueOf(PersoniumUnitConfig.getESRetryTimes()); + int interval = Integer.valueOf(PersoniumUnitConfig.getESRetryInterval()); this.type = EsModel.type(index.getName(), name, routingId, times, interval); this.routingid = routingId; try { - if (DcCoreConfig.getEsAdsType().equals(DcCoreConfig.ES.ADS.TYPE_JDBC)) { + if (PersoniumUnitConfig.getEsAdsType().equals(PersoniumUnitConfig.ES.ADS.TYPE_JDBC)) { ads = new JdbcAds(); } else { ads = null; } } catch (AdsConnectionException ex) { // 初回接続エラー時は接続エラーのログを出力する. - DcCoreLog.Server.ADS_CONNECTION_ERROR.params(ex.getMessage()).reason(ex).writeLog(); - throw DcCoreException.Server.ADS_CONNECTION_ERROR; + PersoniumCoreLog.Server.ADS_CONNECTION_ERROR.params(ex.getMessage()).reason(ex).writeLog(); + throw PersoniumCoreException.Server.ADS_CONNECTION_ERROR; } } @@ -153,11 +153,11 @@ protected String getRoutingId() { * @param id ドキュメントのID * @return 応答 */ - public DcGetResponse get(final String id) { + public PersoniumGetResponse get(final String id) { try { return this.type.get(id); } catch (EsClientException.EsNoResponseException e) { - throw DcCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); + throw PersoniumCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); } } @@ -167,8 +167,8 @@ public DcGetResponse get(final String id) { * @return ES応答 */ @SuppressWarnings("rawtypes") - public DcIndexResponse create(final Map data) { - String id = DcUUID.randomUUID(); + public PersoniumIndexResponse create(final Map data) { + String id = PersoniumUUID.randomUUID(); return this.create(id, data); } @@ -179,8 +179,8 @@ public DcIndexResponse create(final Map data) { * @return ES応答 */ @SuppressWarnings({"rawtypes" }) - public DcActionResponse createForDavNodeFile(final String id, final Map data) { - DcIndexResponse res = create(id, data); + public PersoniumActionResponse createForDavNodeFile(final String id, final Map data) { + PersoniumIndexResponse res = create(id, data); return res; } @@ -191,22 +191,22 @@ public DcActionResponse createForDavNodeFile(final String id, final Map data) { * @return ES応答 */ @SuppressWarnings({"rawtypes" }) - public DcIndexResponse create(final String id, final Map data) { + public PersoniumIndexResponse create(final String id, final Map data) { try { return this.type.create(id, data); } catch (EsClientException.EsSchemaMismatchException e) { - throw DcCoreException.OData.SCHEMA_MISMATCH; + throw PersoniumCoreException.OData.SCHEMA_MISMATCH; } catch (EsClientException.EsIndexMissingException e) { - DcCoreLog.Server.ES_INDEX_NOT_EXIST.params(this.index.getName()).writeLog(); + PersoniumCoreLog.Server.ES_INDEX_NOT_EXIST.params(this.index.getName()).writeLog(); try { this.index.create(); createAdsIndex(null); return this.type.create(id, data); } catch (EsClientException.EsNoResponseException esRetry) { - throw DcCoreException.Server.ES_RETRY_OVER.params(esRetry.getMessage()); + throw PersoniumCoreException.Server.ES_RETRY_OVER.params(esRetry.getMessage()); } } catch (EsClientException.EsNoResponseException e) { - throw DcCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); + throw PersoniumCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); } } @@ -218,22 +218,22 @@ public DcIndexResponse create(final String id, final Map data) { * @return ES応答 */ @SuppressWarnings({"rawtypes" }) - public DcIndexResponse create(final String id, final Map data, final EntitySetDocHandler docHandler) { + public PersoniumIndexResponse create(final String id, final Map data, final EntitySetDocHandler docHandler) { try { return this.type.create(id, data); } catch (EsClientException.EsSchemaMismatchException e) { - throw DcCoreException.OData.SCHEMA_MISMATCH; + throw PersoniumCoreException.OData.SCHEMA_MISMATCH; } catch (EsClientException.EsIndexMissingException e) { - DcCoreLog.Server.ES_INDEX_NOT_EXIST.params(this.index.getName()).writeLog(); + PersoniumCoreLog.Server.ES_INDEX_NOT_EXIST.params(this.index.getName()).writeLog(); try { this.index.create(); createAdsIndex(docHandler.getUnitUserName()); return this.type.create(id, data); } catch (EsClientException.EsNoResponseException esRetry) { - throw DcCoreException.Server.ES_RETRY_OVER.params(esRetry.getMessage()); + throw PersoniumCoreException.Server.ES_RETRY_OVER.params(esRetry.getMessage()); } } catch (EsClientException.EsNoResponseException e) { - throw DcCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); + throw PersoniumCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); } } @@ -245,22 +245,22 @@ public DcIndexResponse create(final String id, final Map data, final EntitySetDo * @return ES応答 */ @SuppressWarnings({"rawtypes" }) - public DcIndexResponse update(final String id, final Map data, final long version) { + public PersoniumIndexResponse update(final String id, final Map data, final long version) { try { return this.type.update(id, data, version); } catch (EsClientException.EsSchemaMismatchException e) { - throw DcCoreException.OData.SCHEMA_MISMATCH; + throw PersoniumCoreException.OData.SCHEMA_MISMATCH; } catch (EsClientException.EsIndexMissingException e) { - DcCoreLog.Server.ES_INDEX_NOT_EXIST.params(this.index.getName()).writeLog(); + PersoniumCoreLog.Server.ES_INDEX_NOT_EXIST.params(this.index.getName()).writeLog(); try { this.index.create(); createAdsIndex(null); return this.type.update(id, data, version); } catch (EsClientException.EsNoResponseException esRetry) { - throw DcCoreException.Server.ES_RETRY_OVER.params(esRetry.getMessage()); + throw PersoniumCoreException.Server.ES_RETRY_OVER.params(esRetry.getMessage()); } } catch (EsClientException.EsNoResponseException e) { - throw DcCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); + throw PersoniumCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); } } @@ -271,7 +271,7 @@ public DcIndexResponse update(final String id, final Map data, final long versio * @return ES応答 */ @SuppressWarnings("rawtypes") - public DcIndexResponse update(final String id, final Map data) { + public PersoniumIndexResponse update(final String id, final Map data) { return this.update(id, data, -1); } @@ -289,10 +289,10 @@ public long count(final Map query) { } requestQuery.put("size", 0); try { - DcSearchResponse hit = this.type.search(requestQuery); + PersoniumSearchResponse hit = this.type.search(requestQuery); return hit.getHits().getAllPages(); } catch (EsClientException.EsNoResponseException e) { - throw DcCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); + throw PersoniumCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); } } @@ -301,7 +301,7 @@ public long count(final Map query) { * @param query クエリ情報 * @return ES応答 */ - public DcSearchResponse search(final Map query) { + public PersoniumSearchResponse search(final Map query) { Map requestQuery = null; if (query != null) { requestQuery = new HashMap(query); @@ -315,7 +315,7 @@ public DcSearchResponse search(final Map query) { try { return this.type.search(requestQuery); } catch (EsClientException.EsNoResponseException e) { - throw DcCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); + throw PersoniumCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); } } @@ -325,11 +325,11 @@ public DcSearchResponse search(final Map query) { * @param queryList クエリ情報の一覧 * @return ES応答 */ - public DcMultiSearchResponse multiSearch(final List> queryList) { + public PersoniumMultiSearchResponse multiSearch(final List> queryList) { try { return this.type.multiSearch(queryList); } catch (EsClientException.EsNoResponseException e) { - throw DcCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); + throw PersoniumCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); } } @@ -339,7 +339,7 @@ public DcMultiSearchResponse multiSearch(final List> queryLi * @param query クエリ情報 * @return ES応答 */ - public DcSearchResponse indexSearch(final Map query) { + public PersoniumSearchResponse indexSearch(final Map query) { Map requestQuery = null; if (query == null) { requestQuery = new HashMap(); @@ -353,7 +353,7 @@ public DcSearchResponse indexSearch(final Map query) { try { return this.index.search(null, requestQuery); } catch (EsClientException.EsNoResponseException e) { - throw DcCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); + throw PersoniumCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); } } @@ -363,14 +363,14 @@ public DcSearchResponse indexSearch(final Map query) { * @param version The version of the document to delete * @return 応答 */ - public DcDeleteResponse delete(final String docId, final long version) { + public PersoniumDeleteResponse delete(final String docId, final long version) { try { return this.type.delete(docId, version); } catch (EsClientException.EsIndexMissingException e) { - DcCoreLog.Server.ES_INDEX_NOT_EXIST.params(this.index.getName()).writeLog(); + PersoniumCoreLog.Server.ES_INDEX_NOT_EXIST.params(this.index.getName()).writeLog(); return null; } catch (EsClientException.EsNoResponseException e) { - throw DcCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); + throw PersoniumCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); } } @@ -382,23 +382,23 @@ public DcDeleteResponse delete(final String docId, final long version) { * @param routingId routingId * @return バルクレスポンス */ - public DcBulkResponse bulkCreate(List esBulkRequest, + public PersoniumBulkResponse bulkCreate(List esBulkRequest, List adsBulkRequest, String routingId) { // マスタ書き込みでエラーが発生したためES更新を不可能とする prepareDataUpdate(this.index.getName()); - DcBulkResponse response = null; + PersoniumBulkResponse response = null; try { response = this.index.bulkRequest(routingId, esBulkRequest, false); } catch (EsClientException.EsNoResponseException e) { - throw DcCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); + throw PersoniumCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); } if (this.ads != null) { try { this.ads.bulkEntity(this.index.getName(), adsBulkRequest); } catch (AdsException e) { - DcCoreLog.Server.DATA_STORE_ENTITY_BULK_CREATE_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.DATA_STORE_ENTITY_BULK_CREATE_FAIL.params(e.getMessage()).reason(e).writeLog(); for (EntitySetDocHandler docHandler : adsBulkRequest) { // Adsの登録に失敗した場合は、専用のログに書込む @@ -424,18 +424,18 @@ public DcBulkResponse bulkCreate(List esBulkRequest, * @param routingId routingId * @return バルクレスポンス */ - public DcBulkResponse bulkUpdateLink(List esBulkRequest, + public PersoniumBulkResponse bulkUpdateLink(List esBulkRequest, List adsBulkEntityRequest, List adsBulkLinkRequest, String routingId) { // マスタ書き込みでエラーが発生したためES更新を不可能とする prepareDataUpdate(this.index.getName()); - DcBulkResponse response = null; + PersoniumBulkResponse response = null; try { response = this.index.bulkRequest(routingId, esBulkRequest, false); } catch (EsClientException.EsNoResponseException e) { - throw DcCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); + throw PersoniumCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); } if (this.ads != null) { try { @@ -444,11 +444,11 @@ public DcBulkResponse bulkUpdateLink(List esBulkRequest, this.ads.bulkUpdateEntity(this.index.getName(), adsBulkEntityRequest); } } catch (AdsException e) { - DcCoreLog.Server.DATA_STORE_ENTITY_BULK_CREATE_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.DATA_STORE_ENTITY_BULK_CREATE_FAIL.params(e.getMessage()).reason(e).writeLog(); // Adsの登録に失敗した場合は、専用のログに書込む // ESでのバージョン情報を取得するためにesBulkRequestをループさせている - DcBulkItemResponse[] responseItems = response.items(); + PersoniumBulkItemResponse[] responseItems = response.items(); int responseIndex = 0; int adsBulkEntityRequestIndex = 0; for (EsBulkRequest request : esBulkRequest) { @@ -456,7 +456,7 @@ public DcBulkResponse bulkUpdateLink(List esBulkRequest, responseIndex++; continue; } - DcBulkItemResponse itemResponse = responseItems[responseIndex++]; + PersoniumBulkItemResponse itemResponse = responseItems[responseIndex++]; EntitySetDocHandler docHandler = adsBulkEntityRequest.get(adsBulkEntityRequestIndex++); String lockKey = LockKeyComposer.fullKeyFromCategoryAndKey(Lock.CATEGORY_ODATA, docHandler.getCellId(), null, docHandler.getNodeId()); @@ -474,7 +474,7 @@ public DcBulkResponse bulkUpdateLink(List esBulkRequest, this.ads.bulkCreateLink(this.index.getName(), adsBulkLinkRequest); } } catch (AdsException e) { - DcCoreLog.Server.DATA_STORE_ENTITY_BULK_CREATE_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.DATA_STORE_ENTITY_BULK_CREATE_FAIL.params(e.getMessage()).reason(e).writeLog(); for (LinkDocHandler docHandler : adsBulkLinkRequest) { // Adsの登録に失敗した場合は、専用のログに書込む @@ -496,7 +496,7 @@ public DcBulkResponse bulkUpdateLink(List esBulkRequest, * @param routingId routingId * @param deleteQuery 削除対象を指定するクエリ */ - protected void deleteByQuery(String routingId, DcQueryBuilder deleteQuery) { + protected void deleteByQuery(String routingId, PersoniumQueryBuilder deleteQuery) { this.index.deleteByQuery(routingId, deleteQuery); } @@ -518,21 +518,21 @@ protected void cellBulkDeletionAds(String cellId, String unitUserName) throws Ad * @param query 検索クエリ * @return 検索結果 */ - public DcSearchResponse searchForIndex(String routingId, Map query) { + public PersoniumSearchResponse searchForIndex(String routingId, Map query) { try { if (!query.containsKey("size")) { try { // サイズの指定がない場合は、全件取得するようsizeを設定 query.put("size", 0); - DcSearchResponse hit = this.index.search(routingId, query); + PersoniumSearchResponse hit = this.index.search(routingId, query); query.put("size", hit.getHits().getAllPages()); } catch (EsClientException.EsNoResponseException e) { - throw DcCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); + throw PersoniumCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); } } return this.index.search(routingId, query); } catch (EsClientException.EsNoResponseException e) { - throw DcCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); + throw PersoniumCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); } } @@ -542,11 +542,11 @@ public DcSearchResponse searchForIndex(String routingId, Map que * @param queryList 検索クエリ一覧 * @return 検索結果 */ - public DcMultiSearchResponse multiSearchForIndex(String routingId, List> queryList) { + public PersoniumMultiSearchResponse multiSearchForIndex(String routingId, List> queryList) { try { return this.index.multiSearch(routingId, queryList); } catch (EsClientException.EsNoResponseException e) { - throw DcCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); + throw PersoniumCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); } } @@ -566,7 +566,7 @@ protected void createAdsIndex(String unitUserName) { ads.createIndex(indexName); } catch (AdsException adsEx) { // TODO エラー処理が必要?参照モードにする必要があるのでは?要検討。 - DcCoreLog.Server.FAILED_TO_CREATE_ADS.params(indexName).reason(adsEx).writeLog(); + PersoniumCoreLog.Server.FAILED_TO_CREATE_ADS.params(indexName).reason(adsEx).writeLog(); } } @@ -588,8 +588,8 @@ protected void checkAdsConnection() { } } catch (AdsException e) { // 接続に失敗した場合はエラーレスポンスを返却する - DcCoreLog.Server.ADS_CONNECTION_ERROR.params(e.getMessage()).reason(e).writeLog(); - throw DcCoreException.Server.ADS_CONNECTION_ERROR.reason(e); + PersoniumCoreLog.Server.ADS_CONNECTION_ERROR.params(e.getMessage()).reason(e).writeLog(); + throw PersoniumCoreException.Server.ADS_CONNECTION_ERROR.reason(e); } } @@ -599,14 +599,14 @@ protected void checkAdsConnection() { */ protected void recordAdsWriteFailureLog(AdsWriteFailureLogInfo loginfo) { AdsWriteFailureLogWriter adsWriteFailureLogWriter = AdsWriteFailureLogWriter.getInstance( - DcCoreConfig.getAdsWriteFailureLogDir(), - DcCoreConfig.getCoreVersion(), - DcCoreConfig.getAdsWriteFailureLogPhysicalDelete()); + PersoniumUnitConfig.getAdsWriteFailureLogDir(), + PersoniumUnitConfig.getCoreVersion(), + PersoniumUnitConfig.getAdsWriteFailureLogPhysicalDelete()); try { adsWriteFailureLogWriter.writeActiveFile(loginfo); } catch (AdsWriteFailureLogException e2) { - DcCoreLog.Server.WRITE_ADS_FAILURE_LOG_ERROR.reason(e2).writeLog(); - DcCoreLog.Server.WRITE_ADS_FAILURE_LOG_INFO.params(loginfo.toString()); + PersoniumCoreLog.Server.WRITE_ADS_FAILURE_LOG_ERROR.reason(e2).writeLog(); + PersoniumCoreLog.Server.WRITE_ADS_FAILURE_LOG_INFO.params(loginfo.toString()); } } diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/DavMoveAccessor.java b/src/main/java/io/personium/core/model/impl/es/accessor/DavMoveAccessor.java similarity index 85% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/DavMoveAccessor.java rename to src/main/java/io/personium/core/model/impl/es/accessor/DavMoveAccessor.java index 865525b56..2770b2a86 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/DavMoveAccessor.java +++ b/src/main/java/io/personium/core/model/impl/es/accessor/DavMoveAccessor.java @@ -14,29 +14,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.accessor; +package io.personium.core.model.impl.es.accessor; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; -import com.fujitsu.dc.common.ads.AdsWriteFailureLogInfo; -import com.fujitsu.dc.common.es.EsBulkRequest; -import com.fujitsu.dc.common.es.EsBulkRequest.BULK_REQUEST_TYPE; -import com.fujitsu.dc.common.es.EsIndex; -import com.fujitsu.dc.common.es.response.DcBulkItemResponse; -import com.fujitsu.dc.common.es.response.DcBulkResponse; -import com.fujitsu.dc.common.es.response.EsClientException; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.DcCoreLog; -import com.fujitsu.dc.core.model.file.BinaryDataAccessException; -import com.fujitsu.dc.core.model.file.BinaryDataAccessor; -import com.fujitsu.dc.core.model.impl.es.DavNode; -import com.fujitsu.dc.core.model.impl.es.ads.AdsException; -import com.fujitsu.dc.core.model.lock.Lock; -import com.fujitsu.dc.core.model.lock.LockKeyComposer; +import io.personium.common.ads.AdsWriteFailureLogInfo; +import io.personium.common.es.EsBulkRequest; +import io.personium.common.es.EsBulkRequest.BULK_REQUEST_TYPE; +import io.personium.common.es.EsIndex; +import io.personium.common.es.response.PersoniumBulkItemResponse; +import io.personium.common.es.response.PersoniumBulkResponse; +import io.personium.common.es.response.EsClientException; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.PersoniumCoreLog; +import io.personium.core.model.file.BinaryDataAccessException; +import io.personium.core.model.file.BinaryDataAccessor; +import io.personium.core.model.impl.es.DavNode; +import io.personium.core.model.impl.es.ads.AdsException; +import io.personium.core.model.lock.Lock; +import io.personium.core.model.lock.LockKeyComposer; /** * DavNode情報をMOVEする場合のアクセス処理を実装したクラス. @@ -189,12 +189,12 @@ public void setMoveRequest( * ES用のバルク登録ドキュメント数とADS用のバルク登録ドキュメント数は、同じにすること * @return バルクレスポンス */ - public DcBulkResponse move() { - DcBulkResponse response = esMove(this.esBulkRequest); + public PersoniumBulkResponse move() { + PersoniumBulkResponse response = esMove(this.esBulkRequest); // ESへのバルクリクエストでエラーが発生した場合はロールバックするためバイナリファイルの削除とADSの更新は行わない if (response.hasFailures()) { rollback(); - throw DcCoreException.Server.DATA_STORE_UPDATE_ERROR_ROLLBACKED; + throw PersoniumCoreException.Server.DATA_STORE_UPDATE_ERROR_ROLLBACKED; } adsMove(response); @@ -204,7 +204,7 @@ public DcBulkResponse move() { return response; } - private DcBulkResponse adsMove(DcBulkResponse response) { + private PersoniumBulkResponse adsMove(PersoniumBulkResponse response) { // ADSへの書込みは、連続した登録/更新のリクエストをバルクで実行する // 削除リクエストはリクエストを単体で実行する // 例)登録→更新→削除→削除→登録→更新→登録→削除 の順で実行した場合 @@ -242,15 +242,15 @@ private DcBulkResponse adsMove(DcBulkResponse response) { * @param esRequest ES用バルク登録ドキュメントリスト * @return バルクレスポンス */ - public DcBulkResponse esMove(List esRequest) { + public PersoniumBulkResponse esMove(List esRequest) { // マスタ書き込みでエラーが発生したためES更新を不可能とする prepareDataUpdate(getIndex().getName()); - DcBulkResponse response = null; + PersoniumBulkResponse response = null; try { response = getIndex().bulkRequest(getRoutingId(), esRequest, true); } catch (EsClientException.EsNoResponseException e) { - throw DcCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); + throw PersoniumCoreException.Server.ES_RETRY_OVER.params(e.getMessage()); } return response; } @@ -261,22 +261,22 @@ public DcBulkResponse esMove(List esRequest) { * @param response Elasticsearchのバルク更新レスポンス(Ads書込み失敗ログ出力用) * @param responseIndex Elasticsearchのバルク更新レスポンスのインデックス */ - private void bulkUpdateAds(List adsRequest, DcBulkResponse response, int responseIndex) { + private void bulkUpdateAds(List adsRequest, PersoniumBulkResponse response, int responseIndex) { try { // Davテーブルを一括更新 if (adsRequest.size() > 0) { getAds().bulkUpdateDav(getIndex().getName(), adsRequest); } } catch (AdsException e) { - DcCoreLog.Server.DATA_STORE_ENTITY_BULK_CREATE_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.DATA_STORE_ENTITY_BULK_CREATE_FAIL.params(e.getMessage()).reason(e).writeLog(); // Adsの登録に失敗した場合は、専用のログに書込む // ESでのバージョン情報を取得するためにesBulkRequestをループさせている - DcBulkItemResponse[] responseItems = response.items(); + PersoniumBulkItemResponse[] responseItems = response.items(); for (DavNode docHandler : adsRequest) { // Adsの登録に失敗した場合は、専用のログに書込む - DcBulkItemResponse itemResponse = responseItems[responseIndex++]; + PersoniumBulkItemResponse itemResponse = responseItems[responseIndex++]; String lockKey = LockKeyComposer.fullKeyFromCategoryAndKey(Lock.CATEGORY_DAV, null, docHandler.getBoxId(), null); AdsWriteFailureLogInfo loginfo = new AdsWriteFailureLogInfo( @@ -317,7 +317,7 @@ private void rollback() { } // ロールバックではElasticsearchのデータのみを戻す - DcBulkResponse bulkResponse = esMove(esRequest); + PersoniumBulkResponse bulkResponse = esMove(esRequest); if (bulkResponse.hasFailures()) { // ロールバック失敗時はロールバックしようとしたデータの内容を出力する log.info("rollback was abnormally end."); @@ -326,7 +326,7 @@ private void rollback() { outputRollbackRequest("source", srcNodeForRollback); outputRollbackRequest("destination", dstNoeForRollback); // ロールバックに失敗 - throw DcCoreException.Server.DATA_STORE_UPDATE_ROLLBACK_ERROR; + throw PersoniumCoreException.Server.DATA_STORE_UPDATE_ROLLBACK_ERROR; } // ロールバックに成功 log.info("rollback was successfully end."); @@ -353,7 +353,7 @@ private void deleteDavFile(DavNode davNode) { try { accessor.delete(davNode.getId()); } catch (BinaryDataAccessException e) { - DcCoreLog.Dav.FILE_DELETE_FAIL.params(davNode.getId()).writeLog(); + PersoniumCoreLog.Dav.FILE_DELETE_FAIL.params(davNode.getId()).writeLog(); } } } @@ -363,8 +363,8 @@ private void deleteDavFile(DavNode davNode) { * @return アクセサのインスタンス */ protected BinaryDataAccessor getBinaryDataAccessor() { - String unitUserName = getIndex().getName().replace(DcCoreConfig.getEsUnitPrefix() + "_", ""); - return new BinaryDataAccessor(DcCoreConfig.getBlobStoreRoot(), unitUserName, - DcCoreConfig.getPhysicalDeleteMode(), DcCoreConfig.getFsyncEnabled()); + String unitUserName = getIndex().getName().replace(PersoniumUnitConfig.getEsUnitPrefix() + "_", ""); + return new BinaryDataAccessor(PersoniumUnitConfig.getBlobStoreRoot(), unitUserName, + PersoniumUnitConfig.getPhysicalDeleteMode(), PersoniumUnitConfig.getFsyncEnabled()); } } diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/DavNodeAccessor.java b/src/main/java/io/personium/core/model/impl/es/accessor/DavNodeAccessor.java similarity index 72% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/DavNodeAccessor.java rename to src/main/java/io/personium/core/model/impl/es/accessor/DavNodeAccessor.java index 118de805c..bce78160b 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/DavNodeAccessor.java +++ b/src/main/java/io/personium/core/model/impl/es/accessor/DavNodeAccessor.java @@ -14,26 +14,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.accessor; +package io.personium.core.model.impl.es.accessor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.ads.AdsWriteFailureLogInfo; -import com.fujitsu.dc.common.es.EsIndex; -import com.fujitsu.dc.common.es.response.DcActionResponse; -import com.fujitsu.dc.common.es.response.DcDeleteResponse; -import com.fujitsu.dc.common.es.response.DcIndexResponse; -import com.fujitsu.dc.common.es.util.DcUUID; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.DcCoreLog; -import com.fujitsu.dc.core.model.file.BinaryDataAccessException; -import com.fujitsu.dc.core.model.file.BinaryDataAccessor; -import com.fujitsu.dc.core.model.impl.es.DavNode; -import com.fujitsu.dc.core.model.impl.es.ads.AdsException; -import com.fujitsu.dc.core.model.lock.Lock; -import com.fujitsu.dc.core.model.lock.LockKeyComposer; +import io.personium.common.ads.AdsWriteFailureLogInfo; +import io.personium.common.es.EsIndex; +import io.personium.common.es.response.PersoniumActionResponse; +import io.personium.common.es.response.PersoniumDeleteResponse; +import io.personium.common.es.response.PersoniumIndexResponse; +import io.personium.common.es.util.PersoniumUUID; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.PersoniumCoreLog; +import io.personium.core.model.file.BinaryDataAccessException; +import io.personium.core.model.file.BinaryDataAccessor; +import io.personium.core.model.impl.es.DavNode; +import io.personium.core.model.impl.es.ads.AdsException; +import io.personium.core.model.lock.Lock; +import io.personium.core.model.lock.LockKeyComposer; /** * DavNode情報のアクセス処理を実装したクラス. @@ -60,8 +60,8 @@ public DavNodeAccessor(EsIndex index, String name, String routingId) { * @param davNode Davコンポーネント * @return 登録結果 */ - public DcIndexResponse create(final DavNode davNode) { - String id = DcUUID.randomUUID(); + public PersoniumIndexResponse create(final DavNode davNode) { + String id = PersoniumUUID.randomUUID(); return this.create(id, davNode); } @@ -71,11 +71,11 @@ public DcIndexResponse create(final DavNode davNode) { * @param davNode Davコンポーネント * @return 登録結果 */ - public DcIndexResponse create(String id, DavNode davNode) { + public PersoniumIndexResponse create(String id, DavNode davNode) { // マスタ書き込みでエラーが発生したためES更新を不可能とする super.prepareDataUpdate(getIndex().getName()); davNode.setId(id); - DcIndexResponse response = super.create(id, davNode.getSource()); + PersoniumIndexResponse response = super.create(id, davNode.getSource()); createAds(davNode); return response; } @@ -86,26 +86,26 @@ public DcIndexResponse create(String id, DavNode davNode) { * @param davNode Davコンポーネント * @return 登録結果 */ - public DcActionResponse createForFile(String id, DavNode davNode) { + public PersoniumActionResponse createForFile(String id, DavNode davNode) { // マスタ書き込みでエラーが発生したためES更新を不可能とする prepareDataUpdate(getIndex().getName()); davNode.setId(id); - DcActionResponse response = null; + PersoniumActionResponse response = null; try { // ElasticSearch更新 response = createForDavNodeFile(id, davNode.getSource()); // 一時ファイルコピー - String unitUserName = getIndex().getName().replace(DcCoreConfig.getEsUnitPrefix() + "_", ""); - BinaryDataAccessor binaryDataAccessor = new BinaryDataAccessor(DcCoreConfig.getBlobStoreRoot(), - unitUserName, DcCoreConfig.getFsyncEnabled()); + String unitUserName = getIndex().getName().replace(PersoniumUnitConfig.getEsUnitPrefix() + "_", ""); + BinaryDataAccessor binaryDataAccessor = new BinaryDataAccessor(PersoniumUnitConfig.getBlobStoreRoot(), + unitUserName, PersoniumUnitConfig.getFsyncEnabled()); binaryDataAccessor.copyFile(id); // MySQL更新 createAds(davNode); } catch (BinaryDataAccessException ex) { // 一時ファイルコピー失敗 - throw DcCoreException.Dav.FS_INCONSISTENCY_FOUND.reason(ex); + throw PersoniumCoreException.Dav.FS_INCONSISTENCY_FOUND.reason(ex); } finally { // 一時ファイル削除 deleteTmpFile(id); @@ -115,9 +115,9 @@ public DcActionResponse createForFile(String id, DavNode davNode) { } private void deleteTmpFile(String id) { - String unitUserName = getIndex().getName().replace(DcCoreConfig.getEsUnitPrefix() + "_", ""); - BinaryDataAccessor binaryDataAccessor = new BinaryDataAccessor(DcCoreConfig.getBlobStoreRoot(), - unitUserName, DcCoreConfig.getFsyncEnabled()); + String unitUserName = getIndex().getName().replace(PersoniumUnitConfig.getEsUnitPrefix() + "_", ""); + BinaryDataAccessor binaryDataAccessor = new BinaryDataAccessor(PersoniumUnitConfig.getBlobStoreRoot(), + unitUserName, PersoniumUnitConfig.getFsyncEnabled()); try { // 一時ファイル物理削除 binaryDataAccessor.deletePhysicalFile(id + ".tmp"); @@ -136,7 +136,7 @@ protected void createAds(DavNode davNode) { try { getAds().createDavNode(getIndex().getName(), davNode); } catch (AdsException e) { - DcCoreLog.Server.DATA_STORE_ENTITY_CREATE_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.DATA_STORE_ENTITY_CREATE_FAIL.params(e.getMessage()).reason(e).writeLog(); // Adsの登録に失敗した場合は、専用のログに書込む String lockKey = LockKeyComposer.fullKeyFromCategoryAndKey(Lock.CATEGORY_DAV, null, @@ -154,7 +154,7 @@ protected void createAds(DavNode davNode) { * @param davNode 削除データ * @return 削除結果 */ - public DcDeleteResponse delete(DavNode davNode) { + public PersoniumDeleteResponse delete(DavNode davNode) { return this.delete(davNode, -1); } @@ -164,12 +164,12 @@ public DcDeleteResponse delete(DavNode davNode) { * @param davNode 削除データ * @return 削除結果 */ - public DcDeleteResponse delete(DavNode davNode, long version) { + public PersoniumDeleteResponse delete(DavNode davNode, long version) { String id = davNode.getId(); // マスタ書き込みでエラーが発生したためES更新を不可能とする super.prepareDataUpdate(getIndex().getName()); - DcDeleteResponse response = super.delete(id, version); + PersoniumDeleteResponse response = super.delete(id, version); deleteAds(davNode, response.getVersion()); return response; } @@ -187,7 +187,7 @@ protected void deleteAds(DavNode davNode, long version) { try { getAds().deleteDavNode(getIndex().getName(), id); } catch (AdsException e) { - DcCoreLog.Server.DATA_STORE_ENTITY_DELETE_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.DATA_STORE_ENTITY_DELETE_FAIL.params(e.getMessage()).reason(e).writeLog(); // Adsの登録に失敗した場合は、専用のログに書込む String lockKey = LockKeyComposer.fullKeyFromCategoryAndKey(Lock.CATEGORY_DAV, null, @@ -206,7 +206,7 @@ protected void deleteAds(DavNode davNode, long version) { * @param davNode Davコンポーネント * @return 更新結果 */ - public DcIndexResponse update(String id, DavNode davNode) { + public PersoniumIndexResponse update(String id, DavNode davNode) { return this.update(id, davNode, -1); } @@ -217,10 +217,10 @@ public DcIndexResponse update(String id, DavNode davNode) { * @param version バージョン情報 * @return 更新結果 */ - public DcIndexResponse update(String id, DavNode davNode, long version) { + public PersoniumIndexResponse update(String id, DavNode davNode, long version) { // マスタ書き込みでエラーが発生したためES更新を不可能とする super.prepareDataUpdate(getIndex().getName()); - DcIndexResponse response = super.update(id, davNode.getSource(), version); + PersoniumIndexResponse response = super.update(id, davNode.getSource(), version); updateAds(davNode, response.getVersion()); return response; } @@ -232,25 +232,25 @@ public DcIndexResponse update(String id, DavNode davNode, long version) { * @param version バージョン情報 * @return 更新結果 */ - public DcIndexResponse updateForFile(String id, DavNode davNode, long version) { + public PersoniumIndexResponse updateForFile(String id, DavNode davNode, long version) { // マスタ書き込みでエラーが発生したためES更新を不可能とする super.prepareDataUpdate(getIndex().getName()); - DcIndexResponse response = null; + PersoniumIndexResponse response = null; try { // ElasticSearch更新 response = super.update(id, davNode.getSource(), version); // 一時ファイルコピー - String unitUserName = getIndex().getName().replace(DcCoreConfig.getEsUnitPrefix() + "_", ""); - BinaryDataAccessor binaryDataAccessor = new BinaryDataAccessor(DcCoreConfig.getBlobStoreRoot(), - unitUserName, DcCoreConfig.getFsyncEnabled()); + String unitUserName = getIndex().getName().replace(PersoniumUnitConfig.getEsUnitPrefix() + "_", ""); + BinaryDataAccessor binaryDataAccessor = new BinaryDataAccessor(PersoniumUnitConfig.getBlobStoreRoot(), + unitUserName, PersoniumUnitConfig.getFsyncEnabled()); binaryDataAccessor.copyFile(id); // MySQL更新 updateAds(davNode, response.getVersion()); } catch (BinaryDataAccessException ex) { // 一時ファイルコピー失敗 - throw DcCoreException.Dav.FS_INCONSISTENCY_FOUND.reason(ex); + throw PersoniumCoreException.Dav.FS_INCONSISTENCY_FOUND.reason(ex); } finally { // 一時ファイル削除 deleteTmpFile(id); @@ -270,7 +270,7 @@ protected void updateAds(DavNode davNode, long version) { try { getAds().updateDavNode(getIndex().getName(), davNode); } catch (AdsException e) { - DcCoreLog.Server.DATA_STORE_ENTITY_UPDATE_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.DATA_STORE_ENTITY_UPDATE_FAIL.params(e.getMessage()).reason(e).writeLog(); // Adsの登録に失敗した場合は、専用のログに書込む String lockKey = LockKeyComposer.fullKeyFromCategoryAndKey(Lock.CATEGORY_DAV, null, diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/EntitySetAccessor.java b/src/main/java/io/personium/core/model/impl/es/accessor/EntitySetAccessor.java similarity index 68% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/EntitySetAccessor.java rename to src/main/java/io/personium/core/model/impl/es/accessor/EntitySetAccessor.java index dff0eaa80..28077e0b2 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/EntitySetAccessor.java +++ b/src/main/java/io/personium/core/model/impl/es/accessor/EntitySetAccessor.java @@ -14,15 +14,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.accessor; +package io.personium.core.model.impl.es.accessor; import java.util.Map; -import com.fujitsu.dc.common.es.response.DcDeleteResponse; -import com.fujitsu.dc.common.es.response.DcGetResponse; -import com.fujitsu.dc.common.es.response.DcIndexResponse; -import com.fujitsu.dc.common.es.response.DcSearchResponse; -import com.fujitsu.dc.core.model.impl.es.doc.EntitySetDocHandler; +import io.personium.common.es.response.PersoniumDeleteResponse; +import io.personium.common.es.response.PersoniumGetResponse; +import io.personium.common.es.response.PersoniumIndexResponse; +import io.personium.common.es.response.PersoniumSearchResponse; +import io.personium.core.model.impl.es.doc.EntitySetDocHandler; /** * ODataEntitySetに対するアクセッサーのインターフェースクラス. @@ -34,14 +34,14 @@ public interface EntitySetAccessor { * @param id ドキュメントのID * @return 応答 */ - DcGetResponse get(String id); + PersoniumGetResponse get(String id); /** * UUIDでデータ登録を行う. * @param docHandler 登録データ * @return 登録結果 */ - DcIndexResponse create(EntitySetDocHandler docHandler); + PersoniumIndexResponse create(EntitySetDocHandler docHandler); /** * ID指定ありでデータ登録を行う. @@ -49,7 +49,7 @@ public interface EntitySetAccessor { * @param docHandler 登録データ * @return 登録結果 */ - DcIndexResponse create(String id, EntitySetDocHandler docHandler); + PersoniumIndexResponse create(String id, EntitySetDocHandler docHandler); /** * バージョン指定ありでデータ更新を行う. @@ -58,7 +58,7 @@ public interface EntitySetAccessor { * @param version バージョン情報 * @return 更新結果 */ - DcIndexResponse update(String id, EntitySetDocHandler docHandler, long version); + PersoniumIndexResponse update(String id, EntitySetDocHandler docHandler, long version); /** * データ更新を行う. @@ -66,14 +66,14 @@ public interface EntitySetAccessor { * @param docHandler 登録データ * @return 更新結果 */ - DcIndexResponse update(String id, EntitySetDocHandler docHandler); + PersoniumIndexResponse update(String id, EntitySetDocHandler docHandler); /** * データ削除を行う. * @param docHandler 削除データ * @return 削除結果 */ - DcDeleteResponse delete(EntitySetDocHandler docHandler); + PersoniumDeleteResponse delete(EntitySetDocHandler docHandler); /** * ドキュメントの件数を取得. @@ -87,7 +87,7 @@ public interface EntitySetAccessor { * @param query クエリ情報 * @return ES応答 */ - DcSearchResponse search(Map query); + PersoniumSearchResponse search(Map query); /** * データ削除を行う. @@ -95,7 +95,7 @@ public interface EntitySetAccessor { * @param version バージョン * @return 削除結果 */ - DcDeleteResponse delete(EntitySetDocHandler docHandler, long version); + PersoniumDeleteResponse delete(EntitySetDocHandler docHandler, long version); /** * Typeを取得する. diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/ODataEntityAccessor.java b/src/main/java/io/personium/core/model/impl/es/accessor/ODataEntityAccessor.java similarity index 83% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/ODataEntityAccessor.java rename to src/main/java/io/personium/core/model/impl/es/accessor/ODataEntityAccessor.java index 1adb89228..f621a3b46 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/ODataEntityAccessor.java +++ b/src/main/java/io/personium/core/model/impl/es/accessor/ODataEntityAccessor.java @@ -14,17 +14,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.accessor; +package io.personium.core.model.impl.es.accessor; import java.sql.SQLException; -import com.fujitsu.dc.common.ads.AdsWriteFailureLogInfo; -import com.fujitsu.dc.common.es.EsIndex; -import com.fujitsu.dc.core.DcCoreLog; -import com.fujitsu.dc.core.model.impl.es.ads.AdsException; -import com.fujitsu.dc.core.model.impl.es.doc.EntitySetDocHandler; -import com.fujitsu.dc.core.model.lock.Lock; -import com.fujitsu.dc.core.model.lock.LockKeyComposer; +import io.personium.common.ads.AdsWriteFailureLogInfo; +import io.personium.common.es.EsIndex; +import io.personium.core.PersoniumCoreLog; +import io.personium.core.model.impl.es.ads.AdsException; +import io.personium.core.model.impl.es.doc.EntitySetDocHandler; +import io.personium.core.model.lock.Lock; +import io.personium.core.model.lock.LockKeyComposer; /** * ODataEntityのアクセス処理を実装したクラス. @@ -55,12 +55,12 @@ protected void createAds(EntitySetDocHandler docHandler) { // Indexが存在しない場合はインデックスを作成する。 if (e.getCause() instanceof SQLException && MYSQL_BAD_TABLE_ERROR.equals(((SQLException) e.getCause()).getSQLState())) { - DcCoreLog.Server.ES_INDEX_NOT_EXIST.params(indexName).writeLog(); + PersoniumCoreLog.Server.ES_INDEX_NOT_EXIST.params(indexName).writeLog(); createAdsIndex(indexName); try { getAds().createEntity(indexName, docHandler); } catch (AdsException e1) { - DcCoreLog.Server.DATA_STORE_ENTITY_CREATE_FAIL.params(e1.getMessage()).reason(e1).writeLog(); + PersoniumCoreLog.Server.DATA_STORE_ENTITY_CREATE_FAIL.params(e1.getMessage()).reason(e1).writeLog(); // Adsの登録に失敗した場合は、専用のログに書込む String lockKey = LockKeyComposer.fullKeyFromCategoryAndKey(Lock.CATEGORY_ODATA, @@ -72,7 +72,7 @@ protected void createAds(EntitySetDocHandler docHandler) { recordAdsWriteFailureLog(loginfo); } } else { - DcCoreLog.Server.DATA_STORE_ENTITY_CREATE_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.DATA_STORE_ENTITY_CREATE_FAIL.params(e.getMessage()).reason(e).writeLog(); // Adsの登録に失敗した場合は、専用のログに書込む String lockKey = LockKeyComposer.fullKeyFromCategoryAndKey(Lock.CATEGORY_ODATA, @@ -98,7 +98,7 @@ protected void updateAds(EntitySetDocHandler docHandler, long version) { try { getAds().updateEntity(getIndex().getName(), docHandler); } catch (AdsException e) { - DcCoreLog.Server.DATA_STORE_ENTITY_UPDATE_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.DATA_STORE_ENTITY_UPDATE_FAIL.params(e.getMessage()).reason(e).writeLog(); // Adsの登録に失敗した場合は、専用のログに書込む String lockKey = LockKeyComposer.fullKeyFromCategoryAndKey(Lock.CATEGORY_ODATA, @@ -126,7 +126,7 @@ protected void deleteAds(EntitySetDocHandler docHandler, long version) { try { getAds().deleteEntity(getIndex().getName(), id); } catch (AdsException e) { - DcCoreLog.Server.DATA_STORE_ENTITY_DELETE_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.DATA_STORE_ENTITY_DELETE_FAIL.params(e.getMessage()).reason(e).writeLog(); // Adsの登録に失敗した場合は、専用のログに書込む String lockKey = LockKeyComposer.fullKeyFromCategoryAndKey(Lock.CATEGORY_ODATA, diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/ODataLinkAccessor.java b/src/main/java/io/personium/core/model/impl/es/accessor/ODataLinkAccessor.java similarity index 76% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/ODataLinkAccessor.java rename to src/main/java/io/personium/core/model/impl/es/accessor/ODataLinkAccessor.java index 4b83c84f0..095b5d060 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/ODataLinkAccessor.java +++ b/src/main/java/io/personium/core/model/impl/es/accessor/ODataLinkAccessor.java @@ -14,19 +14,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.accessor; - -import com.fujitsu.dc.common.ads.AdsWriteFailureLogInfo; -import com.fujitsu.dc.common.es.EsIndex; -import com.fujitsu.dc.common.es.response.DcDeleteResponse; -import com.fujitsu.dc.common.es.response.DcIndexResponse; -import com.fujitsu.dc.common.es.util.DcUUID; -import com.fujitsu.dc.core.DcCoreLog; -import com.fujitsu.dc.core.model.impl.es.EsModel; -import com.fujitsu.dc.core.model.impl.es.ads.AdsException; -import com.fujitsu.dc.core.model.impl.es.doc.LinkDocHandler; -import com.fujitsu.dc.core.model.lock.Lock; -import com.fujitsu.dc.core.model.lock.LockKeyComposer; +package io.personium.core.model.impl.es.accessor; + +import io.personium.common.ads.AdsWriteFailureLogInfo; +import io.personium.common.es.EsIndex; +import io.personium.common.es.response.PersoniumDeleteResponse; +import io.personium.common.es.response.PersoniumIndexResponse; +import io.personium.common.es.util.PersoniumUUID; +import io.personium.core.PersoniumCoreLog; +import io.personium.core.model.impl.es.EsModel; +import io.personium.core.model.impl.es.ads.AdsException; +import io.personium.core.model.impl.es.doc.LinkDocHandler; +import io.personium.core.model.lock.Lock; +import io.personium.core.model.lock.LockKeyComposer; /** * ODataLink情報のアクセス処理を実装したクラス. @@ -48,8 +48,8 @@ public ODataLinkAccessor(EsIndex index, String name, String routingId) { * @param docHandler 登録データ * @return 登録結果 */ - public DcIndexResponse create(final LinkDocHandler docHandler) { - String id = DcUUID.randomUUID(); + public PersoniumIndexResponse create(final LinkDocHandler docHandler) { + String id = PersoniumUUID.randomUUID(); return this.create(id, docHandler); } @@ -59,11 +59,11 @@ public DcIndexResponse create(final LinkDocHandler docHandler) { * @param docHandler 登録データ * @return 登録結果 */ - public DcIndexResponse create(String id, LinkDocHandler docHandler) { + public PersoniumIndexResponse create(String id, LinkDocHandler docHandler) { // マスタ書き込みでエラーが発生したためES更新を不可能とする super.prepareDataUpdate(getIndex().getName()); docHandler.setId(id); - DcIndexResponse response = super.create(id, docHandler.createLinkDoc()); + PersoniumIndexResponse response = super.create(id, docHandler.createLinkDoc()); createAds(docHandler); return response; } @@ -78,7 +78,7 @@ protected void createAds(LinkDocHandler docHandler) { try { getAds().createLink(getIndex().getName(), docHandler); } catch (AdsException e) { - DcCoreLog.Server.DATA_STORE_ENTITY_CREATE_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.DATA_STORE_ENTITY_CREATE_FAIL.params(e.getMessage()).reason(e).writeLog(); // Adsの登録に失敗した場合は、専用のログに書込む String lockKey = LockKeyComposer.fullKeyFromCategoryAndKey(Lock.CATEGORY_ODATA, @@ -98,7 +98,7 @@ protected void createAds(LinkDocHandler docHandler) { * @param docHandler 登録データ * @return 更新結果 */ - public DcIndexResponse update(String id, LinkDocHandler docHandler) { + public PersoniumIndexResponse update(String id, LinkDocHandler docHandler) { return this.update(id, docHandler, -1); } @@ -109,10 +109,10 @@ public DcIndexResponse update(String id, LinkDocHandler docHandler) { * @param version バージョン情報 * @return 更新結果 */ - public DcIndexResponse update(String id, LinkDocHandler docHandler, long version) { + public PersoniumIndexResponse update(String id, LinkDocHandler docHandler, long version) { // マスタ書き込みでエラーが発生したためES更新を不可能とする super.prepareDataUpdate(getIndex().getName()); - DcIndexResponse response = super.update(id, docHandler.createLinkDoc(), version); + PersoniumIndexResponse response = super.update(id, docHandler.createLinkDoc(), version); updateAds(docHandler, response.getVersion()); return response; } @@ -128,7 +128,7 @@ protected void updateAds(LinkDocHandler docHandler, long version) { try { getAds().updateLink(getIndex().getName(), docHandler); } catch (AdsException e) { - DcCoreLog.Server.DATA_STORE_ENTITY_UPDATE_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.DATA_STORE_ENTITY_UPDATE_FAIL.params(e.getMessage()).reason(e).writeLog(); // Adsの登録に失敗した場合は、専用のログに書込む String lockKey = LockKeyComposer.fullKeyFromCategoryAndKey(Lock.CATEGORY_ODATA, @@ -147,7 +147,7 @@ protected void updateAds(LinkDocHandler docHandler, long version) { * @param docHandler 削除データ * @return 応答 */ - public DcDeleteResponse delete(final LinkDocHandler docHandler) { + public PersoniumDeleteResponse delete(final LinkDocHandler docHandler) { return this.delete(docHandler, -1); } @@ -157,12 +157,12 @@ public DcDeleteResponse delete(final LinkDocHandler docHandler) { * @param version バージョン情報 * @return 削除結果 */ - public DcDeleteResponse delete(final LinkDocHandler docHandler, long version) { + public PersoniumDeleteResponse delete(final LinkDocHandler docHandler, long version) { String id = docHandler.getId(); // マスタ書き込みでエラーが発生したためES更新を不可能とする super.prepareDataUpdate(getIndex().getName()); - DcDeleteResponse response = super.delete(id, version); + PersoniumDeleteResponse response = super.delete(id, version); deleteAds(docHandler, response.getVersion()); return response; } @@ -180,7 +180,7 @@ protected void deleteAds(LinkDocHandler docHandler, long version) { try { getAds().deleteLink(getIndex().getName(), id); } catch (AdsException e) { - DcCoreLog.Server.DATA_STORE_ENTITY_DELETE_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.DATA_STORE_ENTITY_DELETE_FAIL.params(e.getMessage()).reason(e).writeLog(); // Adsの登録に失敗した場合は、専用のログに書込む String lockKey = LockKeyComposer.fullKeyFromCategoryAndKey(Lock.CATEGORY_ODATA, diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/package-info.java b/src/main/java/io/personium/core/model/impl/es/accessor/package-info.java similarity index 90% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/package-info.java rename to src/main/java/io/personium/core/model/impl/es/accessor/package-info.java index 1f4d6bb48..d56f09b54 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/accessor/package-info.java +++ b/src/main/java/io/personium/core/model/impl/es/accessor/package-info.java @@ -17,5 +17,5 @@ /** * データストア層の基本処理を実装するパッケージ. */ -package com.fujitsu.dc.core.model.impl.es.accessor; +package io.personium.core.model.impl.es.accessor; diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/ads/Ads.java b/src/main/java/io/personium/core/model/impl/es/ads/Ads.java similarity index 95% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/ads/Ads.java rename to src/main/java/io/personium/core/model/impl/es/ads/Ads.java index aca3af0fe..b37814b75 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/ads/Ads.java +++ b/src/main/java/io/personium/core/model/impl/es/ads/Ads.java @@ -14,15 +14,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.ads; +package io.personium.core.model.impl.es.ads; import java.util.List; import org.json.simple.JSONObject; -import com.fujitsu.dc.core.model.impl.es.DavNode; -import com.fujitsu.dc.core.model.impl.es.doc.EntitySetDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.LinkDocHandler; +import io.personium.core.model.impl.es.DavNode; +import io.personium.core.model.impl.es.doc.EntitySetDocHandler; +import io.personium.core.model.impl.es.doc.LinkDocHandler; /** * ES のADS ( Authentic Data Store ) のインターフェース. diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/ads/AdsConnectionException.java b/src/main/java/io/personium/core/model/impl/es/ads/AdsConnectionException.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/ads/AdsConnectionException.java rename to src/main/java/io/personium/core/model/impl/es/ads/AdsConnectionException.java index 4af9b7181..3a4b8f751 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/ads/AdsConnectionException.java +++ b/src/main/java/io/personium/core/model/impl/es/ads/AdsConnectionException.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.ads; +package io.personium.core.model.impl.es.ads; /** * ADSの更新処理失敗時に投げられるException. diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/ads/AdsException.java b/src/main/java/io/personium/core/model/impl/es/ads/AdsException.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/ads/AdsException.java rename to src/main/java/io/personium/core/model/impl/es/ads/AdsException.java index 642f927f6..30d2cfc43 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/ads/AdsException.java +++ b/src/main/java/io/personium/core/model/impl/es/ads/AdsException.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.ads; +package io.personium.core.model.impl.es.ads; /** * ADSの更新処理失敗時に投げられるException. diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/ads/JdbcAds.java b/src/main/java/io/personium/core/model/impl/es/ads/JdbcAds.java similarity index 89% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/ads/JdbcAds.java rename to src/main/java/io/personium/core/model/impl/es/ads/JdbcAds.java index 01c1b24b0..1d7849912 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/ads/JdbcAds.java +++ b/src/main/java/io/personium/core/model/impl/es/ads/JdbcAds.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.ads; +package io.personium.core.model.impl.es.ads; import java.sql.Connection; import java.sql.PreparedStatement; @@ -36,15 +36,15 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreLog; -import com.fujitsu.dc.core.model.impl.es.DavNode; -import com.fujitsu.dc.core.model.impl.es.doc.CellDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.EntitySetDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.LinkDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.OEntityDocHandler; -import com.fujitsu.dc.core.model.impl.es.odata.UserDataODataProducer; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreLog; +import io.personium.core.model.impl.es.DavNode; +import io.personium.core.model.impl.es.doc.CellDocHandler; +import io.personium.core.model.impl.es.doc.EntitySetDocHandler; +import io.personium.core.model.impl.es.doc.LinkDocHandler; +import io.personium.core.model.impl.es.doc.OEntityDocHandler; +import io.personium.core.model.impl.es.odata.UserDataODataProducer; /** * JDBCタイプのADS ( Authentic Data Store ). @@ -67,7 +67,7 @@ public JdbcAds() throws AdsConnectionException { try { if (ds == null) { - Properties p = DcCoreConfig.getEsAdsDbcpProps(); + Properties p = PersoniumUnitConfig.getEsAdsDbcpProps(); ds = BasicDataSourceFactory.createDataSource(p); } } catch (Exception e) { @@ -1114,7 +1114,7 @@ Connection getConnection() throws AdsException { // なのでDBの選択は個別のSQLに埋め込む設計としている。 return con; } catch (SQLException e) { - DcCoreLog.Server.RDB_CONNECT_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.RDB_CONNECT_FAIL.params(e.getMessage()).reason(e).writeLog(); throw new AdsException(e); } } @@ -1134,14 +1134,14 @@ Object executeQuerySql(String sql, StatementHandler sp, rs.beforeFirst(); return queryResultHandler.handle(rs); } catch (SQLException e) { - DcCoreLog.Server.EXECUTE_QUERY_SQL_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.EXECUTE_QUERY_SQL_FAIL.params(e.getMessage()).reason(e).writeLog(); throw new AdsException(e); } finally { try { stmt.close(); con.close(); } catch (SQLException e) { - DcCoreLog.Server.RDB_DISCONNECT_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.RDB_DISCONNECT_FAIL.params(e.getMessage()).reason(e).writeLog(); throw new AdsException(e); } } @@ -1155,7 +1155,7 @@ void executeDeleteByQuerySql(String deleteSql, try { stmt = con.prepareStatement(deleteSql); sp.handle(stmt); - DcCoreLog.Server.JDBC_EXEC_SQL.params( + PersoniumCoreLog.Server.JDBC_EXEC_SQL.params( ((DelegatingPreparedStatement) stmt).getDelegate().toString()).writeLog(); stmt.executeUpdate(); if (!AUTO_COMMIT) { @@ -1167,7 +1167,7 @@ void executeDeleteByQuerySql(String deleteSql, try { stmt.close(); } catch (SQLException e) { - DcCoreLog.Server.RDB_DISCONNECT_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.RDB_DISCONNECT_FAIL.params(e.getMessage()).reason(e).writeLog(); throw new AdsException(e); } } @@ -1194,7 +1194,7 @@ void executeDeleteByQuerySql(String deleteSql, stmt.close(); con.close(); } catch (SQLException e) { - DcCoreLog.Server.RDB_DISCONNECT_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.RDB_DISCONNECT_FAIL.params(e.getMessage()).reason(e).writeLog(); throw new AdsException(e); } } @@ -1220,7 +1220,7 @@ void executeUpdateSql(String sql, StatementHandler sp, int expectedCount) throws + " row is expected to be affected."); } } catch (SQLException e) { - DcCoreLog.Server.JDBC_EXEC_SQL.params( + PersoniumCoreLog.Server.JDBC_EXEC_SQL.params( ((DelegatingPreparedStatement) stmt).getDelegate().toString()).writeLog(); throw new AdsException(e); } finally { @@ -1228,7 +1228,7 @@ void executeUpdateSql(String sql, StatementHandler sp, int expectedCount) throws stmt.close(); con.close(); } catch (SQLException e) { - DcCoreLog.Server.RDB_DISCONNECT_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.RDB_DISCONNECT_FAIL.params(e.getMessage()).reason(e).writeLog(); throw new AdsException(e); } } @@ -1241,7 +1241,7 @@ abstract static class StatementHandler { abstract void handle(PreparedStatement stmt) throws SQLException; void writeLog(PreparedStatement stmt) { - DcCoreLog.Server.JDBC_EXEC_SQL.params( + PersoniumCoreLog.Server.JDBC_EXEC_SQL.params( ((DelegatingPreparedStatement) stmt).getDelegate().toString()).writeLog(); } } @@ -1271,7 +1271,7 @@ public void handle(PreparedStatement stmt) throws SQLException { stmt.setLong(Sql.IDX_ENTITY_UPDATED, oedh.getUpdated()); stmt.setString(Sql.NUMCOLS_ENTITY, oedh.getId()); if (UserDataODataProducer.USER_ODATA_NAMESPACE.equals(oedh.getType())) { - DcCoreLog.Server.JDBC_USER_ODATA_SQL.params(oedh.getUnitUserName(), "ENTITY", oedh.getId(), + PersoniumCoreLog.Server.JDBC_USER_ODATA_SQL.params(oedh.getUnitUserName(), "ENTITY", oedh.getId(), oedh.getType(), oedh.getCellId(), oedh.getBoxId(), oedh.getNodeId(), oedh.getEntityTypeId()).writeLog(); } else { @@ -1513,98 +1513,98 @@ interface QueryResultHandler { */ static class Sql { static String createSchema = - DcCoreUtils.readStringResource("es/ads/ddl-createschema.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/ddl-createschema.sql", CharEncoding.UTF_8); static String dropSchema = - DcCoreUtils.readStringResource("es/ads/ddl-dropschema.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/ddl-dropschema.sql", CharEncoding.UTF_8); static String createTableEntity = - DcCoreUtils.readStringResource("es/ads/ddl-createtable-entity.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/ddl-createtable-entity.sql", CharEncoding.UTF_8); static String createTableLink = - DcCoreUtils.readStringResource("es/ads/ddl-createtable-link.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/ddl-createtable-link.sql", CharEncoding.UTF_8); static String createTableDavNode = - DcCoreUtils.readStringResource("es/ads/ddl-createtable-davnode.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/ddl-createtable-davnode.sql", CharEncoding.UTF_8); static String createTableCell = - DcCoreUtils.readStringResource("es/ads/ddl-createtable-cell.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/ddl-createtable-cell.sql", CharEncoding.UTF_8); static String createManagementTableCellDelete = - DcCoreUtils.readStringResource("es/ads/ddl-create-management-table-cell-delete.sql", + PersoniumCoreUtils.readStringResource("es/ads/ddl-create-management-table-cell-delete.sql", CharEncoding.UTF_8); static String insertEntity = - DcCoreUtils.readStringResource("es/ads/entity-insert.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/entity-insert.sql", CharEncoding.UTF_8); static String updateEntity = - DcCoreUtils.readStringResource("es/ads/entity-update.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/entity-update.sql", CharEncoding.UTF_8); static String deleteEntity = - DcCoreUtils.readStringResource("es/ads/entity-delete.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/entity-delete.sql", CharEncoding.UTF_8); static String bulkInsertEntity = - DcCoreUtils.readStringResource("es/ads/entity-bulk-insert.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/entity-bulk-insert.sql", CharEncoding.UTF_8); static String insertCell = - DcCoreUtils.readStringResource("es/ads/cell-insert.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/cell-insert.sql", CharEncoding.UTF_8); static String updateCell = - DcCoreUtils.readStringResource("es/ads/cell-update.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/cell-update.sql", CharEncoding.UTF_8); static String deleteCell = - DcCoreUtils.readStringResource("es/ads/cell-delete.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/cell-delete.sql", CharEncoding.UTF_8); static String insertLink = - DcCoreUtils.readStringResource("es/ads/link-insert.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/link-insert.sql", CharEncoding.UTF_8); static String updateLink = - DcCoreUtils.readStringResource("es/ads/link-update.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/link-update.sql", CharEncoding.UTF_8); static String deleteLink = - DcCoreUtils.readStringResource("es/ads/link-delete.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/link-delete.sql", CharEncoding.UTF_8); static String bulkInsertLink = - DcCoreUtils.readStringResource("es/ads/link-bulk-insert.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/link-bulk-insert.sql", CharEncoding.UTF_8); static String insertDavNode = - DcCoreUtils.readStringResource("es/ads/dav-insert.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/dav-insert.sql", CharEncoding.UTF_8); static String updateDavNode = - DcCoreUtils.readStringResource("es/ads/dav-update.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/dav-update.sql", CharEncoding.UTF_8); static String deleteDavNode = - DcCoreUtils.readStringResource("es/ads/dav-delete.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/dav-delete.sql", CharEncoding.UTF_8); static String bulkInsertDav = - DcCoreUtils.readStringResource("es/ads/dav-bulk-insert.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/dav-bulk-insert.sql", CharEncoding.UTF_8); static String deleteCellResourceFromEntity = - DcCoreUtils.readStringResource("es/ads/delete-cellresource-from-entity.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/delete-cellresource-from-entity.sql", CharEncoding.UTF_8); static String deleteCellResourceFromDavNode = - DcCoreUtils.readStringResource("es/ads/delete-cellresource-from-davnode.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/delete-cellresource-from-davnode.sql", CharEncoding.UTF_8); static String deleteCellResourceFromLink = - DcCoreUtils.readStringResource("es/ads/delete-cellresource-from-link.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/delete-cellresource-from-link.sql", CharEncoding.UTF_8); static String countCellResourceFromEntity = - DcCoreUtils.readStringResource("es/ads/count-cellresource-from-entity.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/count-cellresource-from-entity.sql", CharEncoding.UTF_8); static String countCellResourceFromDavNode = - DcCoreUtils.readStringResource("es/ads/count-cellresource-from-davnode.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/count-cellresource-from-davnode.sql", CharEncoding.UTF_8); static String countCellResourceFromLink = - DcCoreUtils.readStringResource("es/ads/count-cellresource-from-link.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/count-cellresource-from-link.sql", CharEncoding.UTF_8); static String selectEntity = - DcCoreUtils.readStringResource("es/ads/entity-select.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/entity-select.sql", CharEncoding.UTF_8); static String countEntity = - DcCoreUtils.readStringResource("es/ads/entity-count.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/entity-count.sql", CharEncoding.UTF_8); static String selectCell = - DcCoreUtils.readStringResource("es/ads/cell-select.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/cell-select.sql", CharEncoding.UTF_8); static String countCell = - DcCoreUtils.readStringResource("es/ads/cell-count.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/cell-count.sql", CharEncoding.UTF_8); static String selectLink = - DcCoreUtils.readStringResource("es/ads/link-select.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/link-select.sql", CharEncoding.UTF_8); static String countLink = - DcCoreUtils.readStringResource("es/ads/link-count.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/link-count.sql", CharEncoding.UTF_8); static String selectDav = - DcCoreUtils.readStringResource("es/ads/dav-select.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/dav-select.sql", CharEncoding.UTF_8); static String countDav = - DcCoreUtils.readStringResource("es/ads/dav-count.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/dav-count.sql", CharEncoding.UTF_8); static String searchEntity = - DcCoreUtils.readStringResource("es/ads/entity-search.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/entity-search.sql", CharEncoding.UTF_8); static String searchCell = - DcCoreUtils.readStringResource("es/ads/cell-search.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/cell-search.sql", CharEncoding.UTF_8); static String searchLink = - DcCoreUtils.readStringResource("es/ads/link-search.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/link-search.sql", CharEncoding.UTF_8); static String searchDav = - DcCoreUtils.readStringResource("es/ads/dav-search.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/dav-search.sql", CharEncoding.UTF_8); // Cell管理用SQL群 static String insertCellDelete = - DcCoreUtils.readStringResource("es/ads/celldelete-insert.sql", CharEncoding.UTF_8); + PersoniumCoreUtils.readStringResource("es/ads/celldelete-insert.sql", CharEncoding.UTF_8); // ENTITY 操作 SQLの 項目数 static final int NUMCOLS_ENTITY = 12; diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/ads/package-info.java b/src/main/java/io/personium/core/model/impl/es/ads/package-info.java similarity index 91% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/ads/package-info.java rename to src/main/java/io/personium/core/model/impl/es/ads/package-info.java index 122210069..8202dfae8 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/ads/package-info.java +++ b/src/main/java/io/personium/core/model/impl/es/ads/package-info.java @@ -17,4 +17,4 @@ /** * ESのデータ保全信頼性を補うための正本データ保管機構(Authentic Data Storage)を実装するパッケージ. */ -package com.fujitsu.dc.core.model.impl.es.ads; +package io.personium.core.model.impl.es.ads; diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/cache/BoxCache.java b/src/main/java/io/personium/core/model/impl/es/cache/BoxCache.java similarity index 81% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/cache/BoxCache.java rename to src/main/java/io/personium/core/model/impl/es/cache/BoxCache.java index 4c1bf4a38..50e40ad79 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/cache/BoxCache.java +++ b/src/main/java/io/personium/core/model/impl/es/cache/BoxCache.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.cache; +package io.personium.core.model.impl.es.cache; import java.util.HashMap; import java.util.Map; @@ -22,12 +22,12 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.utils.CacheClient; -import com.fujitsu.dc.core.utils.MemcachedClient; -import com.fujitsu.dc.core.utils.MemcachedClient.MemcachedClientException; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.model.Box; +import io.personium.core.model.Cell; +import io.personium.core.utils.CacheClient; +import io.personium.core.utils.MemcachedClient; +import io.personium.core.utils.MemcachedClient.MemcachedClientException; /** * Boxのキャッシュを扱うクラス. @@ -50,7 +50,7 @@ private BoxCache() { * @return Boxオブジェクト。キャッシュに存在しない場合はnull */ public static Box get(String boxName, Cell cell) { - if (!DcCoreConfig.isBoxCacheEnabled()) { + if (!PersoniumUnitConfig.isBoxCacheEnabled()) { return null; } @@ -78,7 +78,7 @@ public static Box get(String boxName, Cell cell) { * @param box Boxオブジェクト */ public static void cache(Box box) { - if (!DcCoreConfig.isBoxCacheEnabled()) { + if (!PersoniumUnitConfig.isBoxCacheEnabled()) { return; } @@ -88,7 +88,7 @@ public static void cache(Box box) { obj.put("schema", box.getSchema()); obj.put("published", box.getPublished()); - getMcdClient().put(cacheKey(box.getName(), box.getCell()), DcCoreConfig.getCacheMemcachedExpiresIn(), obj); + getMcdClient().put(cacheKey(box.getName(), box.getCell()), PersoniumUnitConfig.getCacheMemcachedExpiresIn(), obj); } /** @@ -97,7 +97,7 @@ public static void cache(Box box) { * @param cell Cellオブジェクト */ public static void clear(String boxName, Cell cell) { - if (!DcCoreConfig.isBoxCacheEnabled()) { + if (!PersoniumUnitConfig.isBoxCacheEnabled()) { return; } getMcdClient().delete(cacheKey(boxName, cell)); diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/cache/CellCache.java b/src/main/java/io/personium/core/model/impl/es/cache/CellCache.java similarity index 79% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/cache/CellCache.java rename to src/main/java/io/personium/core/model/impl/es/cache/CellCache.java index d31639b9e..17b95804c 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/cache/CellCache.java +++ b/src/main/java/io/personium/core/model/impl/es/cache/CellCache.java @@ -14,17 +14,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.cache; +package io.personium.core.model.impl.es.cache; import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.utils.CacheClient; -import com.fujitsu.dc.core.utils.MemcachedClient; -import com.fujitsu.dc.core.utils.MemcachedClient.MemcachedClientException; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.utils.CacheClient; +import io.personium.core.utils.MemcachedClient; +import io.personium.core.utils.MemcachedClient.MemcachedClientException; /** * Cellのキャッシュを扱うクラス. @@ -47,7 +47,7 @@ static CacheClient getMcdClient() { * @return Cell情報を格納したMapオブジェクト。キャッシュに存在しない場合はnull */ public static Map get(String cellName) { - if (!DcCoreConfig.isCellCacheEnabled()) { + if (!PersoniumUnitConfig.isCellCacheEnabled()) { return null; } try { @@ -67,10 +67,10 @@ public static Map get(String cellName) { * @param cell Cell情報を格納したMapオブジェクト */ public static void cache(String cellName, Map cell) { - if (!DcCoreConfig.isCellCacheEnabled()) { + if (!PersoniumUnitConfig.isCellCacheEnabled()) { return; } - getMcdClient().put(cacheKey(cellName), DcCoreConfig.getCacheMemcachedExpiresIn(), cell); + getMcdClient().put(cacheKey(cellName), PersoniumUnitConfig.getCacheMemcachedExpiresIn(), cell); } /** @@ -78,7 +78,7 @@ public static void cache(String cellName, Map cell) { * @param cellName Cell名 */ public static void clear(String cellName) { - if (!DcCoreConfig.isCellCacheEnabled()) { + if (!PersoniumUnitConfig.isCellCacheEnabled()) { return; } getMcdClient().delete(cacheKey(cellName)); diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/cache/UserDataSchemaCache.java b/src/main/java/io/personium/core/model/impl/es/cache/UserDataSchemaCache.java similarity index 82% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/cache/UserDataSchemaCache.java rename to src/main/java/io/personium/core/model/impl/es/cache/UserDataSchemaCache.java index d0707fa06..5041cae1d 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/cache/UserDataSchemaCache.java +++ b/src/main/java/io/personium/core/model/impl/es/cache/UserDataSchemaCache.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.cache; +package io.personium.core.model.impl.es.cache; import java.util.HashMap; import java.util.Map; @@ -22,10 +22,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.utils.CacheClient; -import com.fujitsu.dc.core.utils.MemcachedClient; -import com.fujitsu.dc.core.utils.MemcachedClient.MemcachedClientException; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.utils.CacheClient; +import io.personium.core.utils.MemcachedClient; +import io.personium.core.utils.MemcachedClient.MemcachedClientException; /** * ユーザデータスキーマのキャッシュを扱うクラス. @@ -47,7 +47,7 @@ private UserDataSchemaCache() { * @return スキーマ情報を格納したMapオブジェクト。キャッシュに存在しない場合はnull */ public static Map get(String nodeId) { - if (!DcCoreConfig.isSchemaCacheEnabled()) { + if (!PersoniumUnitConfig.isSchemaCacheEnabled()) { return null; } try { @@ -67,10 +67,10 @@ public static Map get(String nodeId) { * @param schema スキーマ情報を格納したMapオブジェクト */ public static void cache(String nodeId, Map schema) { - if (!DcCoreConfig.isSchemaCacheEnabled()) { + if (!PersoniumUnitConfig.isSchemaCacheEnabled()) { return; } - getMcdClient().put(cacheKey(nodeId), DcCoreConfig.getCacheMemcachedExpiresIn(), schema); + getMcdClient().put(cacheKey(nodeId), PersoniumUnitConfig.getCacheMemcachedExpiresIn(), schema); } /** @@ -78,7 +78,7 @@ public static void cache(String nodeId, Map schema) { * @param nodeId ノードID */ public static void clear(String nodeId) { - if (!DcCoreConfig.isSchemaCacheEnabled()) { + if (!PersoniumUnitConfig.isSchemaCacheEnabled()) { return; } getMcdClient().delete(cacheKey(nodeId)); @@ -89,13 +89,13 @@ public static void clear(String nodeId) { * @param nodeId ノードID */ public static void disable(String nodeId) { - if (!DcCoreConfig.isSchemaCacheEnabled()) { + if (!PersoniumUnitConfig.isSchemaCacheEnabled()) { return; } Map schema = new HashMap(); schema.put("disabledTime", System.currentTimeMillis()); - getMcdClient().put(cacheKey(nodeId), DcCoreConfig.getCacheMemcachedExpiresIn(), schema); + getMcdClient().put(cacheKey(nodeId), PersoniumUnitConfig.getCacheMemcachedExpiresIn(), schema); } /** @@ -104,7 +104,7 @@ public static void disable(String nodeId) { * @return 無効の場合はtrue,有効の場合はfalse */ public static boolean isDisabled(Map cache) { - if (!DcCoreConfig.isSchemaCacheEnabled()) { + if (!PersoniumUnitConfig.isSchemaCacheEnabled()) { return true; } @@ -123,7 +123,7 @@ public static boolean isDisabled(Map cache) { */ @SuppressWarnings("unchecked") public static boolean isChanged(String nodeId, Map cache) { - if (!DcCoreConfig.isSchemaCacheEnabled()) { + if (!PersoniumUnitConfig.isSchemaCacheEnabled()) { return false; } diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/cache/package-info.java b/src/main/java/io/personium/core/model/impl/es/cache/package-info.java similarity index 90% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/cache/package-info.java rename to src/main/java/io/personium/core/model/impl/es/cache/package-info.java index 8adfa9472..b09f96bb4 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/cache/package-info.java +++ b/src/main/java/io/personium/core/model/impl/es/cache/package-info.java @@ -17,5 +17,5 @@ /** * ElasticSearchのバックエンドを操作するクラス群. */ -package com.fujitsu.dc.core.model.impl.es.cache; +package io.personium.core.model.impl.es.cache; diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/doc/CellDocHandler.java b/src/main/java/io/personium/core/model/impl/es/doc/CellDocHandler.java similarity index 87% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/doc/CellDocHandler.java rename to src/main/java/io/personium/core/model/impl/es/doc/CellDocHandler.java index 56ab06501..f6b008824 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/doc/CellDocHandler.java +++ b/src/main/java/io/personium/core/model/impl/es/doc/CellDocHandler.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.doc; +package io.personium.core.model.impl.es.doc; import java.util.HashMap; import java.util.Map; @@ -24,9 +24,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.es.response.DcGetResponse; -import com.fujitsu.dc.common.es.response.DcSearchHit; -import com.fujitsu.dc.core.odata.OEntityWrapper; +import io.personium.common.es.response.PersoniumGetResponse; +import io.personium.common.es.response.PersoniumSearchHit; +import io.personium.core.odata.OEntityWrapper; /** * CellのDocHandler. @@ -68,7 +68,7 @@ public CellDocHandler() { * Constructor. * @param getResponse GetResponse */ - public CellDocHandler(DcGetResponse getResponse) { + public CellDocHandler(PersoniumGetResponse getResponse) { super(getResponse); if (this.aclFields == null) { aclFields = new HashMap(); @@ -92,7 +92,7 @@ public CellDocHandler(String type, OEntityWrapper oEntity, EdmDataServices metad * Constructor. * @param searchHit SearchHit */ - public CellDocHandler(DcSearchHit searchHit) { + public CellDocHandler(PersoniumSearchHit searchHit) { super(searchHit); if (this.aclFields == null) { aclFields = new HashMap(); diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/doc/ComplexTypePropertyDocHandler.java b/src/main/java/io/personium/core/model/impl/es/doc/ComplexTypePropertyDocHandler.java similarity index 89% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/doc/ComplexTypePropertyDocHandler.java rename to src/main/java/io/personium/core/model/impl/es/doc/ComplexTypePropertyDocHandler.java index 85f1ba87a..29a775382 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/doc/ComplexTypePropertyDocHandler.java +++ b/src/main/java/io/personium/core/model/impl/es/doc/ComplexTypePropertyDocHandler.java @@ -14,18 +14,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.doc; +package io.personium.core.model.impl.es.doc; import java.util.HashMap; import java.util.Map; import org.odata4j.edm.EdmDataServices; -import com.fujitsu.dc.core.model.ctl.ComplexType; -import com.fujitsu.dc.core.model.ctl.ComplexTypeProperty; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.core.model.impl.es.odata.PropertyAlias; -import com.fujitsu.dc.core.odata.OEntityWrapper; +import io.personium.core.model.ctl.ComplexType; +import io.personium.core.model.ctl.ComplexTypeProperty; +import io.personium.core.model.ctl.Property; +import io.personium.core.model.impl.es.odata.PropertyAlias; +import io.personium.core.odata.OEntityWrapper; /** * ComplexTypeプロパティのDocHandler. diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/doc/ComplexTypePropertyUpdateDocHandler.java b/src/main/java/io/personium/core/model/impl/es/doc/ComplexTypePropertyUpdateDocHandler.java similarity index 90% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/doc/ComplexTypePropertyUpdateDocHandler.java rename to src/main/java/io/personium/core/model/impl/es/doc/ComplexTypePropertyUpdateDocHandler.java index 2d0d445ed..0459782a8 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/doc/ComplexTypePropertyUpdateDocHandler.java +++ b/src/main/java/io/personium/core/model/impl/es/doc/ComplexTypePropertyUpdateDocHandler.java @@ -14,13 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.doc; +package io.personium.core.model.impl.es.doc; import java.util.Map; import org.odata4j.edm.EdmDataServices; -import com.fujitsu.dc.core.odata.OEntityWrapper; +import io.personium.core.odata.OEntityWrapper; /** * ComplexTypeプロパティを更新する際に使用するDocHandler. diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/doc/EntitySetDocHandler.java b/src/main/java/io/personium/core/model/impl/es/doc/EntitySetDocHandler.java similarity index 94% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/doc/EntitySetDocHandler.java rename to src/main/java/io/personium/core/model/impl/es/doc/EntitySetDocHandler.java index 91a09d2c6..0037ee5ed 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/doc/EntitySetDocHandler.java +++ b/src/main/java/io/personium/core/model/impl/es/doc/EntitySetDocHandler.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.doc; +package io.personium.core.model.impl.es.doc; import java.util.List; import java.util.Map; @@ -25,7 +25,7 @@ import org.odata4j.edm.EdmEntitySet; import org.odata4j.expression.EntitySimpleProperty; -import com.fujitsu.dc.core.odata.OEntityWrapper; +import io.personium.core.odata.OEntityWrapper; /** * ElasticSearchのドキュメントを生成するHandler. diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/doc/EsDocHandler.java b/src/main/java/io/personium/core/model/impl/es/doc/EsDocHandler.java similarity index 91% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/doc/EsDocHandler.java rename to src/main/java/io/personium/core/model/impl/es/doc/EsDocHandler.java index 6896731f4..e8430bebd 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/doc/EsDocHandler.java +++ b/src/main/java/io/personium/core/model/impl/es/doc/EsDocHandler.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.doc; +package io.personium.core.model.impl.es.doc; import java.util.Map; diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/doc/LinkDocHandler.java b/src/main/java/io/personium/core/model/impl/es/doc/LinkDocHandler.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/doc/LinkDocHandler.java rename to src/main/java/io/personium/core/model/impl/es/doc/LinkDocHandler.java index 5e86fce57..e95300837 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/doc/LinkDocHandler.java +++ b/src/main/java/io/personium/core/model/impl/es/doc/LinkDocHandler.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.doc; +package io.personium.core.model.impl.es.doc; import java.util.ArrayList; import java.util.Date; @@ -25,13 +25,13 @@ import org.odata4j.producer.QueryInfo; -import com.fujitsu.dc.common.es.response.DcSearchHit; -import com.fujitsu.dc.common.es.response.DcSearchResponse; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.model.impl.es.QueryMapFactory; -import com.fujitsu.dc.core.model.impl.es.accessor.ODataLinkAccessor; -import com.fujitsu.dc.core.model.impl.es.odata.EsQueryHandler; -import com.fujitsu.dc.core.model.impl.es.odata.UserDataODataProducer; +import io.personium.common.es.response.PersoniumSearchHit; +import io.personium.common.es.response.PersoniumSearchResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.model.impl.es.QueryMapFactory; +import io.personium.core.model.impl.es.accessor.ODataLinkAccessor; +import io.personium.core.model.impl.es.odata.EsQueryHandler; +import io.personium.core.model.impl.es.odata.UserDataODataProducer; /** * ESでN:Nリンクを扱う. リンクは2つのタイプの間に張られている。 EsLinkHandler elh = new EsLinkHandler(type1, type2); 双方のキーを指定して、リンクドキュメントを作成する。 @@ -49,7 +49,7 @@ public class LinkDocHandler implements EsDocHandler { private Long published; private Long updated; - private static final int DEFAULT_TOP_VALUE = DcCoreConfig.getTopQueryDefaultSize(); + private static final int DEFAULT_TOP_VALUE = PersoniumUnitConfig.getTopQueryDefaultSize(); /** * コンストラクタ. @@ -100,7 +100,7 @@ public LinkDocHandler(final EntitySetDocHandler srcHandler, final EntitySetDocHa * 検索結果からLinkDocHandlerを生成するコンストラクタ. * @param searchHit 検索結果データ */ - public LinkDocHandler(final DcSearchHit searchHit) { + public LinkDocHandler(final PersoniumSearchHit searchHit) { this.id = searchHit.getId(); Map source = searchHit.getSource(); @@ -319,12 +319,12 @@ public static List query(final ODataLinkAccessor accessor, } List ret = new ArrayList(); - DcSearchResponse sr = accessor.search(parameter.getSource(size, from)); + PersoniumSearchResponse sr = accessor.search(parameter.getSource(size, from)); if (sr == null) { return ret; } - for (DcSearchHit hit : sr.getHits().getHits()) { + for (PersoniumSearchHit hit : sr.getHits().getHits()) { Map hs = hit.getSource(); ret.add((String) hs.get(parameter.getTargetKey())); } diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/doc/LinkDocHandlerForBulkRequest.java b/src/main/java/io/personium/core/model/impl/es/doc/LinkDocHandlerForBulkRequest.java similarity index 93% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/doc/LinkDocHandlerForBulkRequest.java rename to src/main/java/io/personium/core/model/impl/es/doc/LinkDocHandlerForBulkRequest.java index 8bd7bad1e..9750f6827 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/doc/LinkDocHandlerForBulkRequest.java +++ b/src/main/java/io/personium/core/model/impl/es/doc/LinkDocHandlerForBulkRequest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.doc; +package io.personium.core.model.impl.es.doc; import java.util.List; import java.util.Map; @@ -25,7 +25,7 @@ import org.odata4j.edm.EdmEntitySet; import org.odata4j.expression.EntitySimpleProperty; -import com.fujitsu.dc.core.odata.OEntityWrapper; +import io.personium.core.odata.OEntityWrapper; /** * LinkDocHandlerをバルクで扱うためのDocHandler. diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/doc/OEntityDocHandler.java b/src/main/java/io/personium/core/model/impl/es/doc/OEntityDocHandler.java similarity index 94% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/doc/OEntityDocHandler.java rename to src/main/java/io/personium/core/model/impl/es/doc/OEntityDocHandler.java index c442ff9ac..0945f1733 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/doc/OEntityDocHandler.java +++ b/src/main/java/io/personium/core/model/impl/es/doc/OEntityDocHandler.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.doc; +package io.personium.core.model.impl.es.doc; import java.util.ArrayList; import java.util.HashMap; @@ -55,17 +55,17 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.es.response.DcGetResponse; -import com.fujitsu.dc.common.es.response.DcSearchHit; -import com.fujitsu.dc.common.es.response.DcSearchHitField; -import com.fujitsu.dc.common.es.util.IndexNameEncoder; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.core.odata.OEntityWrapper; -import com.fujitsu.dc.core.rs.odata.AbstractODataResource; +import io.personium.common.es.response.PersoniumGetResponse; +import io.personium.common.es.response.PersoniumSearchHit; +import io.personium.common.es.response.PersoniumSearchHitField; +import io.personium.common.es.util.IndexNameEncoder; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.auth.AccessContext; +import io.personium.core.model.ctl.Common; +import io.personium.core.model.ctl.Property; +import io.personium.core.odata.OEntityWrapper; +import io.personium.core.rs.odata.AbstractODataResource; /** * OEntityのDocHandler. @@ -151,7 +151,7 @@ public void setUpdated(Long updated) { * Constructor. * @param getResponse GetResponse */ - public OEntityDocHandler(DcGetResponse getResponse) { + public OEntityDocHandler(PersoniumGetResponse getResponse) { this.type = getResponse.getType(); this.id = getResponse.getId(); this.version = getResponse.getVersion(); @@ -190,10 +190,10 @@ protected Map parseLinks(Map source) { return (Map) source.get(KEY_LINK); } - void parseFields(Map fields) { - for (Map.Entry ent : fields.entrySet()) { + void parseFields(Map fields) { + for (Map.Entry ent : fields.entrySet()) { String key = ent.getKey(); - DcSearchHitField value = ent.getValue(); + PersoniumSearchHitField value = ent.getValue(); if (key.startsWith(KEY_STATIC_FIELDS + ".")) { this.staticFields.put(key.substring((KEY_STATIC_FIELDS + ".").length()), value.getValues().get(0)); @@ -215,7 +215,7 @@ void parseFields(Map fields) { * Constructor. * @param searchHit SearchHit */ - public OEntityDocHandler(DcSearchHit searchHit) { + public OEntityDocHandler(PersoniumSearchHit searchHit) { this.type = searchHit.getType(); this.id = searchHit.getId(); this.version = searchHit.getVersion(); @@ -223,7 +223,7 @@ public OEntityDocHandler(DcSearchHit searchHit) { if (source != null) { this.parseSource(source); } -// Map fields = searchHit.getFields(); +// Map fields = searchHit.getFields(); // if (fields.size() > 0) { // this.parseFields(fields); // } @@ -311,7 +311,7 @@ protected void initInstance(String typeName, OEntityWrapper oEntityWrapper, EdmD this.staticFields.put(prop.getName(), getSimpleList(edmProperty.getType(), (OCollection) value)); } else { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(prop.getName()); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(prop.getName()); } } else { value = getSimpleValue(prop, edmProperty.getType()); @@ -377,7 +377,7 @@ public void resolveUnitUserName(final Map hiddenFieldsMap) { } // Adsアクセス用にUnitUser名を設定する String owner = (String) hiddenFieldsMap.get("Owner"); - this.unitUserName = DcCoreConfig.getEsUnitPrefix() + "_"; + this.unitUserName = PersoniumUnitConfig.getEsUnitPrefix() + "_"; if (owner == null) { this.unitUserName += AccessContext.TYPE_ANONYMOUS; } else { @@ -491,7 +491,7 @@ private Object getComplexType(List> props, EdmDataServices metadata complex.put(prop.getName(), getSimpleList(edmProp.getType(), (OCollection) prop.getValue())); } else { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(prop.getName()); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(prop.getName()); } } else { Object value = getSimpleValue(prop, edmProp.getType()); @@ -595,7 +595,7 @@ public OEntityWrapper createOEntity(final EdmEntitySet entitySet, } boolean isDynamic = false; - NamespacedAnnotation annotation = prop.findAnnotation(Common.DC_NAMESPACE.getUri(), + NamespacedAnnotation annotation = prop.findAnnotation(Common.P_NAMESPACE.getUri(), Property.P_IS_DECLARED.getName()); if (annotation != null && !(Boolean.valueOf(annotation.getValue().toString()))) { isDynamic = true; diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/doc/PropertyDocHandler.java b/src/main/java/io/personium/core/model/impl/es/doc/PropertyDocHandler.java similarity index 94% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/doc/PropertyDocHandler.java rename to src/main/java/io/personium/core/model/impl/es/doc/PropertyDocHandler.java index 4a92db233..d7dace94a 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/doc/PropertyDocHandler.java +++ b/src/main/java/io/personium/core/model/impl/es/doc/PropertyDocHandler.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.doc; +package io.personium.core.model.impl.es.doc; import java.util.ArrayList; import java.util.HashMap; @@ -23,10 +23,10 @@ import org.odata4j.edm.EdmDataServices; -import com.fujitsu.dc.core.model.ctl.EntityType; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.core.model.impl.es.odata.PropertyAlias; -import com.fujitsu.dc.core.odata.OEntityWrapper; +import io.personium.core.model.ctl.EntityType; +import io.personium.core.model.ctl.Property; +import io.personium.core.model.impl.es.odata.PropertyAlias; +import io.personium.core.odata.OEntityWrapper; /** * プロパティのDocHandler. diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/doc/PropertyUpdateDocHandler.java b/src/main/java/io/personium/core/model/impl/es/doc/PropertyUpdateDocHandler.java similarity index 90% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/doc/PropertyUpdateDocHandler.java rename to src/main/java/io/personium/core/model/impl/es/doc/PropertyUpdateDocHandler.java index 2f05dcd45..2e6376035 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/doc/PropertyUpdateDocHandler.java +++ b/src/main/java/io/personium/core/model/impl/es/doc/PropertyUpdateDocHandler.java @@ -14,13 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.doc; +package io.personium.core.model.impl.es.doc; import java.util.Map; import org.odata4j.edm.EdmDataServices; -import com.fujitsu.dc.core.odata.OEntityWrapper; +import io.personium.core.odata.OEntityWrapper; /** * プロパティを更新する際に使用するDocHandler. diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/doc/UserDataDocHandler.java b/src/main/java/io/personium/core/model/impl/es/doc/UserDataDocHandler.java similarity index 94% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/doc/UserDataDocHandler.java rename to src/main/java/io/personium/core/model/impl/es/doc/UserDataDocHandler.java index b54f924ef..8065e62b3 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/doc/UserDataDocHandler.java +++ b/src/main/java/io/personium/core/model/impl/es/doc/UserDataDocHandler.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.doc; +package io.personium.core.model.impl.es.doc; import java.util.ArrayList; import java.util.HashMap; @@ -34,14 +34,14 @@ import org.odata4j.edm.EdmSimpleType; import org.odata4j.edm.EdmType; -import com.fujitsu.dc.common.es.response.DcGetResponse; -import com.fujitsu.dc.common.es.response.DcSearchHit; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.model.ctl.ComplexTypeProperty; -import com.fujitsu.dc.core.model.ctl.CtlSchema; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.core.model.impl.es.odata.PropertyAlias; -import com.fujitsu.dc.core.odata.OEntityWrapper; +import io.personium.common.es.response.PersoniumGetResponse; +import io.personium.common.es.response.PersoniumSearchHit; +import io.personium.core.model.ctl.Common; +import io.personium.core.model.ctl.ComplexTypeProperty; +import io.personium.core.model.ctl.CtlSchema; +import io.personium.core.model.ctl.Property; +import io.personium.core.model.impl.es.odata.PropertyAlias; +import io.personium.core.odata.OEntityWrapper; /** * OEntityのDocHandler. @@ -63,7 +63,7 @@ public UserDataDocHandler() { * ESの1件取得結果からUserDataDocHandlerのインスタンスを生成するコンストラクタ. * @param getResponse . */ - public UserDataDocHandler(DcGetResponse getResponse) { + public UserDataDocHandler(PersoniumGetResponse getResponse) { super(getResponse); this.propertyAliasMap = null; this.entitySetName = null; @@ -73,7 +73,7 @@ public UserDataDocHandler(DcGetResponse getResponse) { * ESの検索結果からUserDataDocHandlerのインスタンスを生成するコンストラクタ. * @param searchHit . */ - public UserDataDocHandler(DcSearchHit searchHit) { + public UserDataDocHandler(PersoniumSearchHit searchHit) { super(searchHit); this.propertyAliasMap = null; this.entitySetName = null; @@ -158,7 +158,7 @@ public void convertAliasToName(EdmDataServices metadata) { continue; } boolean isDynamic = false; - NamespacedAnnotation annotation = prop.findAnnotation(Common.DC_NAMESPACE.getUri(), + NamespacedAnnotation annotation = prop.findAnnotation(Common.P_NAMESPACE.getUri(), Property.P_IS_DECLARED.getName()); if (annotation != null && !(Boolean.valueOf(annotation.getValue().toString()))) { isDynamic = true; diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/doc/UserDataLinkDocHandler.java b/src/main/java/io/personium/core/model/impl/es/doc/UserDataLinkDocHandler.java similarity index 90% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/doc/UserDataLinkDocHandler.java rename to src/main/java/io/personium/core/model/impl/es/doc/UserDataLinkDocHandler.java index a913a120b..217c1430d 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/doc/UserDataLinkDocHandler.java +++ b/src/main/java/io/personium/core/model/impl/es/doc/UserDataLinkDocHandler.java @@ -14,11 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.doc; +package io.personium.core.model.impl.es.doc; import java.util.TreeMap; -import com.fujitsu.dc.common.es.response.DcSearchHit; +import io.personium.common.es.response.PersoniumSearchHit; /** * ESでN:Nリンクを扱う. リンクは2つのタイプの間に張られている。 EsLinkHandler elh = new EsLinkHandler(type1, type2); 双方のキーを指定して、リンクドキュメントを作成する。 @@ -63,7 +63,7 @@ public UserDataLinkDocHandler(final EntitySetDocHandler srcHandler, final Entity * コンストラクタ. * @param searchHit 検索結果 */ - public UserDataLinkDocHandler(DcSearchHit searchHit) { + public UserDataLinkDocHandler(PersoniumSearchHit searchHit) { super(searchHit); } diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/doc/package-info.java b/src/main/java/io/personium/core/model/impl/es/doc/package-info.java similarity index 91% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/doc/package-info.java rename to src/main/java/io/personium/core/model/impl/es/doc/package-info.java index 7b13fbf86..8c7ad3768 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/doc/package-info.java +++ b/src/main/java/io/personium/core/model/impl/es/doc/package-info.java @@ -17,5 +17,5 @@ /** * Esに格納するデータとESに依存しないデータモデルを相互変換するオブジェクト群. */ -package com.fujitsu.dc.core.model.impl.es.doc; +package io.personium.core.model.impl.es.doc; diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/BatchLinkContext.java b/src/main/java/io/personium/core/model/impl/es/odata/BatchLinkContext.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/odata/BatchLinkContext.java rename to src/main/java/io/personium/core/model/impl/es/odata/BatchLinkContext.java index 7992a48b4..0fc19d06c 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/BatchLinkContext.java +++ b/src/main/java/io/personium/core/model/impl/es/odata/BatchLinkContext.java @@ -14,9 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.odata; +package io.personium.core.model.impl.es.odata; -import com.fujitsu.dc.core.model.impl.es.doc.EntitySetDocHandler; +import io.personium.core.model.impl.es.doc.EntitySetDocHandler; /** * ユーザODataの$batch内のリンク情報を保持するためのクラス. diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/CellCtlODataProducer.java b/src/main/java/io/personium/core/model/impl/es/odata/CellCtlODataProducer.java similarity index 86% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/odata/CellCtlODataProducer.java rename to src/main/java/io/personium/core/model/impl/es/odata/CellCtlODataProducer.java index e7f9052c2..64647b9dc 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/CellCtlODataProducer.java +++ b/src/main/java/io/personium/core/model/impl/es/odata/CellCtlODataProducer.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.odata; +package io.personium.core.model.impl.es.odata; import java.util.HashMap; import java.util.Map; @@ -32,27 +32,27 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.es.response.DcIndexResponse; -import com.fujitsu.dc.common.es.util.DcUUID; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.BoxCmp; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.ModelFactory; -import com.fujitsu.dc.core.model.ctl.CtlSchema; -import com.fujitsu.dc.core.model.ctl.ExtCell; -import com.fujitsu.dc.core.model.ctl.ReceivedMessage; -import com.fujitsu.dc.core.model.ctl.ReceivedMessagePort; -import com.fujitsu.dc.core.model.ctl.Relation; -import com.fujitsu.dc.core.model.impl.es.EsModel; -import com.fujitsu.dc.core.model.impl.es.accessor.DataSourceAccessor; -import com.fujitsu.dc.core.model.impl.es.accessor.EntitySetAccessor; -import com.fujitsu.dc.core.model.impl.es.accessor.ODataLinkAccessor; -import com.fujitsu.dc.core.model.impl.es.cache.BoxCache; -import com.fujitsu.dc.core.model.impl.es.doc.EntitySetDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.OEntityDocHandler; -import com.fujitsu.dc.core.model.lock.Lock; -import com.fujitsu.dc.core.odata.OEntityWrapper; +import io.personium.common.es.response.PersoniumIndexResponse; +import io.personium.common.es.util.PersoniumUUID; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.Box; +import io.personium.core.model.BoxCmp; +import io.personium.core.model.Cell; +import io.personium.core.model.ModelFactory; +import io.personium.core.model.ctl.CtlSchema; +import io.personium.core.model.ctl.ExtCell; +import io.personium.core.model.ctl.ReceivedMessage; +import io.personium.core.model.ctl.ReceivedMessagePort; +import io.personium.core.model.ctl.Relation; +import io.personium.core.model.impl.es.EsModel; +import io.personium.core.model.impl.es.accessor.DataSourceAccessor; +import io.personium.core.model.impl.es.accessor.EntitySetAccessor; +import io.personium.core.model.impl.es.accessor.ODataLinkAccessor; +import io.personium.core.model.impl.es.cache.BoxCache; +import io.personium.core.model.impl.es.doc.EntitySetDocHandler; +import io.personium.core.model.impl.es.doc.OEntityDocHandler; +import io.personium.core.model.lock.Lock; +import io.personium.core.odata.OEntityWrapper; /** * Cell管理オブジェクトの ODataProducer. @@ -108,7 +108,7 @@ public DataSourceAccessor getAccessorForBatch() { /** * CellのIdを返すよう実装. - * @see com.fujitsu.dc.core.model.impl.es.odata.EsODataProducer#getCellId() + * @see io.personium.core.model.impl.es.odata.EsODataProducer#getCellId() * @return cell id */ @Override @@ -151,7 +151,7 @@ public void beforeDelete(final String entitySetName, // このBoxが存在するときのみBoxCmpが必要 BoxCmp davCmp = ModelFactory.boxCmp(box); if (!davCmp.isEmpty()) { - throw DcCoreException.OData.CONFLICT_HAS_RELATED; + throw PersoniumCoreException.OData.CONFLICT_HAS_RELATED; } davCmp.delete(null, false); // BoxのCacheクリア @@ -183,7 +183,7 @@ public String changeStatusAndUpdateRelation(final EdmEntitySet entitySet, // ESから変更する受信メッセージ情報を取得する EntitySetDocHandler entitySetDocHandler = this.retrieveWithKey(entitySet, originalKey); if (entitySetDocHandler == null) { - throw DcCoreException.OData.NO_SUCH_ENTITY; + throw PersoniumCoreException.OData.NO_SUCH_ENTITY; } // TypeとStatusのチェック @@ -194,7 +194,7 @@ public String changeStatusAndUpdateRelation(final EdmEntitySet entitySet, if (!isValidMessageStatus(type, status) || !isValidRelationStatus(type, status) || !isValidCurrentStatus(type, currentStatus)) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(ReceivedMessage.MESSAGE_COMMAND); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(ReceivedMessage.MESSAGE_COMMAND); } // 関係登録/削除 @@ -206,7 +206,7 @@ public String changeStatusAndUpdateRelation(final EdmEntitySet entitySet, // ESに保存する EntitySetAccessor esType = this.getAccessorForEntitySet(entitySet.getName()); Long version = entitySetDocHandler.getVersion(); - DcIndexResponse idxRes; + PersoniumIndexResponse idxRes; idxRes = esType.update(entitySetDocHandler.getId(), entitySetDocHandler, version); entitySetDocHandler.setVersion(idxRes.version()); return entitySetDocHandler.createEtag(); @@ -286,10 +286,10 @@ private void createRelationExtCellLinks(String relationKey, String requestExtCel // n:nの場合 createLinks(relationEntityId, extCellEntityId); - } catch (DcCoreException e) { - if (DcCoreException.OData.CONFLICT_LINKS.getCode().equals(e.getCode())) { + } catch (PersoniumCoreException e) { + if (PersoniumCoreException.OData.CONFLICT_LINKS.getCode().equals(e.getCode())) { // $linksが既に存在する場合 - throw DcCoreException.ReceiveMessage.REQUEST_RELATION_EXISTS_ERROR; + throw PersoniumCoreException.ReceiveMessage.REQUEST_RELATION_EXISTS_ERROR; } throw e; } @@ -300,7 +300,7 @@ private OEntityKey createExtCellOEntityKey(String requestExtCell) { try { extCellOEntityKey = OEntityKey.parse("('" + requestExtCell + "')"); } catch (IllegalArgumentException e) { - throw DcCoreException.ReceiveMessage.REQUEST_RELATION_TARGET_PARSE_ERROR.reason(e); + throw PersoniumCoreException.ReceiveMessage.REQUEST_RELATION_TARGET_PARSE_ERROR.reason(e); } return extCellOEntityKey; } @@ -310,7 +310,7 @@ private OEntityKey createRelationOEntityKey(String relationKey) { try { relationOEntityKey = OEntityKey.parse("('" + relationKey + "')"); } catch (IllegalArgumentException e) { - throw DcCoreException.ReceiveMessage.REQUEST_RELATION_PARSE_ERROR.reason(e); + throw PersoniumCoreException.ReceiveMessage.REQUEST_RELATION_PARSE_ERROR.reason(e); } return relationOEntityKey; } @@ -376,7 +376,7 @@ private void createEntity(String typeName, Map staticFields) { // EntitySetDocHandlerの作成 EntitySetDocHandler oedh = new OEntityDocHandler(); oedh.setType(typeName); - oedh.setId(DcUUID.randomUUID()); + oedh.setId(PersoniumUUID.randomUUID()); // staticFields oedh.setStaticFields(staticFields); @@ -397,7 +397,7 @@ private void createEntity(String typeName, Map staticFields) { // setLinksFromOEntity(getMetadata().findEdmEntitySet(Relation.EDM_TYPE_NAME).getType(), // oEntityKey, entitySetDocHandler); // } catch (NTKPNotFoundException e) { - // throw DcCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.params(e.getMessage()); + // throw PersoniumCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.params(e.getMessage()); // } // } @@ -422,14 +422,14 @@ protected void breakRelation(EntitySetDocHandler entitySetDocHandler) { .get(ReceivedMessagePort.P_REQUEST_RELATION.getName()).toString(); String relationName = getRelationFromRelationClassUrl(reqRelation); if (relationName == null) { - throw DcCoreException.ReceiveMessage.REQUEST_RELATION_PARSE_ERROR; + throw PersoniumCoreException.ReceiveMessage.REQUEST_RELATION_PARSE_ERROR; } // 対象のRelationが存在することを確認 EntitySetDocHandler relation = getRelation(relationName); if (relation == null) { log.debug(String.format("RequestRelation does not exists. [%s]", relationName)); - throw DcCoreException.ReceiveMessage.REQUEST_RELATION_DOES_NOT_EXISTS.params(relationName); + throw PersoniumCoreException.ReceiveMessage.REQUEST_RELATION_DOES_NOT_EXISTS.params(relationName); } // 対象のExtCell(RequestRelationTarget)が存在することを確認 @@ -438,14 +438,14 @@ protected void breakRelation(EntitySetDocHandler entitySetDocHandler) { EntitySetDocHandler extCell = getExtCell(extCellUrl); if (extCell == null) { log.debug(String.format("RequestRelationTarget does not exists. [%s]", extCellUrl)); - throw DcCoreException.ReceiveMessage.REQUEST_RELATION_TARGET_DOES_NOT_EXISTS.params(extCellUrl); + throw PersoniumCoreException.ReceiveMessage.REQUEST_RELATION_TARGET_DOES_NOT_EXISTS.params(extCellUrl); } // RelationとExtCellの関連を削除する if (!deleteLinkEntity(relation, extCell)) { log.debug(String.format("RequestRelation and RequestRelationTarget does not related. [%s] - [%s]", relationName, extCellUrl)); - throw DcCoreException.ReceiveMessage.LINK_DOES_NOT_EXISTS.params(relationName, extCellUrl); + throw PersoniumCoreException.ReceiveMessage.LINK_DOES_NOT_EXISTS.params(relationName, extCellUrl); } log.debug("breakRelation success."); } diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/EsNavigationTargetKeyProperty.java b/src/main/java/io/personium/core/model/impl/es/odata/EsNavigationTargetKeyProperty.java similarity index 91% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/odata/EsNavigationTargetKeyProperty.java rename to src/main/java/io/personium/core/model/impl/es/odata/EsNavigationTargetKeyProperty.java index d6d943879..300edd0ac 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/EsNavigationTargetKeyProperty.java +++ b/src/main/java/io/personium/core/model/impl/es/odata/EsNavigationTargetKeyProperty.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.odata; +package io.personium.core.model.impl.es.odata; import java.util.ArrayList; import java.util.HashMap; @@ -26,12 +26,12 @@ import org.odata4j.core.OProperties; import org.odata4j.core.OProperty; -import com.fujitsu.dc.common.es.response.DcSearchHits; -import com.fujitsu.dc.core.model.impl.es.QueryMapFactory; -import com.fujitsu.dc.core.model.impl.es.accessor.EntitySetAccessor; -import com.fujitsu.dc.core.model.impl.es.doc.OEntityDocHandler; -import com.fujitsu.dc.core.odata.NavigationTargetKeyProperty; -import com.fujitsu.dc.core.rs.odata.AbstractODataResource; +import io.personium.common.es.response.PersoniumSearchHits; +import io.personium.core.model.impl.es.QueryMapFactory; +import io.personium.core.model.impl.es.accessor.EntitySetAccessor; +import io.personium.core.model.impl.es.doc.OEntityDocHandler; +import io.personium.core.odata.NavigationTargetKeyProperty; +import io.personium.core.rs.odata.AbstractODataResource; /** * NavigationTargetKeyPropertyクラスのES実装. @@ -102,7 +102,7 @@ private Map search() { // 検索の実行 EntitySetAccessor esType = odataProducer.getAccessorForEntitySet(type); - DcSearchHits sHits = esType.search(filter).hits(); + PersoniumSearchHits sHits = esType.search(filter).hits(); Map link = new HashMap(); if (sHits.getCount() == 0) { diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/EsODataProducer.java b/src/main/java/io/personium/core/model/impl/es/odata/EsODataProducer.java similarity index 91% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/odata/EsODataProducer.java rename to src/main/java/io/personium/core/model/impl/es/odata/EsODataProducer.java index 6b8f9bf93..59bf09ebc 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/EsODataProducer.java +++ b/src/main/java/io/personium/core/model/impl/es/odata/EsODataProducer.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.odata; +package io.personium.core.model.impl.es.odata; import java.util.ArrayList; import java.util.HashMap; @@ -58,52 +58,52 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.es.EsBulkRequest; -import com.fujitsu.dc.common.es.response.DcBulkItemResponse; -import com.fujitsu.dc.common.es.response.DcBulkResponse; -import com.fujitsu.dc.common.es.response.DcDeleteResponse; -import com.fujitsu.dc.common.es.response.DcGetResponse; -import com.fujitsu.dc.common.es.response.DcIndexResponse; -import com.fujitsu.dc.common.es.response.DcSearchHit; -import com.fujitsu.dc.common.es.response.DcSearchHits; -import com.fujitsu.dc.common.es.response.DcSearchResponse; -import com.fujitsu.dc.common.es.response.EsClientException; -import com.fujitsu.dc.common.es.response.EsClientException.DcSearchPhaseExecutionException; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.DcCoreLog; -import com.fujitsu.dc.core.model.ctl.AssociationEnd; -import com.fujitsu.dc.core.model.ctl.ComplexType; -import com.fujitsu.dc.core.model.ctl.ComplexTypeProperty; -import com.fujitsu.dc.core.model.ctl.EntityType; -import com.fujitsu.dc.core.model.ctl.ExtRole; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.core.model.ctl.ReceivedMessage; -import com.fujitsu.dc.core.model.ctl.SentMessage; -import com.fujitsu.dc.core.model.impl.es.QueryMapFactory; -import com.fujitsu.dc.core.model.impl.es.accessor.DataSourceAccessor; -import com.fujitsu.dc.core.model.impl.es.accessor.EntitySetAccessor; -import com.fujitsu.dc.core.model.impl.es.accessor.ODataLinkAccessor; -import com.fujitsu.dc.core.model.impl.es.doc.EntitySetDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.LinkDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.LinkDocHandlerForBulkRequest; -import com.fujitsu.dc.core.model.impl.es.doc.OEntityDocHandler; -import com.fujitsu.dc.core.model.impl.es.odata.EsNavigationTargetKeyProperty.NTKPNotFoundException; -import com.fujitsu.dc.core.model.lock.Lock; -import com.fujitsu.dc.core.model.lock.LockManager; -import com.fujitsu.dc.core.odata.DcODataProducer; -import com.fujitsu.dc.core.odata.OEntityWrapper; -import com.fujitsu.dc.core.rs.odata.AbstractODataResource; -import com.fujitsu.dc.core.rs.odata.BulkRequest; -import com.fujitsu.dc.core.rs.odata.ODataBatchResource.NavigationPropertyBulkContext; -import com.fujitsu.dc.core.rs.odata.ODataBatchResource.NavigationPropertyLinkType; -import com.fujitsu.dc.core.utils.ODataUtils; +import io.personium.common.es.EsBulkRequest; +import io.personium.common.es.response.PersoniumBulkItemResponse; +import io.personium.common.es.response.PersoniumBulkResponse; +import io.personium.common.es.response.PersoniumDeleteResponse; +import io.personium.common.es.response.PersoniumGetResponse; +import io.personium.common.es.response.PersoniumIndexResponse; +import io.personium.common.es.response.PersoniumSearchHit; +import io.personium.common.es.response.PersoniumSearchHits; +import io.personium.common.es.response.PersoniumSearchResponse; +import io.personium.common.es.response.EsClientException; +import io.personium.common.es.response.EsClientException.PersoniumSearchPhaseExecutionException; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.PersoniumCoreLog; +import io.personium.core.model.ctl.AssociationEnd; +import io.personium.core.model.ctl.ComplexType; +import io.personium.core.model.ctl.ComplexTypeProperty; +import io.personium.core.model.ctl.EntityType; +import io.personium.core.model.ctl.ExtRole; +import io.personium.core.model.ctl.Property; +import io.personium.core.model.ctl.ReceivedMessage; +import io.personium.core.model.ctl.SentMessage; +import io.personium.core.model.impl.es.QueryMapFactory; +import io.personium.core.model.impl.es.accessor.DataSourceAccessor; +import io.personium.core.model.impl.es.accessor.EntitySetAccessor; +import io.personium.core.model.impl.es.accessor.ODataLinkAccessor; +import io.personium.core.model.impl.es.doc.EntitySetDocHandler; +import io.personium.core.model.impl.es.doc.LinkDocHandler; +import io.personium.core.model.impl.es.doc.LinkDocHandlerForBulkRequest; +import io.personium.core.model.impl.es.doc.OEntityDocHandler; +import io.personium.core.model.impl.es.odata.EsNavigationTargetKeyProperty.NTKPNotFoundException; +import io.personium.core.model.lock.Lock; +import io.personium.core.model.lock.LockManager; +import io.personium.core.odata.PersoniumODataProducer; +import io.personium.core.odata.OEntityWrapper; +import io.personium.core.rs.odata.AbstractODataResource; +import io.personium.core.rs.odata.BulkRequest; +import io.personium.core.rs.odata.ODataBatchResource.NavigationPropertyBulkContext; +import io.personium.core.rs.odata.ODataBatchResource.NavigationPropertyLinkType; +import io.personium.core.utils.ODataUtils; /** * ElasticSearchでODataを扱うProducer. 全体として、スキーマチェックは呼び出し側で行われた上で呼び出される前提とし、 本クラスでは無駄な2重チェックを行わないために、スキーマチェックは行わない。 * 本クラスはElasticSearchでODataを扱う上での特有の処理に特化する。 */ -public abstract class EsODataProducer implements DcODataProducer { +public abstract class EsODataProducer implements PersoniumODataProducer { static Logger log = LoggerFactory.getLogger(EsODataProducer.class); @@ -196,7 +196,7 @@ public LinkDocHandler getLinkDocHandler(EntitySetDocHandler src, EntitySetDocHan * @param searchHit 検索結果 * @return LinkDocHandler */ - public LinkDocHandler getLinkDocHandler(DcSearchHit searchHit) { + public LinkDocHandler getLinkDocHandler(PersoniumSearchHit searchHit) { return new LinkDocHandler(searchHit); } @@ -391,14 +391,14 @@ public void close() { public EntityResponse getEntity(final String entitySetName, final OEntityKey entityKey, final EntityQueryInfo queryInfo) { - final int expandMaxNum = DcCoreConfig.getMaxExpandSizeForRetrive(); + final int expandMaxNum = PersoniumUnitConfig.getMaxExpandSizeForRetrive(); // 注)EntitySetの存在保証は予め呼び出し側で行われているため、ここではチェックしない。 EdmEntitySet eSet = this.getMetadata().findEdmEntitySet(entitySetName); EntitySetDocHandler oedh = this.retrieveWithKey(eSet, entityKey, queryInfo); if (oedh == null) { - throw DcCoreException.OData.NO_SUCH_ENTITY; + throw PersoniumCoreException.OData.NO_SUCH_ENTITY; } ExpandEntitiesMapCreator creator = new ExpandEntitiesMapCreator(queryInfo, eSet.getType(), expandMaxNum); @@ -428,7 +428,7 @@ public EntityResponse getEntity(final String entitySetName, */ public OEntity getEntityByInternalId(final String entitySetName, final String internalId) { - final int expandMaxNum = DcCoreConfig.getMaxExpandSizeForRetrive(); + final int expandMaxNum = PersoniumUnitConfig.getMaxExpandSizeForRetrive(); // 注)EntitySetの存在保証は予め呼び出し側で行われているため、ここではチェックしない。 EdmEntitySet eSet = this.getMetadata().findEdmEntitySet(entitySetName); @@ -475,7 +475,7 @@ public void setNavigationTargetKeyProperty(EdmEntitySet eSet, EntitySetDocHandle // linkの情報を取得する String id = (String) links.get(getLinkskey(entityType)); EntitySetAccessor esType = this.getAccessorForEntitySet(entityType); - DcGetResponse res = esType.get(id); + PersoniumGetResponse res = esType.get(id); if (res != null) { // linkに紐付いているlinkのIDを取得する HashMap tmpntkp = AbstractODataResource.convertNTKP(propName); @@ -490,7 +490,7 @@ public void setNavigationTargetKeyProperty(EdmEntitySet eSet, EntitySetDocHandle String propValue = null; if (linkId != null) { EntitySetAccessor esType = this.getAccessorForEntitySet(entityType); - DcGetResponse res = esType.get(linkId); + PersoniumGetResponse res = esType.get(linkId); if (res != null) { propValue = (String) ((Map) res.getSource().get( OEntityDocHandler.KEY_STATIC_FIELDS)).get(propName); @@ -628,22 +628,22 @@ EntitySetDocHandler retrieveWithKey( // 2. ESへのリクエスト EntitySetAccessor esType = this.getAccessorForEntitySet(entitySetName); - DcSearchResponse res = esType.search(source); + PersoniumSearchResponse res = esType.search(source); // 3. ESからの応答の評価 // Indexつくりたてのときはresがnullになる。データがないのでnullを返せば良い. if (res == null) { return null; } - DcSearchHits hits = res.getHits(); + PersoniumSearchHits hits = res.getHits(); // ヒット件数0はしなかったらNullを返す if (hits.getCount() == 0) { return null; } // データが2件以上返ったら異常事態 if (hits.getAllPages() > 1) { - DcCoreLog.OData.FOUND_MULTIPLE_RECORDS.params(hits.getAllPages()).writeLog(); - throw DcCoreException.Server.DATA_STORE_UNKNOWN_ERROR.reason(new RuntimeException("multiple records (" + PersoniumCoreLog.OData.FOUND_MULTIPLE_RECORDS.params(hits.getAllPages()).writeLog(); + throw PersoniumCoreException.Server.DATA_STORE_UNKNOWN_ERROR.reason(new RuntimeException("multiple records (" + hits.getAllPages() + ") found for the key .")); } // ここで晴れてhit数は1であることが保証されるのでその1件を返す。 @@ -651,7 +651,7 @@ EntitySetDocHandler retrieveWithKey( } private EntitySetDocHandler retrieveWithInternalId(EdmEntitySet eSet, String internalId) { EntitySetAccessor esType = this.getAccessorForEntitySet(eSet.getName()); - DcGetResponse getRes = esType.get(internalId); + PersoniumGetResponse getRes = esType.get(internalId); if (getRes == null) { return null; } @@ -665,7 +665,7 @@ private EntitySetDocHandler retrieveWithInternalId(EdmEntitySet eSet, String int * @param entitySetName エンティティセット名 * @return EntitySetDocHandler */ - protected EntitySetDocHandler getDocHandler(DcSearchHit searchHit, String entitySetName) { + protected EntitySetDocHandler getDocHandler(PersoniumSearchHit searchHit, String entitySetName) { return new OEntityDocHandler(searchHit); } @@ -685,7 +685,7 @@ protected EntitySetDocHandler getDocHanlder(String type, OEntityWrapper oEntity) * @param entitySetName エンティティセット名 * @return EntitySetDocHandler */ - protected EntitySetDocHandler getDocHandler(DcGetResponse response, String entitySetName) { + protected EntitySetDocHandler getDocHandler(PersoniumGetResponse response, String entitySetName) { return new OEntityDocHandler(response); } @@ -762,18 +762,18 @@ public EntitiesResponse execEntitiesRequest(final QueryInfo queryInfo, EdmEntitySet eSet, EntitySetAccessor esType, List> implicitFilters) { - final int expandMaxNum = DcCoreConfig.getMaxExpandSizeForList(); + final int expandMaxNum = PersoniumUnitConfig.getMaxExpandSizeForList(); // 条件検索等。 ODataQueryHandler visitor = getODataQueryHandler(queryInfo, eSet.getType(), implicitFilters); Map source = visitor.getSource(); - DcSearchResponse res = null; + PersoniumSearchResponse res = null; try { res = esType.search(source); } catch (EsClientException ex) { - if (ex.getCause() instanceof DcSearchPhaseExecutionException) { - throw DcCoreException.Server.DATA_STORE_SEARCH_ERROR.reason(ex); + if (ex.getCause() instanceof PersoniumSearchPhaseExecutionException) { + throw PersoniumCoreException.Server.DATA_STORE_SEARCH_ERROR.reason(ex); } } // inlinecountの指定がallpagesの場合のみヒット件数を返却する @@ -787,7 +787,7 @@ public EntitiesResponse execEntitiesRequest(final QueryInfo queryInfo, } List entList = new ArrayList(); if (res != null) { - DcSearchHit[] hits = res.getHits().getHits(); + PersoniumSearchHit[] hits = res.getHits().getHits(); Map> expandEntitiesMap = null; Map ntkpProperties = new HashMap(); @@ -805,7 +805,7 @@ public EntitiesResponse execEntitiesRequest(final QueryInfo queryInfo, setEntityPropertyMap(eSet, hits, ntkpValueMap); } List entityList = new ArrayList(); - for (DcSearchHit hit : hits) { + for (PersoniumSearchHit hit : hits) { EntitySetDocHandler oedh = getDocHandler(hit, eSet.getName()); entityList.add(oedh); } @@ -859,7 +859,7 @@ public EntitiesResponse execEntitiesRequest(final QueryInfo queryInfo, * @param ntkpValueMap NTKPマップ */ @SuppressWarnings("unchecked") - private void setEntityPropertyMap(EdmEntitySet eSet, DcSearchHit[] hits, Map ntkpValueMap) { + private void setEntityPropertyMap(EdmEntitySet eSet, PersoniumSearchHit[] hits, Map ntkpValueMap) { String entityTypeKey; String linkTypeName; if (Property.EDM_TYPE_NAME.equals(eSet.getName())) { @@ -875,7 +875,7 @@ private void setEntityPropertyMap(EdmEntitySet eSet, DcSearchHit[] hits, Map processedPropertyAlias = new ArrayList(); - for (DcSearchHit property : hits) { + for (PersoniumSearchHit property : hits) { Map fields = property.getSource(); Map staticFileds = ((Map) fields.get(OEntityDocHandler.KEY_STATIC_FIELDS)); Map hideenFileds = ((Map) fields.get(OEntityDocHandler.KEY_HIDDEN_FIELDS)); @@ -890,8 +890,8 @@ private void setEntityPropertyMap(EdmEntitySet eSet, DcSearchHit[] hits, Map nestNtkpValueMap = new HashMap(); if (propName.startsWith("_")) { HashMap tmpntkp = AbstractODataResource.convertNTKP(propName); @@ -960,7 +960,7 @@ private void getNtkpValueMap(EdmEntitySet eSet, propName = tmpntkp.get("propName"); ntkpAccessor = this.getAccessorForEntitySet(entityType); nestNtkpSearchResults = ntkpAccessor.search(searchQuery).getHits().getHits(); - for (DcSearchHit nestNtkpSearchResult : nestNtkpSearchResults) { + for (PersoniumSearchHit nestNtkpSearchResult : nestNtkpSearchResults) { String linkId = nestNtkpSearchResult.getId(); String linkNtkpValue = ((Map) nestNtkpSearchResult.getSource().get( OEntityDocHandler.KEY_STATIC_FIELDS)).get(propName).toString(); @@ -969,7 +969,7 @@ private void getNtkpValueMap(EdmEntitySet eSet, } // LinkIDがKey,NTKPの値がValueのMapを作成する - for (DcSearchHit ntkpSearchResult : ntkpSearchResults) { + for (PersoniumSearchHit ntkpSearchResult : ntkpSearchResults) { String linkId = ntkpSearchResult.getId(); Map linkFields = (Map) ntkpSearchResult.getSource().get( OEntityDocHandler.KEY_LINK); @@ -1013,7 +1013,7 @@ public void deleteEntity(String entitySetName, OEntityKey entityKey, String etag // データが存在しないときは404を返す if (hit == null) { - throw DcCoreException.OData.NO_SUCH_ENTITY; + throw PersoniumCoreException.OData.NO_SUCH_ENTITY; } // If-MatchヘッダとEtagの値が等しいかチェック ODataUtils.checkEtag(etag, hit); @@ -1021,7 +1021,7 @@ public void deleteEntity(String entitySetName, OEntityKey entityKey, String etag // Linkデータの有無を確認する for (EdmNavigationProperty np : srcType.getDeclaredNavigationProperties().toList()) { if (this.findMultiPoint(np, entityKey) || this.findLinks(np, entityKey)) { - throw DcCoreException.OData.CONFLICT_HAS_RELATED; + throw PersoniumCoreException.OData.CONFLICT_HAS_RELATED; } } @@ -1033,7 +1033,7 @@ public void deleteEntity(String entitySetName, OEntityKey entityKey, String etag EntitySetAccessor targetEsType = this.getAccessorForEntitySet(key); // 削除するデータと紐ついているデータを取得する - DcGetResponse linksRes = targetEsType.get(entry.getValue().toString()); + PersoniumGetResponse linksRes = targetEsType.get(entry.getValue().toString()); EntitySetDocHandler linksDocHandler = getDocHandler(linksRes, entitySetName); Map links = linksDocHandler.getManyToOnelinkId(); @@ -1048,12 +1048,12 @@ public void deleteEntity(String entitySetName, OEntityKey entityKey, String etag // 削除前処理 this.beforeDelete(entitySetName, entityKey, hit); - DcDeleteResponse res = null; + PersoniumDeleteResponse res = null; // 削除処理 res = esType.delete(hit); if (res == null) { - throw DcCoreException.Server.DATA_STORE_UNKNOWN_ERROR.reason(new RuntimeException("not found")); + throw PersoniumCoreException.Server.DATA_STORE_UNKNOWN_ERROR.reason(new RuntimeException("not found")); } // TransportClient内でリトライ処理が行われた場合、レスポンスとしてNotFoundが返却される。 // このため、ここではそのチェックは行わず、NotFoundが返却されても正常終了とする。 @@ -1139,7 +1139,7 @@ private EntityResponse createEntity(final String entitySetName, try { setLinksFromOEntity(entity, oedh); } catch (NTKPNotFoundException e) { - throw DcCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.params(e.getMessage()); + throw PersoniumCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.params(e.getMessage()); } } @@ -1147,7 +1147,7 @@ private EntityResponse createEntity(final String entitySetName, this.beforeCreate(entitySetName, entity, oedh); // データが存在しなければ、esJsonをESに保存する - DcIndexResponse idxRs = null; + PersoniumIndexResponse idxRs = null; idxRs = esType.create(oedh.getId(), oedh); // 登録後処理 @@ -1231,7 +1231,7 @@ public final EntityResponse createEntity(final String entitySetName, EntitySetDocHandler srcDh = this.retrieveWithKey(eSet, entityKey); if (srcDh == null) { // src側のりソースが存在しなかったら404 エラーとする - throw DcCoreException.OData.NO_SUCH_ENTITY; + throw PersoniumCoreException.OData.NO_SUCH_ENTITY; } // 関連のタイプ (NN/1N/N1/11) を判定 @@ -1259,7 +1259,7 @@ public final void createLink(OEntityId sourceEntity, String targetNavProp, OEnti EdmNavigationProperty srcNavProp = getEdmNavigationProperty(srcSetName, targetNavProp); if (srcNavProp == null) { - throw DcCoreException.OData.NO_SUCH_ASSOCIATION; + throw PersoniumCoreException.OData.NO_SUCH_ASSOCIATION; } // n:1かn:nの切り分けを行う EdmAssociation assoc = srcNavProp.getRelationship(); @@ -1270,12 +1270,12 @@ public final void createLink(OEntityId sourceEntity, String targetNavProp, OEnti EntitySetDocHandler src = this.retrieveWithKey(sourceEntity); // データが存在しない場合は404 if (src == null) { - throw DcCoreException.OData.NOT_FOUND; + throw PersoniumCoreException.OData.NOT_FOUND; } EntitySetDocHandler tgt = this.retrieveWithKey(targetEntity); // ターゲットが存在しない場合は400 if (tgt == null) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("uri"); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("uri"); } createLinks(sourceEntity, srcNavProp, assoc, src, tgt); } finally { @@ -1297,13 +1297,13 @@ private void validateLinkForNavigationPropertyContext(NavigationPropertyBulkCont EdmNavigationProperty srcNavProp = getEdmNavigationProperty(srcSetName, targetNavProp); if (srcNavProp == null) { - throw DcCoreException.OData.NO_SUCH_ASSOCIATION; + throw PersoniumCoreException.OData.NO_SUCH_ASSOCIATION; } EntitySetDocHandler src = navigationPropertyContext.getSourceDocHandler(); // データが存在しない場合は404 if (src == null) { - throw DcCoreException.OData.NOT_FOUND; + throw PersoniumCoreException.OData.NOT_FOUND; } // 1:1の関連は存在し得ないので、AssociationEnd - AssociationEndの$linksで1:1の登録をしようとした場合はエラーとする @@ -1427,7 +1427,7 @@ public final EntityResponse createNp(OEntityId sourceOEntity, EdmEntityType srcType = srcSet.getType(); EdmNavigationProperty srcNavProp = srcType.findNavigationProperty(targetNavProp); if (srcNavProp == null) { - throw DcCoreException.OData.NO_SUCH_ASSOCIATION; + throw PersoniumCoreException.OData.NO_SUCH_ASSOCIATION; } EntityResponse res; @@ -1440,11 +1440,11 @@ public final EntityResponse createNp(OEntityId sourceOEntity, // sourceデータが存在しない場合は404 EntitySetDocHandler sourceDocHandler = this.retrieveWithKey(sourceOEntity); if (sourceDocHandler == null) { - throw DcCoreException.OData.NOT_FOUND; + throw PersoniumCoreException.OData.NOT_FOUND; } EntitySetDocHandler targetEntity = this.retrieveWithKey(entity); if (targetEntity != null) { - throw DcCoreException.OData.CONFLICT_LINKS; + throw PersoniumCoreException.OData.CONFLICT_LINKS; } // 1:1の関連は存在し得ないので、AssociationEnd - AssociationEndの$linksで1:1の登録をしようとした場合はエラーとする @@ -1465,7 +1465,7 @@ public final EntityResponse createNp(OEntityId sourceOEntity, } EntitySetDocHandler retrievedEntity = this.retrieveWithKey(entity); if (retrievedEntity == null) { - throw DcCoreException.Server.UNKNOWN_ERROR; + throw PersoniumCoreException.Server.UNKNOWN_ERROR; } // $linksの登録 @@ -1505,8 +1505,8 @@ private void checkUpperLimitRecord( targetEntityTypeId); log.info("Registered links count: [" + count + "]"); - if (count >= (long) DcCoreConfig.getLinksNtoNMaxSize()) { - throw DcCoreException.OData.LINK_UPPER_LIMIT_RECORD_EXEED; + if (count >= (long) PersoniumUnitConfig.getLinksNtoNMaxSize()) { + throw PersoniumCoreException.OData.LINK_UPPER_LIMIT_RECORD_EXEED; } } @@ -1579,7 +1579,7 @@ private void checkAssociationEndMultiplicity(String targetNavProp, String tgtMulti = entity.getProperty(AssociationEnd.P_MULTIPLICITY.getName()).getValue().toString(); if (EdmMultiplicity.ONE.getSymbolString().equals(srcMulti) && EdmMultiplicity.ONE.getSymbolString().equals(tgtMulti)) { - throw DcCoreException.OData.INVALID_MULTIPLICITY; + throw PersoniumCoreException.OData.INVALID_MULTIPLICITY; } } } @@ -1691,12 +1691,12 @@ protected void createLinks(OEntityId sourceEntity, OEntityId targetEntity) { EntitySetDocHandler src = this.retrieveWithKey(sourceEntity); // データが存在しない場合は404 if (src == null) { - throw DcCoreException.OData.NOT_FOUND; + throw PersoniumCoreException.OData.NOT_FOUND; } EntitySetDocHandler tgt = this.retrieveWithKey(targetEntity); // ターゲットが存在しない場合は400 if (tgt == null) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("uri"); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("uri"); } // NNLink情報の ES保存時の一意キー作成 LinkDocHandler docHandler = this.getLinkDocHandler(src, tgt); @@ -1731,7 +1731,7 @@ private long createLinks(OEntityId sourceOEntity, if (EdmMultiplicity.ONE.getSymbolString().equals(srcMultiplicity) && EdmMultiplicity.ONE.getSymbolString().equals(tgtMultiplicity)) { - throw DcCoreException.OData.INVALID_MULTIPLICITY; + throw PersoniumCoreException.OData.INVALID_MULTIPLICITY; } checkInvalidLinks(sourceEntity, targetEntity); @@ -1812,9 +1812,9 @@ private void checkExistsLinkForOnetoOne(final EntitySetDocHandler source, String fromLinksKey = getLinkskey(srcNavProp.getFromRole().getType().getName()); Map sourceLinks = source.getManyToOnelinkId(); if (sourceLinks.get(toLinksKey) != null) { - throw DcCoreException.OData.CONFLICT_LINKS; + throw PersoniumCoreException.OData.CONFLICT_LINKS; } else if (target != null && target.getManyToOnelinkId().get(fromLinksKey) != null) { - throw DcCoreException.OData.CONFLICT_LINKS; + throw PersoniumCoreException.OData.CONFLICT_LINKS; } } @@ -1867,10 +1867,10 @@ private long updateLink(EntitySetDocHandler docHandler, String entSetName) { private void checkExistsLinkForNtoN(ODataLinkAccessor esType, LinkDocHandler docHandler) { String docid = docHandler.createLinkId(); // Link の存在確認 - DcGetResponse gRes = esType.get(docid); + PersoniumGetResponse gRes = esType.get(docid); if (gRes != null && gRes.exists()) { // 既に該当LINKが存在する - throw DcCoreException.OData.CONFLICT_LINKS; + throw PersoniumCoreException.OData.CONFLICT_LINKS; } } @@ -1889,7 +1889,7 @@ private void checkExistsLinksForNtoOne( if (sourceEntity != null) { Map links = sourceEntity.getManyToOnelinkId(); if (links != null && links.get(linksKey) != null) { - throw DcCoreException.OData.CONFLICT_LINKS; + throw PersoniumCoreException.OData.CONFLICT_LINKS; } } } @@ -1905,7 +1905,7 @@ private void checkExistsLinksForOneToN(OEntityId sourceOEntity, if (targetEntity != null) { Map links = targetEntity.getManyToOnelinkId(); if (links != null && links.get(linksKey) != null) { - throw DcCoreException.OData.CONFLICT_LINKS; + throw PersoniumCoreException.OData.CONFLICT_LINKS; } } @@ -1922,7 +1922,7 @@ private void checkExistsLinksForOneToN(OEntityId sourceOEntity, param = sourceOEntity.getEntitySetName() + "('" + targetEntity.getStaticFields().get("Name") + "', '" + sourceEntity.getStaticFields().get("Name") + "')"; } - throw DcCoreException.OData.CONFLICT_DUPLICATED_ENTITY.params(param); + throw PersoniumCoreException.OData.CONFLICT_DUPLICATED_ENTITY.params(param); } } @@ -1987,7 +1987,7 @@ public final void deleteLink(final OEntityId sourceEntityId, EdmNavigationProperty navProp = srcType.findNavigationProperty(targetNavProp); if (navProp == null) { // TODO 本来はリクエストされたリソースが存在しないことになるため404エラーを返却すべき - throw DcCoreException.OData.NO_SUCH_ASSOCIATION; + throw PersoniumCoreException.OData.NO_SUCH_ASSOCIATION; } EdmEntitySet tgtSet = this.getMetadata().findEdmEntitySet(navProp.getToRole().getType().getName()); @@ -2010,7 +2010,7 @@ public final void deleteLink(final OEntityId sourceEntityId, EntitySetDocHandler target = this.retrieveWithKey(tgtSet, targetEntityKey); // 該当データが存在しない場合は404 if (source == null || target == null) { - throw DcCoreException.OData.NOT_FOUND; + throw PersoniumCoreException.OData.NOT_FOUND; } // 取得したデータ同士の関連付けをチェックし、関連付いていないリンクを削除しようとした場合は400を返却する @@ -2048,7 +2048,7 @@ private void isExistsLinks(EntitySetDocHandler source, EntitySetDocHandler targe Map links = source.getManyToOnelinkId(); String linksKey = getLinkskey(entitySet.getName()); if (!links.containsKey(linksKey) || !target.getId().equals(links.get(linksKey))) { - throw DcCoreException.OData.NOT_FOUND; + throw PersoniumCoreException.OData.NOT_FOUND; } } @@ -2065,13 +2065,13 @@ private void deleteLinks(OEntityId sourceEntityId, OEntityKey targetEntityKey, E // 該当データが存在しない場合は404 if (src == null || tgt == null) { - throw DcCoreException.OData.NOT_FOUND; + throw PersoniumCoreException.OData.NOT_FOUND; } // リンクエンティティを削除する if (!deleteLinkEntity(src, tgt)) { // 該当LINKが存在しない場合はエラーにする - throw DcCoreException.OData.NOT_FOUND; + throw PersoniumCoreException.OData.NOT_FOUND; } } @@ -2088,7 +2088,7 @@ protected boolean deleteLinkEntity(EntitySetDocHandler source, EntitySetDocHandl String docid = elh.createLinkId(); // Link の存在確認 - DcGetResponse gRes = esType.get(docid); + PersoniumGetResponse gRes = esType.get(docid); if (gRes != null && gRes.exists()) { esType.delete(elh); return true; @@ -2137,13 +2137,13 @@ private void deleteLinks(OEntityId sourceEntityId, // 該当データが存在しない場合は404 if (src == null || tgt == null) { - throw DcCoreException.OData.NOT_FOUND; + throw PersoniumCoreException.OData.NOT_FOUND; } // 削除対象のlinksが存在しない場合は404とする Map links = tgt.getManyToOnelinkId(); if (!src.getId().equals(links.get(linksKey))) { - throw DcCoreException.OData.NOT_FOUND; + throw PersoniumCoreException.OData.NOT_FOUND; } // 登録用のlinksオブジェクトを生成して、登録対象のオブジェクトに設定する @@ -2161,7 +2161,7 @@ private void deleteLinks(OEntityId sourceEntityId, boolean uniqueness = checkUniquenessEntityKey(sourceEntitySetName, tgt, linksKey, esType); if (!uniqueness) { String param = sourceEntitySetName + "('" + tgt.getStaticFields().get("Name") + "')"; - throw DcCoreException.OData.CONFLICT_UNLINKED_ENTITY.params(param); + throw PersoniumCoreException.OData.CONFLICT_UNLINKED_ENTITY.params(param); } esType.update(tgt.getId(), tgt); @@ -2260,7 +2260,7 @@ protected boolean checkUniquenessEntityKeyForAddLink(final String entitySetName, } /** N:1の最大リンク取得件数. */ - private static final int DEFAULT_TOP_VALUE = DcCoreConfig.getTopQueryDefaultSize(); + private static final int DEFAULT_TOP_VALUE = PersoniumUnitConfig.getTopQueryDefaultSize(); /** * Returns the value of an entity's navigation property as a collection of entity links (or a single link if the @@ -2288,7 +2288,7 @@ public final EntityIdResponse getLinks(OEntityId sourceEntity, String targetNavP EntitySetDocHandler src = this.retrieveWithKey(sourceEntity); if (src == null) { - throw DcCoreException.OData.NO_SUCH_ENTITY; + throw PersoniumCoreException.OData.NO_SUCH_ENTITY; } // srcTypeからtgtTypeへN:N Assocが定義されているか調べる @@ -2297,7 +2297,7 @@ public final EntityIdResponse getLinks(OEntityId sourceEntity, String targetNavP EdmNavigationProperty navProp = srcType.findNavigationProperty(targetNavProp); if (navProp == null) { - throw DcCoreException.OData.NO_SUCH_ASSOCIATION; + throw PersoniumCoreException.OData.NO_SUCH_ASSOCIATION; } // n:1かn:nの切り分けを行う @@ -2317,12 +2317,12 @@ public final EntityIdResponse getLinks(OEntityId sourceEntity, String targetNavP && assoc.getEnd2().getMultiplicity() == EdmMultiplicity.MANY) { // N:Nのlinkの登録数の上限値1万に合わせて、最大1万件を取得する EntitySetAccessor tgtEsType = this.getAccessorForEntitySet(targetSetName); - QueryInfo qi = QueryInfo.newBuilder().setTop(DcCoreConfig.getTopQueryMaxSize()) + QueryInfo qi = QueryInfo.newBuilder().setTop(PersoniumUnitConfig.getTopQueryMaxSize()) .setInlineCount(InlineCount.NONE).build(); List idvals = LinkDocHandler.query(this.getAccessorForLink(), src, tgtEsType.getType(), targetEntityTypeId, qi); - DcSearchHits sHits = ODataProducerUtils.searchLinksNN(src, targetSetName, idvals, tgtEsType, queryInfo); + PersoniumSearchHits sHits = ODataProducerUtils.searchLinksNN(src, targetSetName, idvals, tgtEsType, queryInfo); oeids = getOEntityIds(sHits, targetSetName, tgtSet); } else if ((assoc.getEnd1().getMultiplicity() == EdmMultiplicity.ZERO_TO_ONE @@ -2369,7 +2369,7 @@ public final EntityIdResponse getLinks(OEntityId sourceEntity, String targetNavP // 検索の実行 EntitySetAccessor esType = this.getAccessorForEntitySet(targetSetName); - DcSearchHits sHits = esType.search(filter).hits(); + PersoniumSearchHits sHits = esType.search(filter).hits(); oeids = getOEntityIds(sHits, targetSetName, tgtSet); } else { // SOURCEがNの場合 @@ -2387,13 +2387,13 @@ public final EntityIdResponse getLinks(OEntityId sourceEntity, String targetNavP * @param tgtSet リクエストURLにて指定されたNavPropのEdmEntitySet * @return OEntityIdの一覧 */ - private List getOEntityIds(DcSearchHits sHits, String targetSetName, EdmEntitySet tgtSet) { + private List getOEntityIds(PersoniumSearchHits sHits, String targetSetName, EdmEntitySet tgtSet) { // 検索結果からOEntityIdのListを生成する List oeids = new ArrayList(); if (sHits == null) { return oeids; } - for (DcSearchHit hit : sHits.getHits()) { + for (PersoniumSearchHit hit : sHits.getHits()) { EntitySetDocHandler oedh = getDocHandler(hit, targetSetName); OEntityId id = getOEntityId(targetSetName, tgtSet, oedh); oeids.add(id); @@ -2415,7 +2415,7 @@ private List getOEntityIds(EntitySetDocHandler src, String targetSetN String linksId = (String) src.getManyToOnelinkId().get(getLinkskey(targetSetName)); if (linksId != null) { - DcGetResponse response = esType.get(linksId); + PersoniumGetResponse response = esType.get(linksId); EntitySetDocHandler docHandler = getDocHandler(response, targetSetName); OEntityId id = getOEntityId(targetSetName, tgtSet, docHandler); oeids.add(id); @@ -2466,7 +2466,7 @@ public BaseResponse getNavProperty(final String entitySetName, // EntitySetの取得を行う EntitySetDocHandler source = this.retrieveWithKey(sourceSet, entityKey); if (source == null) { - throw DcCoreException.OData.NO_SUCH_ENTITY; + throw PersoniumCoreException.OData.NO_SUCH_ENTITY; } // ユーザデータの$links取得の場合、targetのEntityTypeの_idを取得する @@ -2484,7 +2484,7 @@ public BaseResponse getNavProperty(final String entitySetName, // N:Nの場合はType[Link]を検索して、NavigationPropertyのID一覧を取得する Map idsQuery = new HashMap(); // N:Nのlinkの登録数の上限値1万に合わせて、最大1万件を取得する - QueryInfo qi = QueryInfo.newBuilder().setTop(DcCoreConfig.getTopQueryMaxSize()) + QueryInfo qi = QueryInfo.newBuilder().setTop(PersoniumUnitConfig.getTopQueryMaxSize()) .setInlineCount(InlineCount.NONE).build(); List value = LinkDocHandler.query(this.getAccessorForLink(), @@ -2617,7 +2617,7 @@ private void updateAndMergeEntity(final String entitySetName, // まずは存在確認をする。存在しないときはNullが返ってくる。 EntitySetDocHandler oedhExisting = this.retrieveWithKey(oEntityWrapper.getEntitySet(), originalKey); if (oedhExisting == null) { - throw DcCoreException.OData.NO_SUCH_ENTITY; + throw PersoniumCoreException.OData.NO_SUCH_ENTITY; } // If-MatchヘッダとEtagの値が等しいかチェック @@ -2651,7 +2651,7 @@ private void updateAndMergeEntity(final String entitySetName, try { setLinksFromOEntity(oEntityWrapper, oedhNew); } catch (NTKPNotFoundException e) { - throw DcCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.params(e.getMessage()); + throw PersoniumCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.params(e.getMessage()); } } @@ -2703,7 +2703,7 @@ private void updateAndMergeEntity(final String entitySetName, } // esJsonをESに保存する - DcIndexResponse idxRes = null; + PersoniumIndexResponse idxRes = null; // リクエストのEtag指定から検査用versionを取り出す(Etag指定が無い場合はNull) Long version = oedhNew.getVersion(); if (version == null || version < 0) { @@ -2733,7 +2733,7 @@ public void updatePassword(final EdmEntitySet entitySet, // ESから変更するAccount情報を取得する EntitySetDocHandler oedhNew = this.retrieveWithKey(entitySet, originalKey); if (oedhNew == null) { - throw DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + throw PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; } // 取得したAccountのパスワードと更新日を上書きする ODataProducerUtils.createRequestPassword(oedhNew, dcCredHeader); @@ -2763,13 +2763,13 @@ public void updateLastAuthenticated(final EdmEntitySet entitySet, final OEntityK // ESから変更するAccount情報を取得する EntitySetAccessor esType = this.getAccessorForEntitySet(entitySet.getName()); - DcGetResponse dcGetResponseNew = esType.get(accountId); - if (dcGetResponseNew == null) { + PersoniumGetResponse PersoniumGetResponseNew = esType.get(accountId); + if (PersoniumGetResponseNew == null) { // 認証から最終ログイン時刻更新までにAccountが削除された場合は、更新対象が存在しないため、正常終了する。 - DcCoreLog.Auth.ACCOUNT_ALREADY_DELETED.params(originalKey.toKeyString()).writeLog(); + PersoniumCoreLog.Auth.ACCOUNT_ALREADY_DELETED.params(originalKey.toKeyString()).writeLog(); return; } - EntitySetDocHandler oedhNew = new OEntityDocHandler(dcGetResponseNew); + EntitySetDocHandler oedhNew = new OEntityDocHandler(PersoniumGetResponseNew); // 取得したAccountの最終ログイン日時を上書きする Map staticFields = oedhNew.getStaticFields(); staticFields.put("LastAuthenticated", nowTimeMillis); @@ -2822,8 +2822,8 @@ public CountResponse getEntitiesCount(final String entitySetName, final QueryInf try { tmpCount = esType.count(source); } catch (EsClientException ex) { - if (ex.getCause() instanceof DcSearchPhaseExecutionException) { - throw DcCoreException.Server.DATA_STORE_SEARCH_ERROR.reason(ex); + if (ex.getCause() instanceof PersoniumSearchPhaseExecutionException) { + throw PersoniumCoreException.Server.DATA_STORE_SEARCH_ERROR.reason(ex); } } } @@ -2857,7 +2857,7 @@ public CountResponse getNavPropertyCount(final String toEntitySetName, EntitySetAccessor esType = this.getAccessorForEntitySet(fromEntitySetName); tmpCount = esType.count(source); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { tmpCount = 0; } final long count = tmpCount; @@ -2900,8 +2900,8 @@ public void bulkCreateEntityViaNavigationProperty( // データチェックをする validateLinkForNavigationPropertyContext(npBulkContext); if (isConflictLinks(npBulkContexts, npBulkContext)) { - npBulkRequest.setError(DcCoreException.OData.CONFLICT_LINKS); - npBulkContext.setException(DcCoreException.OData.CONFLICT_LINKS); + npBulkRequest.setError(PersoniumCoreException.OData.CONFLICT_LINKS); + npBulkContext.setException(PersoniumCoreException.OData.CONFLICT_LINKS); } } catch (Exception e) { npBulkRequest.setError(e); @@ -2988,9 +2988,9 @@ private boolean setLinkSourcesToBulkContexts(List return false; } DataSourceAccessor accessor = getAccessorForBatch(); - DcSearchResponse searchResponse = accessor.searchForIndex(getCellId(), searchQuery); + PersoniumSearchResponse searchResponse = accessor.searchForIndex(getCellId(), searchQuery); if (searchResponse.getHits().getCount() != 0) { - for (DcSearchHit hit : searchResponse.getHits().getHits()) { + for (PersoniumSearchHit hit : searchResponse.getHits().getHits()) { // TODO 複合主キー対応 HashMap staticFields = (HashMap) hit.getSource() .get(OEntityDocHandler.KEY_STATIC_FIELDS); @@ -3058,15 +3058,15 @@ private List bulkCreateEntityWithoutLock(EdmDataServices metadat if (searchQuery == null) { return response; } - DcSearchResponse searchResponse = accessor.searchForIndex(cellId, searchQuery); + PersoniumSearchResponse searchResponse = accessor.searchForIndex(cellId, searchQuery); if (searchResponse.getHits().getCount() != 0) { - for (DcSearchHit hit : searchResponse.getHits().getHits()) { + for (PersoniumSearchHit hit : searchResponse.getHits().getHits()) { // TODO 複合主キー対応 HashMap staticFields = (HashMap) hit.getSource() .get(OEntityDocHandler.KEY_STATIC_FIELDS); String entityTypeId = (String) hit.getSource().get(OEntityDocHandler.KEY_ENTITY_ID); String key = entityTypeId + ":" + (String) staticFields.get("__id"); - bulkRequests.get(key).setError(DcCoreException.OData.ENTITY_ALREADY_EXISTS); + bulkRequests.get(key).setError(PersoniumCoreException.OData.ENTITY_ALREADY_EXISTS); } } @@ -3089,9 +3089,9 @@ private List bulkCreateEntityWithoutLock(EdmDataServices metadat } // 一括登録を実行する try { - DcBulkResponse bulkResponse = accessor.bulkCreate(esBulkRequest, adsBulkRequest, cellId); + PersoniumBulkResponse bulkResponse = accessor.bulkCreate(esBulkRequest, adsBulkRequest, cellId); // EntitiesResponse組み立て - for (DcBulkItemResponse itemResponse : bulkResponse.items()) { + for (PersoniumBulkItemResponse itemResponse : bulkResponse.items()) { String key = keyMap.get(itemResponse.getId()); if (itemResponse.isFailed()) { // バルク内でエラーが発生していた場合はエラーをセットする @@ -3106,9 +3106,9 @@ private List bulkCreateEntityWithoutLock(EdmDataServices metadat response.add(Responses.entity(oEntity)); } } - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { // バルクリクエストが失敗した場合は、バルクで登録に使用したデータすべてにエラーを設定する - DcCoreLog.OData.BULK_INSERT_FAIL.reason(e).writeLog(); + PersoniumCoreLog.OData.BULK_INSERT_FAIL.reason(e).writeLog(); for (EsBulkRequest request : esBulkRequest) { HashMap staticFields = (HashMap) request.getSource() .get(OEntityDocHandler.KEY_STATIC_FIELDS); @@ -3117,7 +3117,7 @@ private List bulkCreateEntityWithoutLock(EdmDataServices metadat } } catch (EsClientException e) { // バルクリクエストが失敗した場合は、バルクで登録に使用したデータすべてにエラーを設定する - DcCoreLog.OData.BULK_INSERT_FAIL.reason(e).writeLog(); + PersoniumCoreLog.OData.BULK_INSERT_FAIL.reason(e).writeLog(); for (EsBulkRequest request : esBulkRequest) { HashMap staticFields = (HashMap) request.getSource() .get(OEntityDocHandler.KEY_STATIC_FIELDS); @@ -3337,9 +3337,9 @@ private void bulkCreateLinks( DataSourceAccessor accessor = getAccessorForBatch(); try { int responseIndex = 0; - DcBulkResponse bulkResponse = accessor.bulkUpdateLink(esBulkRequest, adsBulkEntityRequest, + PersoniumBulkResponse bulkResponse = accessor.bulkUpdateLink(esBulkRequest, adsBulkEntityRequest, adsBulkLinkRequest, cellId); - DcBulkItemResponse[] responseItems = bulkResponse.items(); + PersoniumBulkItemResponse[] responseItems = bulkResponse.items(); for (NavigationPropertyBulkContext context : bulkContexts) { if (context.isError()) { continue; @@ -3348,8 +3348,8 @@ private void bulkCreateLinks( NavigationPropertyLinkType linkType = context.getLinkType(); switch (linkType) { case oneToOne: - DcBulkItemResponse itemResponseFrom = responseItems[responseIndex++]; - DcBulkItemResponse itemResponseTo = responseItems[responseIndex++]; + PersoniumBulkItemResponse itemResponseFrom = responseItems[responseIndex++]; + PersoniumBulkItemResponse itemResponseTo = responseItems[responseIndex++]; if (itemResponseFrom.isFailed() || itemResponseTo.isFailed()) { context.setException(new ServerErrorException("failed to store to es")); } else { @@ -3357,14 +3357,14 @@ private void bulkCreateLinks( } break; case manyToOne: - DcBulkItemResponse manyToOneResponse = responseItems[responseIndex++]; + PersoniumBulkItemResponse manyToOneResponse = responseItems[responseIndex++]; if (manyToOneResponse.isFailed()) { context.setException(new ServerErrorException("failed to store to es")); } break; case oneToMany: case manyToMany: - DcBulkItemResponse itemResponse = responseItems[responseIndex++]; + PersoniumBulkItemResponse itemResponse = responseItems[responseIndex++]; if (itemResponse.isFailed()) { context.setException(new ServerErrorException("failed to store to es")); } else { diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/EsQueryHandler.java b/src/main/java/io/personium/core/model/impl/es/odata/EsQueryHandler.java similarity index 88% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/odata/EsQueryHandler.java rename to src/main/java/io/personium/core/model/impl/es/odata/EsQueryHandler.java index 86c86669e..849301174 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/EsQueryHandler.java +++ b/src/main/java/io/personium/core/model/impl/es/odata/EsQueryHandler.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.odata; +package io.personium.core.model.impl.es.odata; import java.util.ArrayList; import java.util.HashMap; @@ -90,11 +90,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.model.impl.es.QueryMapFactory; -import com.fujitsu.dc.core.model.impl.es.doc.OEntityDocHandler; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.Common; +import io.personium.core.model.impl.es.QueryMapFactory; +import io.personium.core.model.impl.es.doc.OEntityDocHandler; /** * ODataの$filterをはじめとするクエリをESのJSONベースQueryDSLに変換する. @@ -106,7 +106,7 @@ * Personium.ioでサポートしていないクエリに関しては、例外をスローする。 */ public class EsQueryHandler implements ExpressionVisitor, ODataQueryHandler { - private static final int DEFAULT_TOP_VALUE = DcCoreConfig.getTopQueryDefaultSize(); + private static final int DEFAULT_TOP_VALUE = PersoniumUnitConfig.getTopQueryDefaultSize(); EdmEntityType entityType; Map source; Map current; @@ -276,7 +276,7 @@ public void getSelectQuery(Map baseSource, for (EntitySimpleProperty select : selects) { if (select == null) { // $selectで指定された値がプロパティ名でなかった場合 - throw DcCoreException.OData.SELECT_PARSE_ERROR; + throw PersoniumCoreException.OData.SELECT_PARSE_ERROR; } String prop = select.getPropertyName(); if (!Common.P_ID.getName().equals(prop) @@ -343,7 +343,7 @@ public void visit(String type) { public void visit(OrderByExpression expr) { log.debug("visit(OrderByExpression expr)"); if (!(expr.getExpression() instanceof EntitySimpleProperty)) { - throw DcCoreException.OData.FILTER_PARSE_ERROR; + throw PersoniumCoreException.OData.FILTER_PARSE_ERROR; } // ソートクエリを設定する @@ -378,7 +378,7 @@ public void visit(Direction direction) { @Override public void visit(AddExpression expr) { - throw DcCoreException.OData.UNSUPPORTED_QUERY_OPERATOR; + throw PersoniumCoreException.OData.UNSUPPORTED_QUERY_OPERATOR; } @Override @@ -417,7 +417,7 @@ public void visit(EqExpression expr) { // $filterに指定された検索条件のプロパティが単純型ではない場合は、パースエラーとする。 if (!(expr.getLHS() instanceof EntitySimpleProperty)) { - throw DcCoreException.OData.FILTER_PARSE_ERROR; + throw PersoniumCoreException.OData.FILTER_PARSE_ERROR; } EdmProperty edmProperty = getEdmProprety((EntitySimpleProperty) expr.getLHS()); @@ -457,7 +457,7 @@ private EdmProperty getEdmProprety(EntitySimpleProperty searchKey) { String propertyName = searchKey.getPropertyName(); EdmProperty edmProperty = this.entityType.findProperty(propertyName); if (null == edmProperty) { - throw DcCoreException.OData.UNKNOWN_QUERY_KEY.params(propertyName); + throw PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.params(propertyName); } return edmProperty; } @@ -482,7 +482,7 @@ private Object getSearchValue(CommonExpression expr) { value = StringEscapeUtils.unescapeJavaScript(((StringLiteral) expr).getValue()); } catch (Exception e) { log.info("Failed to unescape searchValue.", e); - throw DcCoreException.OData.OPERATOR_AND_OPERAND_UNABLE_TO_UNESCAPE.params(((StringLiteral) expr) + throw PersoniumCoreException.OData.OPERATOR_AND_OPERAND_UNABLE_TO_UNESCAPE.params(((StringLiteral) expr) .getValue()); } return value; @@ -536,7 +536,7 @@ public void visit(CastExpression expr) { @Override public void visit(ConcatMethodCallExpression expr) { - throw DcCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; + throw PersoniumCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; } @Override @@ -553,12 +553,12 @@ public void visit(DecimalLiteral expr) { @Override public void visit(DivExpression expr) { - throw DcCoreException.OData.UNSUPPORTED_QUERY_OPERATOR; + throw PersoniumCoreException.OData.UNSUPPORTED_QUERY_OPERATOR; } @Override public void visit(EndsWithMethodCallExpression expr) { - throw DcCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; + throw PersoniumCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; } /** @@ -575,7 +575,7 @@ public void visit(GeExpression expr) { // $filterに指定された検索条件のプロパティが単純型ではない場合は、パースエラーとする。 if (!(expr.getLHS() instanceof EntitySimpleProperty)) { - throw DcCoreException.OData.FILTER_PARSE_ERROR; + throw PersoniumCoreException.OData.FILTER_PARSE_ERROR; } EdmProperty edmProperty = getEdmProprety((EntitySimpleProperty) expr.getLHS()); @@ -598,7 +598,7 @@ public void visit(GtExpression expr) { // $filterに指定された検索条件のプロパティが単純型ではない場合は、パースエラーとする。 if (!(expr.getLHS() instanceof EntitySimpleProperty)) { - throw DcCoreException.OData.FILTER_PARSE_ERROR; + throw PersoniumCoreException.OData.FILTER_PARSE_ERROR; } EdmProperty edmProperty = getEdmProprety((EntitySimpleProperty) expr.getLHS()); @@ -632,7 +632,7 @@ public void visit(SByteLiteral expr) { @Override public void visit(IndexOfMethodCallExpression expr) { - throw DcCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; + throw PersoniumCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; } @Override @@ -654,7 +654,7 @@ public void visit(Int64Literal expr) { @Override public void visit(IsofExpression expr) { - throw DcCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; + throw PersoniumCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; } @Override @@ -663,7 +663,7 @@ public void visit(LeExpression expr) { // $filterに指定された検索条件のプロパティが単純型ではない場合は、パースエラーとする。 if (!(expr.getLHS() instanceof EntitySimpleProperty)) { - throw DcCoreException.OData.FILTER_PARSE_ERROR; + throw PersoniumCoreException.OData.FILTER_PARSE_ERROR; } EdmProperty edmProperty = getEdmProprety((EntitySimpleProperty) expr.getLHS()); @@ -682,7 +682,7 @@ public void visit(LeExpression expr) { @Override public void visit(LengthMethodCallExpression expr) { - throw DcCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; + throw PersoniumCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; } @Override @@ -691,7 +691,7 @@ public void visit(LtExpression expr) { // $filterに指定された検索条件のプロパティが単純型ではない場合は、パースエラーとする。 if (!(expr.getLHS() instanceof EntitySimpleProperty)) { - throw DcCoreException.OData.FILTER_PARSE_ERROR; + throw PersoniumCoreException.OData.FILTER_PARSE_ERROR; } EdmProperty edmProperty = getEdmProprety((EntitySimpleProperty) expr.getLHS()); @@ -710,19 +710,19 @@ public void visit(LtExpression expr) { @Override public void visit(ModExpression expr) { - throw DcCoreException.OData.UNSUPPORTED_QUERY_OPERATOR; + throw PersoniumCoreException.OData.UNSUPPORTED_QUERY_OPERATOR; } @Override public void visit(MulExpression expr) { - throw DcCoreException.OData.UNSUPPORTED_QUERY_OPERATOR; + throw PersoniumCoreException.OData.UNSUPPORTED_QUERY_OPERATOR; } @Override public void visit(NeExpression expr) { // $filterに指定された検索条件のプロパティが単純型ではない場合は、パースエラーとする。 if (!(expr.getLHS() instanceof EntitySimpleProperty)) { - throw DcCoreException.OData.FILTER_PARSE_ERROR; + throw PersoniumCoreException.OData.FILTER_PARSE_ERROR; } EdmProperty edmProperty = getEdmProprety((EntitySimpleProperty) expr.getLHS()); @@ -761,7 +761,7 @@ public void visit(NegateExpression expr) { @Override public void visit(NotExpression expr) { - throw DcCoreException.OData.UNSUPPORTED_QUERY_OPERATOR; + throw PersoniumCoreException.OData.UNSUPPORTED_QUERY_OPERATOR; } @Override @@ -779,7 +779,7 @@ public void visit(BoolParenExpression expr) { @Override public void visit(ReplaceMethodCallExpression expr) { - throw DcCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; + throw PersoniumCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; } @Override @@ -788,7 +788,7 @@ public void visit(StartsWithMethodCallExpression expr) { // 左辺辺がプロパティ、右辺が文字列でない場合はパースエラーとする if (!(expr.getTarget() instanceof EntitySimpleProperty)) { - throw DcCoreException.OData.FILTER_PARSE_ERROR; + throw PersoniumCoreException.OData.FILTER_PARSE_ERROR; } EdmProperty edmProperty = getEdmProprety((EntitySimpleProperty) expr.getTarget()); // $filterに指定されたプロパティの型と検索条件の値として指定されたデータ型の検証 @@ -813,12 +813,12 @@ public void visit(StringLiteral expr) { @Override public void visit(SubExpression expr) { - throw DcCoreException.OData.UNSUPPORTED_QUERY_OPERATOR; + throw PersoniumCoreException.OData.UNSUPPORTED_QUERY_OPERATOR; } @Override public void visit(SubstringMethodCallExpression expr) { - throw DcCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; + throw PersoniumCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; } @Override @@ -827,7 +827,7 @@ public void visit(SubstringOfMethodCallExpression expr) { // 左辺が文字列、右辺がプロパティでない場合はパースエラーとする if (!(expr.getTarget() instanceof EntitySimpleProperty)) { - throw DcCoreException.OData.FILTER_PARSE_ERROR; + throw PersoniumCoreException.OData.FILTER_PARSE_ERROR; } EdmProperty edmProperty = getEdmProprety((EntitySimpleProperty) expr.getTarget()); // $filterに指定されたプロパティの型と検索条件の値として指定されたデータ型の検証 @@ -853,62 +853,62 @@ public void visit(TimeLiteral expr) { @Override public void visit(ToLowerMethodCallExpression expr) { - throw DcCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; + throw PersoniumCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; } @Override public void visit(ToUpperMethodCallExpression expr) { - throw DcCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; + throw PersoniumCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; } @Override public void visit(TrimMethodCallExpression expr) { - throw DcCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; + throw PersoniumCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; } @Override public void visit(YearMethodCallExpression expr) { - throw DcCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; + throw PersoniumCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; } @Override public void visit(MonthMethodCallExpression expr) { - throw DcCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; + throw PersoniumCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; } @Override public void visit(DayMethodCallExpression expr) { - throw DcCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; + throw PersoniumCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; } @Override public void visit(HourMethodCallExpression expr) { - throw DcCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; + throw PersoniumCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; } @Override public void visit(MinuteMethodCallExpression expr) { - throw DcCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; + throw PersoniumCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; } @Override public void visit(SecondMethodCallExpression expr) { - throw DcCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; + throw PersoniumCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; } @Override public void visit(RoundMethodCallExpression expr) { - throw DcCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; + throw PersoniumCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; } @Override public void visit(FloorMethodCallExpression expr) { - throw DcCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; + throw PersoniumCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; } @Override public void visit(CeilingMethodCallExpression expr) { - throw DcCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; + throw PersoniumCoreException.OData.UNSUPPORTED_QUERY_FUNCTION; } @Override diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/ExpandEntitiesMapCreator.java b/src/main/java/io/personium/core/model/impl/es/odata/ExpandEntitiesMapCreator.java similarity index 91% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/odata/ExpandEntitiesMapCreator.java rename to src/main/java/io/personium/core/model/impl/es/odata/ExpandEntitiesMapCreator.java index 92058122a..9f5c338b6 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/ExpandEntitiesMapCreator.java +++ b/src/main/java/io/personium/core/model/impl/es/odata/ExpandEntitiesMapCreator.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.odata; +package io.personium.core.model.impl.es.odata; import java.util.ArrayList; import java.util.HashMap; @@ -28,19 +28,19 @@ import org.odata4j.expression.EntitySimpleProperty; import org.odata4j.producer.QueryInfo; -import com.fujitsu.dc.common.es.response.DcItem; -import com.fujitsu.dc.common.es.response.DcMultiSearchResponse; -import com.fujitsu.dc.common.es.response.DcSearchHit; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.core.model.impl.es.QueryMapFactory; -import com.fujitsu.dc.core.model.impl.es.accessor.DataSourceAccessor; -import com.fujitsu.dc.core.model.impl.es.accessor.ODataLinkAccessor; -import com.fujitsu.dc.core.model.impl.es.doc.EntitySetDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.LinkDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.LinkDocHandler.NtoNQueryParameter; -import com.fujitsu.dc.core.model.impl.es.doc.OEntityDocHandler; -import com.fujitsu.dc.core.utils.ODataUtils; +import io.personium.common.es.response.PersoniumItem; +import io.personium.common.es.response.PersoniumMultiSearchResponse; +import io.personium.common.es.response.PersoniumSearchHit; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.Property; +import io.personium.core.model.impl.es.QueryMapFactory; +import io.personium.core.model.impl.es.accessor.DataSourceAccessor; +import io.personium.core.model.impl.es.accessor.ODataLinkAccessor; +import io.personium.core.model.impl.es.doc.EntitySetDocHandler; +import io.personium.core.model.impl.es.doc.LinkDocHandler; +import io.personium.core.model.impl.es.doc.LinkDocHandler.NtoNQueryParameter; +import io.personium.core.model.impl.es.doc.OEntityDocHandler; +import io.personium.core.utils.ODataUtils; /** * ODataProducerUtils. @@ -88,7 +88,7 @@ private void setNavigationPropertyList(final QueryInfo queryInfo, EdmEntityType EdmNavigationProperty edmNavProp = edmType.findNavigationProperty(navigationPropertyName); // スキーマに存在しないNavigationPropertyを指定した場合はエラーとする if (edmNavProp == null) { - throw DcCoreException.OData.EXPAND_NTKP_NOT_FOUND_ERROR.params(navigationPropertyName); + throw PersoniumCoreException.OData.EXPAND_NTKP_NOT_FOUND_ERROR.params(navigationPropertyName); } this.navigationPropertyList.add(navigationPropertyName); } @@ -147,7 +147,7 @@ public void setCache(List baseEntityList, EsODataProducer p // ID一覧を使ってexpandデータを取得する String baseEntityTypeName = this.edmBaseEntityType.getName(); String baseEntityLinksKey = producer.getLinkskey(baseEntityTypeName); - DcMultiSearchResponse multiSearchResponse = getRelatedEntities(producer, + PersoniumMultiSearchResponse multiSearchResponse = getRelatedEntities(producer, relatedEntityIdList, baseEntityLinksKey, baseEntityList); @@ -168,9 +168,9 @@ public void setCache(List baseEntityList, EsODataProducer p } // 検索結果をrelatedEntitieslistに追加する - for (DcItem item : multiSearchResponse) { - DcSearchHit[] searchHits = item.getSearchHits(); - for (DcSearchHit hit : searchHits) { + for (PersoniumItem item : multiSearchResponse) { + PersoniumSearchHit[] searchHits = item.getSearchHits(); + for (PersoniumSearchHit hit : searchHits) { // 取得データのDocHandlerを生成する Map entityTypeNameMap = producer.getEntityTypeMap(); Map source = hit.getSource(); @@ -287,12 +287,12 @@ private List getRelatedEntityIdListFromLinkTable(List getEntityIdListFromBaseData(EsODataProducer producer, return idList; } - private DcMultiSearchResponse getRelatedEntities(EsODataProducer producer, + private PersoniumMultiSearchResponse getRelatedEntities(EsODataProducer producer, List expandEntityIdList, String baseEntityLinksKey, List baseEntityList) { @@ -393,7 +393,7 @@ private DcMultiSearchResponse getRelatedEntities(EsODataProducer producer, } DataSourceAccessor accessor = producer.getAccessorForBatch(); - DcMultiSearchResponse searchResponse = accessor.multiSearchForIndex(producer.getCellId(), queries); + PersoniumMultiSearchResponse searchResponse = accessor.multiSearchForIndex(producer.getCellId(), queries); return searchResponse; } diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/FilterConditionValidator.java b/src/main/java/io/personium/core/model/impl/es/odata/FilterConditionValidator.java similarity index 85% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/odata/FilterConditionValidator.java rename to src/main/java/io/personium/core/model/impl/es/odata/FilterConditionValidator.java index 8ed84671c..514218d7e 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/FilterConditionValidator.java +++ b/src/main/java/io/personium/core/model/impl/es/odata/FilterConditionValidator.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.odata; +package io.personium.core.model.impl.es.odata; import java.util.HashMap; import java.util.Map; @@ -29,8 +29,8 @@ import org.odata4j.expression.NullLiteral; import org.odata4j.expression.StringLiteral; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.utils.ODataUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.utils.ODataUtils; /** @@ -72,7 +72,7 @@ static void validateFilterOpCondition(EdmProperty edmProperty, CommonExpression // 真偽値やNULLは大小比較ができないため、許容しない。 if (searchValue instanceof BooleanLiteral || searchValue instanceof NullLiteral) { - throw DcCoreException.OData.FILTER_PARSE_ERROR; + throw PersoniumCoreException.OData.FILTER_PARSE_ERROR; } // スキーマ定義されているプロパティのデータ型として検索条件の値が評価できることを検証する。 @@ -80,7 +80,7 @@ static void validateFilterOpCondition(EdmProperty edmProperty, CommonExpression if (edmProperty != null) { AbstractValidator validator = validatorMap.get(edmProperty.getType()); if (null == validator) { - throw DcCoreException.OData.FILTER_PARSE_ERROR; + throw PersoniumCoreException.OData.FILTER_PARSE_ERROR; } validator.validate(searchValue, edmProperty.getName()); } @@ -105,7 +105,7 @@ static void validateFilterEqCondition(EdmProperty edmProperty, CommonExpression if (edmProperty != null) { AbstractValidator validator = validatorMap.get(edmProperty.getType()); if (null == validator) { - throw DcCoreException.OData.FILTER_PARSE_ERROR; + throw PersoniumCoreException.OData.FILTER_PARSE_ERROR; } validator.validate(searchValue, edmProperty.getName()); } @@ -122,7 +122,7 @@ static void validateFilterEqCondition(EdmProperty edmProperty, CommonExpression static void validateFilterFuncCondition(EdmProperty edmProperty, CommonExpression searchValue) { // 関数(substringof/startswith)共通で許容するデータ: 文字列 if (!(searchValue instanceof StringLiteral)) { - throw DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params(edmProperty.getName()); + throw PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params(edmProperty.getName()); } // スキーマ定義されているプロパティのデータ型として検索条件の値が評価できることを検証する。 @@ -130,7 +130,7 @@ static void validateFilterFuncCondition(EdmProperty edmProperty, CommonExpressio if (edmProperty != null && !EdmSimpleType.STRING.getFullyQualifiedTypeName().equals( edmProperty.getType().getFullyQualifiedTypeName())) { - throw DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params(edmProperty.getName()); + throw PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params(edmProperty.getName()); } } @@ -157,7 +157,7 @@ public void validate(CommonExpression searchValue, String propertyName) { || searchValue instanceof NullLiteral) { return; } - throw DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params(propertyName); + throw PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params(propertyName); } } @@ -171,7 +171,7 @@ public void validate(CommonExpression searchValue, String propertyName) { || searchValue instanceof NullLiteral) { return; } - throw DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params(propertyName); + throw PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params(propertyName); } } @@ -189,12 +189,12 @@ public void validate(CommonExpression searchValue, String propertyName) { } else if (searchValue instanceof NullLiteral) { value = 0; } else { - throw DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params(propertyName); + throw PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params(propertyName); } // 値の範囲チェック if (value > Integer.MAX_VALUE || value < Integer.MIN_VALUE) { - throw DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params(propertyName); + throw PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params(propertyName); } } } @@ -211,7 +211,7 @@ public void validate(CommonExpression searchValue, String propertyName) { || searchValue instanceof NullLiteral) { return; } - throw DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params(propertyName); + throw PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params(propertyName); } } @@ -231,12 +231,12 @@ public void validate(CommonExpression searchValue, String propertyName) { } else if (searchValue instanceof NullLiteral) { value = 0; } else { - throw DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params(propertyName); + throw PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params(propertyName); } // 値の範囲チェック if (!ODataUtils.validateSingle(String.valueOf(value))) { - throw DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params(propertyName); + throw PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params(propertyName); } } } @@ -255,12 +255,12 @@ public void validate(CommonExpression searchValue, String propertyName) { } else if (searchValue instanceof NullLiteral) { value = 0; } else { - throw DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params(propertyName); + throw PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params(propertyName); } // 値の範囲チェック if (value > ODataUtils.DATETIME_MAX || value < ODataUtils.DATETIME_MIN) { - throw DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params(propertyName); + throw PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params(propertyName); } } } diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/ODataProducerUtils.java b/src/main/java/io/personium/core/model/impl/es/odata/ODataProducerUtils.java similarity index 87% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/odata/ODataProducerUtils.java rename to src/main/java/io/personium/core/model/impl/es/odata/ODataProducerUtils.java index 2a8fe45de..291d38e05 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/ODataProducerUtils.java +++ b/src/main/java/io/personium/core/model/impl/es/odata/ODataProducerUtils.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.odata; +package io.personium.core.model.impl.es.odata; import java.util.ArrayList; import java.util.HashMap; @@ -32,16 +32,16 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.es.response.DcSearchHits; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.auth.AuthUtils; -import com.fujitsu.dc.core.model.impl.es.accessor.EntitySetAccessor; -import com.fujitsu.dc.core.model.impl.es.doc.EntitySetDocHandler; -import com.fujitsu.dc.core.odata.OEntityWrapper; -import com.fujitsu.dc.core.rs.odata.AbstractODataResource; -import com.fujitsu.dc.core.utils.ODataUtils; +import io.personium.common.es.response.PersoniumSearchHits; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.auth.AuthUtils; +import io.personium.core.model.impl.es.accessor.EntitySetAccessor; +import io.personium.core.model.impl.es.doc.EntitySetDocHandler; +import io.personium.core.odata.OEntityWrapper; +import io.personium.core.rs.odata.AbstractODataResource; +import io.personium.core.utils.ODataUtils; /** * ODataProducerUtils. @@ -91,7 +91,7 @@ static void checkUniqueness(EsODataProducer producer, OEntityWrapper newEntity, EntitySetDocHandler hit = producer.retrieveWithKey(newEntity.getEntitySet(), newEntity.getEntityKey()); if (hit != null) { // データが存在したら CONFLICT エラーとする - throw DcCoreException.OData.ENTITY_ALREADY_EXISTS; + throw PersoniumCoreException.OData.ENTITY_ALREADY_EXISTS; } } @@ -104,7 +104,7 @@ static void checkUniqueness(EsODataProducer producer, OEntityWrapper newEntity, Iterable> anots = edmProp.getAnnotations(); for (NamespacedAnnotation anot : anots) { if ("Unique".equals(anot.getName()) - && DcCoreUtils.XmlConst.NS_DC1.equals(anot.getNamespace().getUri())) { + && PersoniumCoreUtils.XmlConst.NS_PERSONIUM.equals(anot.getNamespace().getUri())) { String ukName = (String) anot.getValue(); List ukProps = uks.get(ukName); if (ukProps == null) { @@ -151,7 +151,7 @@ static void checkUniqueness(EsODataProducer producer, OEntityWrapper newEntity, EntitySetDocHandler edh = producer.retrieveWithKey(newEntity.getEntitySet(), ukSet, null); if (edh != null) { // データが存在したら CONFLICT エラーとする - throw DcCoreException.OData.ENTITY_ALREADY_EXISTS; + throw PersoniumCoreException.OData.ENTITY_ALREADY_EXISTS; } } } @@ -166,7 +166,7 @@ static void checkUniqueness(EsODataProducer producer, OEntityWrapper newEntity, * @param queryInfo リクエストで指定されたクエリ情報 * @return Links情報の検索結果 */ - public static DcSearchHits searchLinksNN(EntitySetDocHandler src, + public static PersoniumSearchHits searchLinksNN(EntitySetDocHandler src, String targetSetName, List idvals, EntitySetAccessor tgtEsType, QueryInfo queryInfo) { if (idvals.size() == 0) { @@ -175,7 +175,7 @@ public static DcSearchHits searchLinksNN(EntitySetDocHandler src, // リクエストでクエリが指定されていない場合は、デフォルト値を設定する // linksの一覧取得で設定できるクエリは、$top,$skipのみのため、$top,$skipのみデフォルト値を設定している - Integer size = DcCoreConfig.getTopQueryDefaultSize(); + Integer size = PersoniumUnitConfig.getTopQueryDefaultSize(); Integer from = 0; if (queryInfo != null) { if (queryInfo.top != null) { @@ -208,7 +208,7 @@ public static DcSearchHits searchLinksNN(EntitySetDocHandler src, orderByName.put("s.Name.untouched", order); orderById.put("s.__id.untouched", order); - DcSearchHits sHits = tgtEsType.search(source).hits(); + PersoniumSearchHits sHits = tgtEsType.search(source).hits(); return sHits; } @@ -232,12 +232,12 @@ public static void createRequestPassword(EntitySetDocHandler oedhNew, String dcC String hPassStr = AuthUtils.checkValidatePassword(dcCredHeader, oedhNew.getType()); // 変更するパスワードをHashedCredentialへ上書きする Map hiddenFields = oedhNew.getHiddenFields(); - // X-Dc-Credentialの値をHashedCredentialのキーへputする + // X-Personium-Credentialの値をHashedCredentialのキーへputする // 指定がない場合400エラーを返却する if (hPassStr != null) { hiddenFields.put("HashedCredential", hPassStr); } else { - throw DcCoreException.Auth.DC_CREDENTIAL_REQUIRED; + throw PersoniumCoreException.Auth.P_CREDENTIAL_REQUIRED; } oedhNew.setHiddenFields(hiddenFields); diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/ODataQueryHandler.java b/src/main/java/io/personium/core/model/impl/es/odata/ODataQueryHandler.java similarity index 93% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/odata/ODataQueryHandler.java rename to src/main/java/io/personium/core/model/impl/es/odata/ODataQueryHandler.java index 49f86f5c6..be93126db 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/ODataQueryHandler.java +++ b/src/main/java/io/personium/core/model/impl/es/odata/ODataQueryHandler.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.odata; +package io.personium.core.model.impl.es.odata; import java.util.List; import java.util.Map; diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/PropertyAlias.java b/src/main/java/io/personium/core/model/impl/es/odata/PropertyAlias.java similarity index 94% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/odata/PropertyAlias.java rename to src/main/java/io/personium/core/model/impl/es/odata/PropertyAlias.java index 14e2bb8f6..d46ee9c0f 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/PropertyAlias.java +++ b/src/main/java/io/personium/core/model/impl/es/odata/PropertyAlias.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.odata; +package io.personium.core.model.impl.es.odata; import java.io.Serializable; diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/PropertyLimitChecker.java b/src/main/java/io/personium/core/model/impl/es/odata/PropertyLimitChecker.java similarity index 94% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/odata/PropertyLimitChecker.java rename to src/main/java/io/personium/core/model/impl/es/odata/PropertyLimitChecker.java index a77cdadb6..4691fdd56 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/PropertyLimitChecker.java +++ b/src/main/java/io/personium/core/model/impl/es/odata/PropertyLimitChecker.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.odata; +package io.personium.core.model.impl.es.odata; import java.util.ArrayList; import java.util.Iterator; @@ -33,9 +33,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.model.impl.es.doc.ComplexTypePropertyDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.PropertyDocHandler; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.model.impl.es.doc.ComplexTypePropertyDocHandler; +import io.personium.core.model.impl.es.doc.PropertyDocHandler; import java.util.Arrays; @@ -149,9 +149,9 @@ static class EntityTypeDepthExceedException extends PropertyLimitException { * default constructor. */ public PropertyLimitChecker() { - this.maxPropertyLimitInEntityType = DcCoreConfig.getMaxPropertyCountInEntityType(); - this.simplePropertyLimits = DcCoreConfig.getUserdataSimpleTypePropertyLimits(); - this.complexPropertyLimits = DcCoreConfig.getUserdataComplexTypePropertyLimits(); + this.maxPropertyLimitInEntityType = PersoniumUnitConfig.getMaxPropertyCountInEntityType(); + this.simplePropertyLimits = PersoniumUnitConfig.getUserdataSimpleTypePropertyLimits(); + this.complexPropertyLimits = PersoniumUnitConfig.getUserdataComplexTypePropertyLimits(); this.maxDepth = simplePropertyLimits.length; int[] maxPropLimitCopy = Arrays.copyOf(simplePropertyLimits, simplePropertyLimits.length); diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/UnitCtlODataProducer.java b/src/main/java/io/personium/core/model/impl/es/odata/UnitCtlODataProducer.java similarity index 83% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/odata/UnitCtlODataProducer.java rename to src/main/java/io/personium/core/model/impl/es/odata/UnitCtlODataProducer.java index 548a89114..81dbc5e52 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/UnitCtlODataProducer.java +++ b/src/main/java/io/personium/core/model/impl/es/odata/UnitCtlODataProducer.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.odata; +package io.personium.core.model.impl.es.odata; import java.util.ArrayList; import java.util.HashMap; @@ -27,22 +27,22 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.es.EsIndex; -import com.fujitsu.dc.common.es.response.DcGetResponse; -import com.fujitsu.dc.common.es.response.DcSearchHit; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.ModelFactory; -import com.fujitsu.dc.core.model.ctl.CtlSchema; -import com.fujitsu.dc.core.model.impl.es.EsModel; -import com.fujitsu.dc.core.model.impl.es.accessor.DataSourceAccessor; -import com.fujitsu.dc.core.model.impl.es.accessor.EntitySetAccessor; -import com.fujitsu.dc.core.model.impl.es.accessor.ODataLinkAccessor; -import com.fujitsu.dc.core.model.impl.es.cache.CellCache; -import com.fujitsu.dc.core.model.impl.es.doc.CellDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.EntitySetDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.OEntityDocHandler; -import com.fujitsu.dc.core.odata.OEntityWrapper; +import io.personium.common.es.EsIndex; +import io.personium.common.es.response.PersoniumGetResponse; +import io.personium.common.es.response.PersoniumSearchHit; +import io.personium.core.auth.AccessContext; +import io.personium.core.model.Cell; +import io.personium.core.model.ModelFactory; +import io.personium.core.model.ctl.CtlSchema; +import io.personium.core.model.impl.es.EsModel; +import io.personium.core.model.impl.es.accessor.DataSourceAccessor; +import io.personium.core.model.impl.es.accessor.EntitySetAccessor; +import io.personium.core.model.impl.es.accessor.ODataLinkAccessor; +import io.personium.core.model.impl.es.cache.CellCache; +import io.personium.core.model.impl.es.doc.CellDocHandler; +import io.personium.core.model.impl.es.doc.EntitySetDocHandler; +import io.personium.core.model.impl.es.doc.OEntityDocHandler; +import io.personium.core.odata.OEntityWrapper; /** * ユニット制御のODataサービスむけODataProvider. @@ -154,7 +154,7 @@ public EdmDataServices getMetadata() { * @return OEntityDocHandler */ @Override - protected EntitySetDocHandler getDocHandler(DcSearchHit searchHit, String entitySetName) { + protected EntitySetDocHandler getDocHandler(PersoniumSearchHit searchHit, String entitySetName) { return new CellDocHandler(searchHit); } @@ -176,7 +176,7 @@ protected EntitySetDocHandler getDocHanlder(String type, OEntityWrapper oEntity) * @return OEntityDocHandler */ @Override - protected EntitySetDocHandler getDocHandler(DcGetResponse response, String entitySetName) { + protected EntitySetDocHandler getDocHandler(PersoniumGetResponse response, String entitySetName) { return new CellDocHandler(response); } diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/UserDataODataProducer.java b/src/main/java/io/personium/core/model/impl/es/odata/UserDataODataProducer.java similarity index 88% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/odata/UserDataODataProducer.java rename to src/main/java/io/personium/core/model/impl/es/odata/UserDataODataProducer.java index ab9c25721..00ac80f01 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/UserDataODataProducer.java +++ b/src/main/java/io/personium/core/model/impl/es/odata/UserDataODataProducer.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.odata; +package io.personium.core.model.impl.es.odata; import java.io.StringReader; import java.io.StringWriter; @@ -46,36 +46,36 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.es.response.DcGetResponse; -import com.fujitsu.dc.common.es.response.DcSearchHit; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.DavCmp; -import com.fujitsu.dc.core.model.ctl.AssociationEnd; -import com.fujitsu.dc.core.model.ctl.ComplexType; -import com.fujitsu.dc.core.model.ctl.ComplexTypeProperty; -import com.fujitsu.dc.core.model.ctl.CtlSchema; -import com.fujitsu.dc.core.model.ctl.EntityType; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.core.model.impl.es.EsModel; -import com.fujitsu.dc.core.model.impl.es.QueryMapFactory; -import com.fujitsu.dc.core.model.impl.es.accessor.DataSourceAccessor; -import com.fujitsu.dc.core.model.impl.es.accessor.EntitySetAccessor; -import com.fujitsu.dc.core.model.impl.es.accessor.ODataLinkAccessor; -import com.fujitsu.dc.core.model.impl.es.cache.UserDataSchemaCache; -import com.fujitsu.dc.core.model.impl.es.doc.EntitySetDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.LinkDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.OEntityDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.PropertyDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.UserDataDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.UserDataLinkDocHandler; -import com.fujitsu.dc.core.odata.DcEdmxFormatParser; -import com.fujitsu.dc.core.odata.OEntityWrapper; -import com.fujitsu.dc.core.rs.odata.BulkRequest; -import com.fujitsu.dc.core.rs.odata.ODataBatchResource.NavigationPropertyBulkContext; -import com.fujitsu.dc.core.rs.odata.ODataBatchResource.NavigationPropertyLinkType; -import com.fujitsu.dc.core.utils.EscapeControlCode; +import io.personium.common.es.response.PersoniumGetResponse; +import io.personium.common.es.response.PersoniumSearchHit; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.Cell; +import io.personium.core.model.DavCmp; +import io.personium.core.model.ctl.AssociationEnd; +import io.personium.core.model.ctl.ComplexType; +import io.personium.core.model.ctl.ComplexTypeProperty; +import io.personium.core.model.ctl.CtlSchema; +import io.personium.core.model.ctl.EntityType; +import io.personium.core.model.ctl.Property; +import io.personium.core.model.impl.es.EsModel; +import io.personium.core.model.impl.es.QueryMapFactory; +import io.personium.core.model.impl.es.accessor.DataSourceAccessor; +import io.personium.core.model.impl.es.accessor.EntitySetAccessor; +import io.personium.core.model.impl.es.accessor.ODataLinkAccessor; +import io.personium.core.model.impl.es.cache.UserDataSchemaCache; +import io.personium.core.model.impl.es.doc.EntitySetDocHandler; +import io.personium.core.model.impl.es.doc.LinkDocHandler; +import io.personium.core.model.impl.es.doc.OEntityDocHandler; +import io.personium.core.model.impl.es.doc.PropertyDocHandler; +import io.personium.core.model.impl.es.doc.UserDataDocHandler; +import io.personium.core.model.impl.es.doc.UserDataLinkDocHandler; +import io.personium.core.odata.PersoniumEdmxFormatParser; +import io.personium.core.odata.OEntityWrapper; +import io.personium.core.rs.odata.BulkRequest; +import io.personium.core.rs.odata.ODataBatchResource.NavigationPropertyBulkContext; +import io.personium.core.rs.odata.ODataBatchResource.NavigationPropertyLinkType; +import io.personium.core.utils.EscapeControlCode; /** * ユーザデータのODataサービスむけODataProvider. @@ -166,7 +166,7 @@ protected EntitySetDocHandler getDocHanlder(String type, OEntityWrapper oEntity) } @Override - protected EntitySetDocHandler getDocHandler(DcSearchHit searchHit, String entitySetName) { + protected EntitySetDocHandler getDocHandler(PersoniumSearchHit searchHit, String entitySetName) { this.getMetadata(); UserDataDocHandler handler = new UserDataDocHandler(searchHit); handler.setPropertyAliasMap(getPropertyAliasMap()); @@ -175,7 +175,7 @@ protected EntitySetDocHandler getDocHandler(DcSearchHit searchHit, String entity } @Override - protected EntitySetDocHandler getDocHandler(DcGetResponse response, String entitySetName) { + protected EntitySetDocHandler getDocHandler(PersoniumGetResponse response, String entitySetName) { UserDataDocHandler handler = new UserDataDocHandler(response); handler.setPropertyAliasMap(getPropertyAliasMap()); handler.setEntitySetName(entitySetName); @@ -256,7 +256,7 @@ private void reloadMetadata() { XMLFactoryProvider2 provider = StaxXMLFactoryProvider2.getInstance(); XMLInputFactory2 factory = provider.newXMLInputFactory2(); XMLEventReader2 reader = factory.createXMLEventReader(sr); - DcEdmxFormatParser parser = new DcEdmxFormatParser(); + PersoniumEdmxFormatParser parser = new PersoniumEdmxFormatParser(); metacache = parser.parseMetadata(reader); } catch (RuntimeException ex) { log.info("XMLParseException: " + ex.getMessage(), ex.fillInStackTrace()); @@ -292,7 +292,7 @@ private EdmDataServices getMetadataFromDataSource() { // データ取得件数はエンティティタイプの最大数と1エンティティタイプ内の最大プロパティ数 int schemaPropertyGetCount = - DcCoreConfig.getUserdataMaxEntityCount() * DcCoreConfig.getMaxPropertyCountInEntityType(); + PersoniumUnitConfig.getUserdataMaxEntityCount() * PersoniumUnitConfig.getMaxPropertyCountInEntityType(); // ソート条件としてNameを指定する List orderBy = OptionsQueryParser.parseOrderBy("Name"); @@ -377,7 +377,7 @@ public LinkDocHandler getLinkDocHandler(EntitySetDocHandler src, EntitySetDocHan } @Override - public LinkDocHandler getLinkDocHandler(DcSearchHit searchHit) { + public LinkDocHandler getLinkDocHandler(PersoniumSearchHit searchHit) { return new UserDataLinkDocHandler(searchHit); } @@ -405,7 +405,7 @@ public void beforeBulkCreate(final LinkedHashMap bulkReques } if (!(request.getValue().getDocHandler() instanceof UserDataDocHandler)) { - request.getValue().setError(DcCoreException.Server.UNKNOWN_ERROR); + request.getValue().setError(PersoniumCoreException.Server.UNKNOWN_ERROR); continue; } @@ -437,7 +437,7 @@ public void beforeBulkCreate(final LinkedHashMap bulkReques // 動的プロパティ作成時にエラーが発生した場合は、該当リクエストのみ、エラーを設定する try { createDynamicPropertyEntity(docHandler); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { request.getValue().setError(e); } @@ -488,7 +488,7 @@ public void createDynamicPropertyEntity(final EntitySetDocHandler docHandler) { long count = accessor.count(queryMap); if (0 != count) { UserDataSchemaCache.clear(this.davCmp.getId()); - throw DcCoreException.Misc.TOO_MANY_CONCURRENT_REQUESTS; + throw PersoniumCoreException.Misc.TOO_MANY_CONCURRENT_REQUESTS; } for (PropertyDocHandler propertyDocHandler : propertyDocHandlerList) { @@ -563,10 +563,10 @@ public void checkLinksUpperLimitRecord(List npBul String bulkLinkContextsKey = getBatchLinkContextsKey(npBulkContext); BatchLinkContext batchLinkContext = batchLinkContexts.get(bulkLinkContextsKey); - if (batchLinkContext.getRegistCount() >= DcCoreConfig.getLinksNtoNMaxSize()) { + if (batchLinkContext.getRegistCount() >= PersoniumUnitConfig.getLinksNtoNMaxSize()) { // リンクの上限値を超えている場合 - npBulkRequest.setError(DcCoreException.OData.LINK_UPPER_LIMIT_RECORD_EXEED); - npBulkContext.setException(DcCoreException.OData.LINK_UPPER_LIMIT_RECORD_EXEED); + npBulkRequest.setError(PersoniumCoreException.OData.LINK_UPPER_LIMIT_RECORD_EXEED); + npBulkContext.setException(PersoniumCoreException.OData.LINK_UPPER_LIMIT_RECORD_EXEED); } else { // 正常な場合は解析済み件数をインクリメントする batchLinkContext.incrementRegistCount(); diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/UserDataQueryHandler.java b/src/main/java/io/personium/core/model/impl/es/odata/UserDataQueryHandler.java similarity index 90% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/odata/UserDataQueryHandler.java rename to src/main/java/io/personium/core/model/impl/es/odata/UserDataQueryHandler.java index 8a443d214..6b70bb896 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/UserDataQueryHandler.java +++ b/src/main/java/io/personium/core/model/impl/es/odata/UserDataQueryHandler.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.odata; +package io.personium.core.model.impl.es.odata; import java.util.Map; @@ -26,10 +26,10 @@ import org.odata4j.expression.EntitySimpleProperty; import org.odata4j.expression.OrderByExpression; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.model.impl.es.doc.OEntityDocHandler; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.Common; +import io.personium.core.model.impl.es.doc.OEntityDocHandler; /** * UserDataのelasticsearchクエリハンドラー. @@ -54,7 +54,7 @@ public UserDataQueryHandler(EdmEntityType entityType, Map public void visit(OrderByExpression expr) { log.debug("visit(OrderByExpression expr)"); if (!(expr.getExpression() instanceof EntitySimpleProperty)) { - throw DcCoreException.OData.FILTER_PARSE_ERROR; + throw PersoniumCoreException.OData.FILTER_PARSE_ERROR; } // ソート対象のプロパティスキーマを取得する @@ -68,7 +68,7 @@ public void visit(OrderByExpression expr) { // 配列に対するソート指定時はエラーとする if (CollectionKind.List.equals(edmProperty.getCollectionKind())) { - throw DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY; + throw PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY; } if (!isUntouched(name, edmProperty)) { @@ -78,7 +78,7 @@ public void visit(OrderByExpression expr) { String key = getSearchKey(expr.getExpression(), true); String orderOption = getOrderOption(expr.getDirection()); Map orderByValue = null; - if (DcCoreConfig.getOrderbySortOrder()) { + if (PersoniumUnitConfig.getOrderbySortOrder()) { orderByValue = UserDataQueryHandlerHelper.getOrderByValueForMissingFirst(orderOption, key); } else { orderByValue = UserDataQueryHandlerHelper.getOrderByValue(orderOption, key); diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/UserSchemaODataProducer.java b/src/main/java/io/personium/core/model/impl/es/odata/UserSchemaODataProducer.java similarity index 85% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/odata/UserSchemaODataProducer.java rename to src/main/java/io/personium/core/model/impl/es/odata/UserSchemaODataProducer.java index 5cff93cb0..5d1b604b4 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/UserSchemaODataProducer.java +++ b/src/main/java/io/personium/core/model/impl/es/odata/UserSchemaODataProducer.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.odata; +package io.personium.core.model.impl.es.odata; import java.util.ArrayList; import java.util.HashMap; @@ -46,38 +46,38 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.es.EsIndex; -import com.fujitsu.dc.common.es.response.DcSearchHit; -import com.fujitsu.dc.common.es.response.DcSearchResponse; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.DavCmp; -import com.fujitsu.dc.core.model.ModelFactory; -import com.fujitsu.dc.core.model.ctl.AssociationEnd; -import com.fujitsu.dc.core.model.ctl.ComplexType; -import com.fujitsu.dc.core.model.ctl.ComplexTypeProperty; -import com.fujitsu.dc.core.model.ctl.CtlSchema; -import com.fujitsu.dc.core.model.ctl.EntityType; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.core.model.impl.es.EsModel; -import com.fujitsu.dc.core.model.impl.es.QueryMapFactory; -import com.fujitsu.dc.core.model.impl.es.accessor.CellAccessor; -import com.fujitsu.dc.core.model.impl.es.accessor.DataSourceAccessor; -import com.fujitsu.dc.core.model.impl.es.accessor.EntitySetAccessor; -import com.fujitsu.dc.core.model.impl.es.accessor.ODataEntityAccessor; -import com.fujitsu.dc.core.model.impl.es.accessor.ODataLinkAccessor; -import com.fujitsu.dc.core.model.impl.es.cache.UserDataSchemaCache; -import com.fujitsu.dc.core.model.impl.es.doc.ComplexTypePropertyDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.ComplexTypePropertyUpdateDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.EntitySetDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.OEntityDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.PropertyDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.PropertyUpdateDocHandler; -import com.fujitsu.dc.core.model.impl.es.odata.PropertyLimitChecker.CheckError; -import com.fujitsu.dc.core.odata.DcODataProducer; -import com.fujitsu.dc.core.odata.DcOptionsQueryParser; -import com.fujitsu.dc.core.odata.OEntityWrapper; +import io.personium.common.es.EsIndex; +import io.personium.common.es.response.PersoniumSearchHit; +import io.personium.common.es.response.PersoniumSearchResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.Cell; +import io.personium.core.model.DavCmp; +import io.personium.core.model.ModelFactory; +import io.personium.core.model.ctl.AssociationEnd; +import io.personium.core.model.ctl.ComplexType; +import io.personium.core.model.ctl.ComplexTypeProperty; +import io.personium.core.model.ctl.CtlSchema; +import io.personium.core.model.ctl.EntityType; +import io.personium.core.model.ctl.Property; +import io.personium.core.model.impl.es.EsModel; +import io.personium.core.model.impl.es.QueryMapFactory; +import io.personium.core.model.impl.es.accessor.CellAccessor; +import io.personium.core.model.impl.es.accessor.DataSourceAccessor; +import io.personium.core.model.impl.es.accessor.EntitySetAccessor; +import io.personium.core.model.impl.es.accessor.ODataEntityAccessor; +import io.personium.core.model.impl.es.accessor.ODataLinkAccessor; +import io.personium.core.model.impl.es.cache.UserDataSchemaCache; +import io.personium.core.model.impl.es.doc.ComplexTypePropertyDocHandler; +import io.personium.core.model.impl.es.doc.ComplexTypePropertyUpdateDocHandler; +import io.personium.core.model.impl.es.doc.EntitySetDocHandler; +import io.personium.core.model.impl.es.doc.OEntityDocHandler; +import io.personium.core.model.impl.es.doc.PropertyDocHandler; +import io.personium.core.model.impl.es.doc.PropertyUpdateDocHandler; +import io.personium.core.model.impl.es.odata.PropertyLimitChecker.CheckError; +import io.personium.core.odata.PersoniumODataProducer; +import io.personium.core.odata.PersoniumOptionsQueryParser; +import io.personium.core.odata.OEntityWrapper; /** * ユーザデータスキーマのODataサービスむけODataProvider. @@ -88,7 +88,7 @@ public class UserSchemaODataProducer extends EsODataProducer { Cell cell; DavCmp davCmp; - DcODataProducer userDataProducer = null; + PersoniumODataProducer userDataProducer = null; /** * Constructor. @@ -171,7 +171,7 @@ protected void checkUniqueness(String entitySetName, OEntityWrapper entity) { // Name='p_name_1377142311063',_EntityType.Name='SalesDetail' if (propertyAliasMap.containsKey(propertyKey)) { // データが存在したら CONFLICT エラーとする - throw DcCoreException.OData.ENTITY_ALREADY_EXISTS; + throw PersoniumCoreException.OData.ENTITY_ALREADY_EXISTS; } } } else { @@ -210,7 +210,7 @@ public void beforeCreate(final String entitySetName, final OEntity oEntity, fina String nullableKey = Property.P_NULLABLE.getName(); String nullable = oEntity.getProperty(nullableKey).getValue().toString(); if (nullable.equals("false")) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(nullableKey); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(nullableKey); } } } else if (ComplexTypeProperty.EDM_TYPE_NAME.equals(entitySetName)) { @@ -222,7 +222,7 @@ public void beforeCreate(final String entitySetName, final OEntity oEntity, fina String nullableKey = ComplexTypeProperty.P_NULLABLE.getName(); String nullable = oEntity.getProperty(nullableKey).getValue().toString(); if (nullable.equals("false")) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(nullableKey); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(nullableKey); } } } else if (EntityType.EDM_TYPE_NAME.equals(entitySetName)) { @@ -234,9 +234,9 @@ public void beforeCreate(final String entitySetName, final OEntity oEntity, fina entityTypeIter.next(); entityTypeCount++; } - if (entityTypeCount >= DcCoreConfig.getUserdataMaxEntityCount()) { + if (entityTypeCount >= PersoniumUnitConfig.getUserdataMaxEntityCount()) { log.info("Number of EntityTypes exceeds the limit."); - throw DcCoreException.OData.ENTITYTYPE_COUNT_LIMITATION_EXCEEDED; + throw PersoniumCoreException.OData.ENTITYTYPE_COUNT_LIMITATION_EXCEEDED; } } @@ -247,7 +247,7 @@ public void beforeCreate(final String entitySetName, final OEntity oEntity, fina List checkErrors = checker.checkPropertyLimits(); if (0 < checkErrors.size()) { // 幾つかの EntityTypeで何らかのエラーが発生 - throw DcCoreException.OData.ENTITYTYPE_STRUCTUAL_LIMITATION_EXCEEDED; + throw PersoniumCoreException.OData.ENTITYTYPE_STRUCTUAL_LIMITATION_EXCEEDED; } } } @@ -259,7 +259,7 @@ public void beforeDelete(final String entitySetName, if (EntityType.EDM_TYPE_NAME.equals(entitySetName)) { // entitySetがEntityTypeの場合、 entitySet配下のユーザデータが1件でもあれば、409 if (!isEmpty((String) oEntityKey.asSingleValue())) { - throw DcCoreException.OData.CONFLICT_HAS_RELATED; + throw PersoniumCoreException.OData.CONFLICT_HAS_RELATED; } // 動的に定義されたプロパティ情報を検索して、削除する @@ -278,13 +278,13 @@ public void beforeDelete(final String entitySetName, Map query = QueryMapFactory.filteredQuery(null, QueryMapFactory.mustQuery(queries)); Map filter = new HashMap(); - filter.put("size", DcCoreConfig.getMaxPropertyCountInEntityType()); + filter.put("size", PersoniumUnitConfig.getMaxPropertyCountInEntityType()); filter.put("version", true); filter.put("filter", QueryMapFactory.andFilter(andfilter)); filter.put("query", query); - DcSearchResponse response = accessor.search(filter); + PersoniumSearchResponse response = accessor.search(filter); - for (DcSearchHit hit : response.getHits().getHits()) { + for (PersoniumSearchHit hit : response.getHits().getHits()) { accessor.delete(this.getDocHandler(hit, hit.getType())); } } else if (ComplexType.EDM_TYPE_NAME.equals(entitySetName)) { @@ -299,7 +299,7 @@ public void beforeDelete(final String entitySetName, continue; } if (!isEmpty((String) nv.getValue())) { - throw DcCoreException.OData.CONFLICT_HAS_RELATED; + throw PersoniumCoreException.OData.CONFLICT_HAS_RELATED; } } } else if (ComplexTypeProperty.EDM_TYPE_NAME.equals(entitySetName)) { @@ -329,7 +329,7 @@ public void beforeDelete(final String entitySetName, // 取得したEntitytypeにユーザデータが存在するかチェックする for (String entityType : entityTypeList) { if (!isEmpty(entityType)) { - throw DcCoreException.OData.CONFLICT_HAS_RELATED; + throw PersoniumCoreException.OData.CONFLICT_HAS_RELATED; } } } @@ -342,11 +342,11 @@ public void beforeDelete(final String entitySetName, private void beforeDeleteForComplexType(String complexTypeName) { // ComplexTypeを使用しているPropertyが存在する場合は409エラーを返却する if (isUsedComplexType(complexTypeName, Property.EDM_TYPE_NAME)) { - throw DcCoreException.OData.CONFLICT_HAS_RELATED; + throw PersoniumCoreException.OData.CONFLICT_HAS_RELATED; } // ComplexTypeを使用しているComplexTypePropertyが存在する場合は409エラーを返却する if (isUsedComplexType(complexTypeName, ComplexTypeProperty.EDM_TYPE_NAME)) { - throw DcCoreException.OData.CONFLICT_HAS_RELATED; + throw PersoniumCoreException.OData.CONFLICT_HAS_RELATED; } } @@ -442,7 +442,7 @@ public boolean findMultiPoint(final EdmNavigationProperty np, final OEntityKey e // 削除対象がEntityTypeで、関連データの検索対象がPropertyの場合は、静的プロパティのみ検索対象とする if (EntityType.EDM_TYPE_NAME.equals(from.getType().getName()) && Property.EDM_TYPE_NAME.equals(to.getType().getName())) { - BoolCommonExpression filter = DcOptionsQueryParser.parseFilter("IsDeclared eq true"); + BoolCommonExpression filter = PersoniumOptionsQueryParser.parseFilter("IsDeclared eq true"); query = new QueryInfo(InlineCount.NONE, null, null, filter, null, null, null, null, null); } @@ -540,11 +540,11 @@ public void setEntityTypeIds(OEntityWrapper oEntity, Map staticF * 不正なLink情報のチェックを行う. * @param sourceEntity ソース側Entity * @param targetEntity ターゲット側Entity - * @throws DcCoreException AssociationEnd - AssociationEndの$links登録時、既に同一EntityType間に関連が設定されている場合 + * @throws PersoniumCoreException AssociationEnd - AssociationEndの$links登録時、既に同一EntityType間に関連が設定されている場合 */ @Override protected void checkInvalidLinks(EntitySetDocHandler sourceEntity, EntitySetDocHandler targetEntity) - throws DcCoreException { + throws PersoniumCoreException { String targetType = targetEntity.getType(); // AssociationEnd - AssociationEnd の$links登録時、既に同一EntityType間に関連が設定されている場合はエラーとする @@ -560,11 +560,11 @@ protected void checkInvalidLinks(EntitySetDocHandler sourceEntity, EntitySetDocH * @param sourceDocHandler ソース側Entity * @param entity ターゲット側Entity * @param targetEntitySetName ターゲットのEntitySet名 - * @throws DcCoreException AssociationEnd - AssociationEndの$links登録時、既に同一EntityType間に関連が設定されている場合 + * @throws PersoniumCoreException AssociationEnd - AssociationEndの$links登録時、既に同一EntityType間に関連が設定されている場合 */ @Override protected void checkInvalidLinks(EntitySetDocHandler sourceDocHandler, OEntity entity, String targetEntitySetName) - throws DcCoreException { + throws PersoniumCoreException { // AssociationEnd - AssociationEnd の$links登録時、既に同一EntityType間に関連が設定されている場合はエラーとする if (AssociationEnd.EDM_TYPE_NAME.equals(sourceDocHandler.getType()) @@ -577,7 +577,7 @@ protected void checkInvalidLinks(EntitySetDocHandler sourceDocHandler, OEntity e if (key == null || OEntityKey.KeyType.COMPLEX != key.getKeyType()) { // AssociationEndの場合KeyTypeはCOMPLEX型なのでありえないルート log.info("Failed to get EntityType ID related with AssociationEnd."); - throw DcCoreException.OData.DETECTED_INTERNAL_DATA_CONFLICT; + throw PersoniumCoreException.OData.DETECTED_INTERNAL_DATA_CONFLICT; } Set> nvSet = key.asComplexValue(); for (NamedValue nv : nvSet) { @@ -597,15 +597,15 @@ protected void checkInvalidLinks(EntitySetDocHandler sourceDocHandler, OEntity e * 不正なLink情報(AssociationEnd - AssociationEnd)のチェックを行う. * @param sourceEntity ソース側Entity * @param relatedTargetEntityTypeId ターゲット側EntityTypeのID - * @throws DcCoreException AssociationEnd - AssociationEndの$links登録時、既に同一EntityType間に関連が設定されている場合 + * @throws PersoniumCoreException AssociationEnd - AssociationEndの$links登録時、既に同一EntityType間に関連が設定されている場合 */ private void checkAssociationEndToAssociationEndLink( EntitySetDocHandler sourceEntity, - String relatedTargetEntityTypeId) throws DcCoreException { + String relatedTargetEntityTypeId) throws PersoniumCoreException { // AssociationEnd一覧取得 // データ取得件数はエンティティタイプの最大数と1エンティティタイプ内の最大プロパティ数とする int retrieveSize = - DcCoreConfig.getUserdataMaxEntityCount() * DcCoreConfig.getMaxPropertyCountInEntityType(); + PersoniumUnitConfig.getUserdataMaxEntityCount() * PersoniumUnitConfig.getMaxPropertyCountInEntityType(); QueryInfo queryInfo = new QueryInfo(InlineCount.NONE, retrieveSize, null, null, null, null, null, null, null); EdmEntitySet edmAssociationEnd = getMetadata().findEdmEntitySet(AssociationEnd.EDM_TYPE_NAME); @@ -638,7 +638,7 @@ private void checkAssociationEndToAssociationEndLink( // 既に同一EntityType間に関連が設定されているかのチェック for (OEntityWrapper associationEnd : relatedSourceEntityTypes) { if (relatedTargetEntityTypes.contains(associationEnd.getLinkUuid(AssociationEnd.EDM_TYPE_NAME))) { - throw DcCoreException.OData.CONFLICT_DUPLICATED_ENTITY_RELATION; + throw PersoniumCoreException.OData.CONFLICT_DUPLICATED_ENTITY_RELATION; } } } @@ -669,7 +669,7 @@ protected void checkAcceptableModification(String entitySetName, requestType); if (!isAcceptableTypeModify(existingType, requestType)) { - throw DcCoreException.OData.OPERATION_NOT_SUPPORTED.params(message); + throw PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.params(message); } } @@ -679,7 +679,7 @@ protected void checkAcceptableModification(String entitySetName, Object requestValue = entry.getValue(); Object existingValue = oedhExisting.getManyToOnelinkId().get(requestKey); if (!requestValue.equals(existingValue)) { - throw DcCoreException.OData.OPERATION_NOT_SUPPORTED.params( + throw PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.params( String.format("%s '_%s.Name' change", entitySetName, requestKey)); } } @@ -692,7 +692,7 @@ protected void checkAcceptableModification(String entitySetName, if (isStaticFieldValueChanged(requestKey, requestValue, existingValue)) { String message = String.format("%s '%s' change from [%s] to [%s]", entitySetName, requestKey, existingValue, requestValue); - throw DcCoreException.OData.OPERATION_NOT_SUPPORTED.params(message); + throw PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.params(message); } } } @@ -753,9 +753,9 @@ protected void hasRelatedEntities(String entitySetName, OEntityKey entityKey) { filter.put("query", filteredQuery); DataSourceAccessor accessor = getAccessorForIndex(entitySetName); - DcSearchResponse response = accessor.indexSearch(filter); + PersoniumSearchResponse response = accessor.indexSearch(filter); if (0 < response.getHits().allPages()) { - throw DcCoreException.OData.CONFLICT_HAS_RELATED; + throw PersoniumCoreException.OData.CONFLICT_HAS_RELATED; } } } diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/package-info.java b/src/main/java/io/personium/core/model/impl/es/odata/package-info.java similarity index 91% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/odata/package-info.java rename to src/main/java/io/personium/core/model/impl/es/odata/package-info.java index 0cb53c901..7a7614f15 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/odata/package-info.java +++ b/src/main/java/io/personium/core/model/impl/es/odata/package-info.java @@ -18,5 +18,5 @@ * ODataのAPIに対して Elastic Search のバックエンドを操作するクラス群. * このパッケージ内のクラスは実際には正しく実装していません。 */ -package com.fujitsu.dc.core.model.impl.es.odata; +package io.personium.core.model.impl.es.odata; diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/package-info.java b/src/main/java/io/personium/core/model/impl/es/package-info.java similarity index 91% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/package-info.java rename to src/main/java/io/personium/core/model/impl/es/package-info.java index 9eda8c2aa..0739483c4 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/package-info.java +++ b/src/main/java/io/personium/core/model/impl/es/package-info.java @@ -17,5 +17,5 @@ /** * ElasticSearchのバックエンドを操作するクラス群. */ -package com.fujitsu.dc.core.model.impl.es; +package io.personium.core.model.impl.es; diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/repair/AdsAccessor.java b/src/main/java/io/personium/core/model/impl/es/repair/AdsAccessor.java similarity index 73% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/repair/AdsAccessor.java rename to src/main/java/io/personium/core/model/impl/es/repair/AdsAccessor.java index ee7b4875d..aad6e9b0f 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/repair/AdsAccessor.java +++ b/src/main/java/io/personium/core/model/impl/es/repair/AdsAccessor.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.repair; +package io.personium.core.model.impl.es.repair; import java.util.ArrayList; import java.util.HashMap; @@ -24,21 +24,21 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.ads.AdsWriteFailureLogInfo; -import com.fujitsu.dc.common.es.response.DcSearchHit; -import com.fujitsu.dc.common.es.response.DcSearchResponse; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.impl.es.DavNode; -import com.fujitsu.dc.core.model.impl.es.ads.Ads; -import com.fujitsu.dc.core.model.impl.es.ads.AdsException; -import com.fujitsu.dc.core.model.impl.es.ads.JdbcAds; -import com.fujitsu.dc.core.model.impl.es.doc.CellDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.EntitySetDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.LinkDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.OEntityDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.UserDataDocHandler; -import com.fujitsu.dc.core.model.impl.es.odata.UserDataODataProducer; +import io.personium.common.ads.AdsWriteFailureLogInfo; +import io.personium.common.es.response.PersoniumSearchHit; +import io.personium.common.es.response.PersoniumSearchResponse; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.Cell; +import io.personium.core.model.impl.es.DavNode; +import io.personium.core.model.impl.es.ads.Ads; +import io.personium.core.model.impl.es.ads.AdsException; +import io.personium.core.model.impl.es.ads.JdbcAds; +import io.personium.core.model.impl.es.doc.CellDocHandler; +import io.personium.core.model.impl.es.doc.EntitySetDocHandler; +import io.personium.core.model.impl.es.doc.LinkDocHandler; +import io.personium.core.model.impl.es.doc.OEntityDocHandler; +import io.personium.core.model.impl.es.doc.UserDataDocHandler; +import io.personium.core.model.impl.es.odata.UserDataODataProducer; /** * データストア層(ADS)への操作処理を実装したクラス. @@ -103,30 +103,30 @@ public static List getIdListOnAds(AdsWriteFailureLogInfo logInfo) th * @throws AdsException AdsException */ public static void createAds(String indexName, String type, - DcSearchResponse esResponse) throws AdsException { + PersoniumSearchResponse esResponse) throws AdsException { // MySQLへデータ登録処理 - DcSearchHit[] dcSearchHit = esResponse.getHits().getHits(); + PersoniumSearchHit[] PersoniumSearchHit = esResponse.getHits().getHits(); try { if (Cell.EDM_TYPE_NAME.equals(type)) { // CELLテーブルに登録 - EntitySetDocHandler oedh = new CellDocHandler(dcSearchHit[0]); + EntitySetDocHandler oedh = new CellDocHandler(PersoniumSearchHit[0]); ads.createCell(indexName, oedh); } else if ("link".equals(type)) { // LINKテーブルに登録 - LinkDocHandler ldh = new LinkDocHandler(dcSearchHit[0]); + LinkDocHandler ldh = new LinkDocHandler(PersoniumSearchHit[0]); ads.createLink(indexName, ldh); } else if ("dav".equals(type)) { // DAV_NODEテーブルに登録 - DavNode davNode = DavNode.createFromJsonString(dcSearchHit[0].getId(), - dcSearchHit[0].sourceAsString()); + DavNode davNode = DavNode.createFromJsonString(PersoniumSearchHit[0].getId(), + PersoniumSearchHit[0].sourceAsString()); ads.createDavNode(indexName, davNode); } else { // ENTITYテーブルに登録 EntitySetDocHandler oedh; if (type.equals(UserDataODataProducer.USER_ODATA_NAMESPACE)) { - oedh = new UserDataDocHandler(dcSearchHit[0]); + oedh = new UserDataDocHandler(PersoniumSearchHit[0]); } else { - oedh = new OEntityDocHandler(dcSearchHit[0]); + oedh = new OEntityDocHandler(PersoniumSearchHit[0]); } if (oedh.getDynamicFields() == null) { @@ -137,7 +137,7 @@ public static void createAds(String indexName, String type, ads.createEntity(indexName, oedh); } - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { throw new AdsException(e); } } @@ -150,30 +150,30 @@ public static void createAds(String indexName, String type, * @throws AdsException AdsException */ public static void updateAds(String indexName, String type, - DcSearchResponse esResponse) throws AdsException { + PersoniumSearchResponse esResponse) throws AdsException { try { // MySQLへデータ更新処理 - DcSearchHit[] dcSearchHit = esResponse.getHits().getHits(); + PersoniumSearchHit[] PersoniumSearchHit = esResponse.getHits().getHits(); if (Cell.EDM_TYPE_NAME.equals(type)) { // CELLテーブルに更新 - EntitySetDocHandler oedh = new CellDocHandler(dcSearchHit[0]); + EntitySetDocHandler oedh = new CellDocHandler(PersoniumSearchHit[0]); ads.updateCell(indexName, oedh); } else if ("link".equals(type)) { // LINKテーブルに更新 - LinkDocHandler ldh = new LinkDocHandler(dcSearchHit[0]); + LinkDocHandler ldh = new LinkDocHandler(PersoniumSearchHit[0]); ads.updateLink(indexName, ldh); } else if ("dav".equals(type)) { // DAV_NODEテーブルに更新 - DavNode davNode = DavNode.createFromJsonString(dcSearchHit[0].getId(), - dcSearchHit[0].sourceAsString()); + DavNode davNode = DavNode.createFromJsonString(PersoniumSearchHit[0].getId(), + PersoniumSearchHit[0].sourceAsString()); ads.updateDavNode(indexName, davNode); } else { // ENTITYテーブルに更新 EntitySetDocHandler oedh; if (type.equals(UserDataODataProducer.USER_ODATA_NAMESPACE)) { - oedh = new UserDataDocHandler(dcSearchHit[0]); + oedh = new UserDataDocHandler(PersoniumSearchHit[0]); } else { - oedh = new OEntityDocHandler(dcSearchHit[0]); + oedh = new OEntityDocHandler(PersoniumSearchHit[0]); } if (oedh.getDynamicFields() == null) { @@ -184,7 +184,7 @@ public static void updateAds(String indexName, String type, ads.updateEntity(indexName, oedh); } - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { throw new AdsException(e); } diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/repair/EsAccessor.java b/src/main/java/io/personium/core/model/impl/es/repair/EsAccessor.java similarity index 84% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/repair/EsAccessor.java rename to src/main/java/io/personium/core/model/impl/es/repair/EsAccessor.java index 069bd0c9a..6456dc96e 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/repair/EsAccessor.java +++ b/src/main/java/io/personium/core/model/impl/es/repair/EsAccessor.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.repair; +package io.personium.core.model.impl.es.repair; import java.util.ArrayList; import java.util.HashMap; @@ -24,12 +24,12 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.es.EsIndex; -import com.fujitsu.dc.common.es.response.DcSearchResponse; -import com.fujitsu.dc.common.es.response.EsClientException; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.model.impl.es.EsModel; -import com.fujitsu.dc.core.model.impl.es.QueryMapFactory; +import io.personium.common.es.EsIndex; +import io.personium.common.es.response.PersoniumSearchResponse; +import io.personium.common.es.response.EsClientException; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.model.impl.es.EsModel; +import io.personium.core.model.impl.es.QueryMapFactory; /** * データストア層(Elasticsearch)への操作処理を実装したクラス. @@ -54,7 +54,7 @@ private EsAccessor() { * @return 検索結果 * @throws EsClientException ESへの検索に失敗した場合 */ - public static DcSearchResponse search(final String indexName, + public static PersoniumSearchResponse search(final String indexName, final String routingId, final List idList, final String type) @@ -95,7 +95,7 @@ public static DcSearchResponse search(final String indexName, */ private static EsIndex getEsIndex(final String indexName) { final String cellIndexName = EsIndex.CATEGORY_AD; - String unitUserName = indexName.replace(DcCoreConfig.getEsUnitPrefix() + "_", ""); + String unitUserName = indexName.replace(PersoniumUnitConfig.getEsUnitPrefix() + "_", ""); if (cellIndexName.equals(unitUserName)) { return EsModel.idxAdmin(); } else { diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/repair/DcRepairAdsException.java b/src/main/java/io/personium/core/model/impl/es/repair/PersoniumRepairAdsException.java similarity index 79% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/repair/DcRepairAdsException.java rename to src/main/java/io/personium/core/model/impl/es/repair/PersoniumRepairAdsException.java index bacee469d..4e7bbbcef 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/repair/DcRepairAdsException.java +++ b/src/main/java/io/personium/core/model/impl/es/repair/PersoniumRepairAdsException.java @@ -14,12 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.repair; +package io.personium.core.model.impl.es.repair; /** * ADSへのデータ補正時にスローする例外. */ -public class DcRepairAdsException extends Exception { +public class PersoniumRepairAdsException extends Exception { /** * デフォルトシリアルバージョンID. @@ -31,7 +31,7 @@ public class DcRepairAdsException extends Exception { * @param msg メッセージ * @param cause 原因となったThrowable */ - public DcRepairAdsException(String msg, Throwable cause) { + public PersoniumRepairAdsException(String msg, Throwable cause) { super(msg, cause); } @@ -39,7 +39,7 @@ public DcRepairAdsException(String msg, Throwable cause) { * コンストラクタ. * @param msg メッセージ */ - public DcRepairAdsException(String msg) { + public PersoniumRepairAdsException(String msg) { super(msg); } diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/repair/RepairAds.java b/src/main/java/io/personium/core/model/impl/es/repair/RepairAds.java similarity index 89% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/repair/RepairAds.java rename to src/main/java/io/personium/core/model/impl/es/repair/RepairAds.java index 167916570..67588e526 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/repair/RepairAds.java +++ b/src/main/java/io/personium/core/model/impl/es/repair/RepairAds.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.repair; +package io.personium.core.model.impl.es.repair; import java.io.File; import java.util.ArrayList; @@ -30,27 +30,27 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.ads.AbstractAdsWriteFailureLog; -import com.fujitsu.dc.common.ads.AdsWriteFailureLogException; -import com.fujitsu.dc.common.ads.AdsWriteFailureLogFilter; -import com.fujitsu.dc.common.ads.AdsWriteFailureLogInfo; -import com.fujitsu.dc.common.ads.AdsWriteFailureLogWriter; -import com.fujitsu.dc.common.ads.RollingAdsWriteFailureLog; -import com.fujitsu.dc.common.es.EsIndex; -import com.fujitsu.dc.common.es.response.DcSearchHits; -import com.fujitsu.dc.common.es.response.DcSearchResponse; -import com.fujitsu.dc.common.es.response.EsClientException; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.impl.es.ads.AdsException; -import com.fujitsu.dc.core.model.lock.Lock; -import com.fujitsu.dc.core.model.lock.LockManager; +import io.personium.common.ads.AbstractAdsWriteFailureLog; +import io.personium.common.ads.AdsWriteFailureLogException; +import io.personium.common.ads.AdsWriteFailureLogFilter; +import io.personium.common.ads.AdsWriteFailureLogInfo; +import io.personium.common.ads.AdsWriteFailureLogWriter; +import io.personium.common.ads.RollingAdsWriteFailureLog; +import io.personium.common.es.EsIndex; +import io.personium.common.es.response.PersoniumSearchHits; +import io.personium.common.es.response.PersoniumSearchResponse; +import io.personium.common.es.response.EsClientException; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.Cell; +import io.personium.core.model.impl.es.ads.AdsException; +import io.personium.core.model.lock.Lock; +import io.personium.core.model.lock.LockManager; /** * ADSへのデータ補正処理を実装したクラス. *

- * 本クラスでは、ADS書き込み失敗ログを読み込み、Elasticsearch上のデータを基準としてADSへのデータ補正を実施する。 データ補正処理は singletonとし、dc1-coreの + * 本クラスでは、ADS書き込み失敗ログを読み込み、Elasticsearch上のデータを基準としてADSへのデータ補正を実施する。 データ補正処理は singletonとし、personium-coreの * ScheduleExecutorServiceにて一定間隔で実行する。 なお、本処理の内容は、PCSのAPIとは異なるため、別ファイルとしてログを出力する。 *

*/ @@ -148,9 +148,9 @@ public void repairAds() { */ private void rotateRetryAndErrorLog() { AdsWriteFailureLogWriter errorlog = AdsWriteFailureLogWriter.getInstanceforError( - adsLogBaseDir.getAbsolutePath(), pcsVersion, DcCoreConfig.getAdsWriteFailureLogPhysicalDelete()); + adsLogBaseDir.getAbsolutePath(), pcsVersion, PersoniumUnitConfig.getAdsWriteFailureLogPhysicalDelete()); AdsWriteFailureLogWriter retrylog = AdsWriteFailureLogWriter.getInstanceforRetry( - adsLogBaseDir.getAbsolutePath(), pcsVersion, DcCoreConfig.getAdsWriteFailureLogPhysicalDelete()); + adsLogBaseDir.getAbsolutePath(), pcsVersion, PersoniumUnitConfig.getAdsWriteFailureLogPhysicalDelete()); // エラー用ADS書き込み失敗ログをローテートする try { if (errorlog.isExistsAdsWriteFailureLogs()) { @@ -173,11 +173,11 @@ private void rotateRetryAndErrorLog() { * プロパティ情報を読み込む. */ private void readProperties() { - pcsVersion = DcCoreConfig.getCoreVersion(); - adsLogBaseDirPath = DcCoreConfig.getAdsWriteFailureLogDir(); + pcsVersion = PersoniumUnitConfig.getCoreVersion(); + adsLogBaseDirPath = PersoniumUnitConfig.getAdsWriteFailureLogDir(); adsLogBaseDir = new File(adsLogBaseDirPath); - physicalDelete = DcCoreConfig.getAdsWriteFailureLogPhysicalDelete(); - logCountPerIteration = DcCoreConfig.getAdsWriteFailureLogCountPerIteration(); + physicalDelete = PersoniumUnitConfig.getAdsWriteFailureLogPhysicalDelete(); + logCountPerIteration = PersoniumUnitConfig.getAdsWriteFailureLogCountPerIteration(); } /** @@ -369,9 +369,9 @@ private void executeRepairAds(List logInfos) throws Repa if (null != lockKey && !lockKey.isEmpty()) { try { lock = lock(lockKey); - } catch (DcCoreException e) { - if (e.getCode().equals(DcCoreException.Server.GET_LOCK_STATE_ERROR.getCode()) - || e.getCode().equals(DcCoreException.Server.DATA_STORE_UNKNOWN_ERROR.getCode())) { + } catch (PersoniumCoreException e) { + if (e.getCode().equals(PersoniumCoreException.Server.GET_LOCK_STATE_ERROR.getCode()) + || e.getCode().equals(PersoniumCoreException.Server.DATA_STORE_UNKNOWN_ERROR.getCode())) { // 全体を異常終了させる throw e; } else { @@ -395,10 +395,10 @@ private void executeRepairAds(List logInfos) throws Repa try { // TypeがCellである場合は、Elasticsearchのインデックス名を「{UnitPrefix}_ad」に変更する if (Cell.EDM_TYPE_NAME.equals(logInfo.getType())) { - indexName = DcCoreConfig.getEsUnitPrefix() + "_" + EsIndex.CATEGORY_AD; + indexName = PersoniumUnitConfig.getEsUnitPrefix() + "_" + EsIndex.CATEGORY_AD; } // ES/ADSへの検索は、一括検索ができるようなAPIを使用しているが、今のところは1件ずつ処理することを前提としている。 - DcSearchResponse esResponse = EsAccessor.search(indexName, routingId, idList, logInfo.getType()); + PersoniumSearchResponse esResponse = EsAccessor.search(indexName, routingId, idList, logInfo.getType()); List adsResponse = AdsAccessor.getIdListOnAds(logInfo); repairToAds(logInfo, esResponse, adsResponse); } catch (EsClientException e) { @@ -449,17 +449,17 @@ private Lock lock(String lockKey) { * @param logInfo ログから読み込んだADS書き込み失敗情報 * @param esResponse Elasticsearchにリペア対象のデータを検索した結果 * @param adsResponse ADSにリペア対象のデータを検索した結果 - * @throws RepairAdsException DcRepairAdsException + * @throws RepairAdsException RepairAdsException */ public void repairToAds( AdsWriteFailureLogInfo logInfo, - DcSearchResponse esResponse, + PersoniumSearchResponse esResponse, List adsResponse) throws RepairAdsException { // 検索結果として、2件以上がヒットした場合は異常事態とみなし、エラーとする。 // (現状は、1件ずつ処理しているため、このチェックがある。n件ずつ処理する場合は、n件ヒットで確認する) // TODO 件数の数値は、フィールドに追い出す。 - DcSearchHits hits = esResponse.getHits(); + PersoniumSearchHits hits = esResponse.getHits(); if (hits.getAllPages() > 1) { String message = String.format("Unexpected number of data returned from Elasticsearch. [%d]", hits.getAllPages()); @@ -499,7 +499,7 @@ public void repairToAds( logger.info("No operation performed for repair log recordID : " + repairId); } } catch (AdsException e) { - if (e.getCause() instanceof DcCoreException) { + if (e.getCause() instanceof PersoniumCoreException) { // 該当行を不正ログファイルに退避する // MySQLへのリペア用データの作成に失敗した場合(Elasticsearchから取得したデータのパースに失敗) writeAdsErrorLog(logInfo.toString()); @@ -522,7 +522,7 @@ private boolean isRepairCompleted() throws RepairAdsException { AdsWriteFailureLogWriter writer = AdsWriteFailureLogWriter.getInstance( this.adsLogBaseDir.getAbsolutePath(), this.pcsVersion, - DcCoreConfig.getAdsWriteFailureLogPhysicalDelete()); + PersoniumUnitConfig.getAdsWriteFailureLogPhysicalDelete()); Map logFilesMap = collectAdsWriteFailureLogFiles(); if (logFilesMap.isEmpty() && !writer.isExistsAdsWriteFailureLogs() && !existsErrorLog() && !existsActiveLog()) { @@ -538,7 +538,7 @@ private boolean isRepairCompleted() throws RepairAdsException { private void writeAdsRetryLog(String logInfo) { AdsWriteFailureLogWriter retryLog = AdsWriteFailureLogWriter.getInstanceforRetry( adsLogBaseDir.getPath(), pcsVersion, - DcCoreConfig.getAdsWriteFailureLogPhysicalDelete()); + PersoniumUnitConfig.getAdsWriteFailureLogPhysicalDelete()); try { retryLog.openActiveFile(createTime); retryLog.writeActiveFile(logInfo); @@ -554,7 +554,7 @@ private void writeAdsRetryLog(String logInfo) { private void writeAdsErrorLog(String logInfo) { AdsWriteFailureLogWriter errorLog = AdsWriteFailureLogWriter.getInstanceforError( adsLogBaseDir.getPath(), pcsVersion, - DcCoreConfig.getAdsWriteFailureLogPhysicalDelete()); + PersoniumUnitConfig.getAdsWriteFailureLogPhysicalDelete()); try { errorLog.openActiveFile(createTime); errorLog.writeActiveFile(logInfo); diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/repair/RepairAdsException.java b/src/main/java/io/personium/core/model/impl/es/repair/RepairAdsException.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/repair/RepairAdsException.java rename to src/main/java/io/personium/core/model/impl/es/repair/RepairAdsException.java index 42ca2f7fe..c41e440b0 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/repair/RepairAdsException.java +++ b/src/main/java/io/personium/core/model/impl/es/repair/RepairAdsException.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.repair; +package io.personium.core.model.impl.es.repair; /** * ADSへのデータ補正時にスローする例外. diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/es/repair/package-info.java b/src/main/java/io/personium/core/model/impl/es/repair/package-info.java similarity index 90% rename from src/main/java/com/fujitsu/dc/core/model/impl/es/repair/package-info.java rename to src/main/java/io/personium/core/model/impl/es/repair/package-info.java index 074687482..5a6b6f1e4 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/es/repair/package-info.java +++ b/src/main/java/io/personium/core/model/impl/es/repair/package-info.java @@ -17,5 +17,5 @@ /** * ADSへのデータ補正処理を実装したクラス群. */ -package com.fujitsu.dc.core.model.impl.es.repair; +package io.personium.core.model.impl.es.repair; diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/fs/BoxCmpFsImpl.java b/src/main/java/io/personium/core/model/impl/fs/BoxCmpFsImpl.java similarity index 82% rename from src/main/java/com/fujitsu/dc/core/model/impl/fs/BoxCmpFsImpl.java rename to src/main/java/io/personium/core/model/impl/fs/BoxCmpFsImpl.java index 3b3f8ca8a..a293c8eca 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/fs/BoxCmpFsImpl.java +++ b/src/main/java/io/personium/core/model/impl/fs/BoxCmpFsImpl.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.fs; +package io.personium.core.model.impl.fs; import java.io.File; @@ -22,11 +22,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.BoxCmp; -import com.fujitsu.dc.core.model.DavCmp; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.Box; +import io.personium.core.model.BoxCmp; +import io.personium.core.model.DavCmp; /** * A component class for DAV nature of a Box using FileSystem. @@ -46,7 +46,7 @@ public BoxCmpFsImpl(final Box box) { this.of = new ObjectFactory(); this.box = box; this.cell = box.getCell(); - StringBuilder path = new StringBuilder(DcCoreConfig.getBlobStoreRoot()); + StringBuilder path = new StringBuilder(PersoniumUnitConfig.getBlobStoreRoot()); path.append(File.separatorChar); path.append(this.getCell().getDataBundleName()); path.append(File.separatorChar); @@ -79,8 +79,8 @@ public String getId() { } @Override - public DcCoreException getNotFoundException() { - return DcCoreException.Dav.BOX_NOT_FOUND; + public PersoniumCoreException getNotFoundException() { + return PersoniumCoreException.Dav.BOX_NOT_FOUND; } @Override diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/fs/CellCmpFsImpl.java b/src/main/java/io/personium/core/model/impl/fs/CellCmpFsImpl.java similarity index 82% rename from src/main/java/com/fujitsu/dc/core/model/impl/fs/CellCmpFsImpl.java rename to src/main/java/io/personium/core/model/impl/fs/CellCmpFsImpl.java index ce5bc1c10..43cf0028f 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/fs/CellCmpFsImpl.java +++ b/src/main/java/io/personium/core/model/impl/fs/CellCmpFsImpl.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.fs; +package io.personium.core.model.impl.fs; @@ -26,13 +26,13 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.CellCmp; -import com.fujitsu.dc.core.model.DavCmp; -import com.fujitsu.dc.core.model.lock.Lock; -import com.fujitsu.dc.core.model.lock.LockManager; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.Cell; +import io.personium.core.model.CellCmp; +import io.personium.core.model.DavCmp; +import io.personium.core.model.lock.Lock; +import io.personium.core.model.lock.LockManager; /** * A component class for DAV nature of a Cell using FileSystem. @@ -49,7 +49,7 @@ public class CellCmpFsImpl extends DavCmpFsImpl implements CellCmp { public CellCmpFsImpl(final Cell cell) { this.of = new ObjectFactory(); this.cell = cell; - StringBuilder path = new StringBuilder(DcCoreConfig.getBlobStoreRoot()); + StringBuilder path = new StringBuilder(PersoniumUnitConfig.getBlobStoreRoot()); path.append(File.separatorChar); path.append(this.getCell().getDataBundleName()); path.append(File.separator); @@ -110,7 +110,7 @@ public Lock lock() { } @Override - public DcCoreException getNotFoundException() { - return DcCoreException.Dav.CELL_NOT_FOUND; + public PersoniumCoreException getNotFoundException() { + return PersoniumCoreException.Dav.CELL_NOT_FOUND; } } diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/fs/DavCmpFsImpl.java b/src/main/java/io/personium/core/model/impl/fs/DavCmpFsImpl.java similarity index 90% rename from src/main/java/com/fujitsu/dc/core/model/impl/fs/DavCmpFsImpl.java rename to src/main/java/io/personium/core/model/impl/fs/DavCmpFsImpl.java index 27246cc01..cf669cd35 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/fs/DavCmpFsImpl.java +++ b/src/main/java/io/personium/core/model/impl/fs/DavCmpFsImpl.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.fs; +package io.personium.core.model.impl.fs; import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; @@ -59,36 +59,36 @@ import org.w3c.dom.Element; import org.w3c.dom.NodeList; -import com.fujitsu.dc.common.auth.token.Role; -import com.fujitsu.dc.common.es.util.IndexNameEncoder; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.DcCoreLog; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.auth.BoxPrivilege; -import com.fujitsu.dc.core.auth.OAuth2Helper.Key; -import com.fujitsu.dc.core.http.header.ByteRangeSpec; -import com.fujitsu.dc.core.http.header.RangeHeaderHandler; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.DavCmp; -import com.fujitsu.dc.core.model.DavDestination; -import com.fujitsu.dc.core.model.ModelFactory; -import com.fujitsu.dc.core.model.ctl.ComplexType; -import com.fujitsu.dc.core.model.ctl.EntityType; -import com.fujitsu.dc.core.model.file.BinaryDataAccessor; -import com.fujitsu.dc.core.model.file.BinaryDataNotFoundException; -import com.fujitsu.dc.core.model.file.StreamingOutputForDavFile; -import com.fujitsu.dc.core.model.file.StreamingOutputForDavFileWithRange; -import com.fujitsu.dc.core.model.impl.es.odata.UserSchemaODataProducer; -import com.fujitsu.dc.core.model.jaxb.Ace; -import com.fujitsu.dc.core.model.jaxb.Acl; -import com.fujitsu.dc.core.model.jaxb.ObjectIo; -import com.fujitsu.dc.core.model.lock.Lock; -import com.fujitsu.dc.core.model.lock.LockKeyComposer; -import com.fujitsu.dc.core.model.lock.LockManager; -import com.fujitsu.dc.core.odata.DcODataProducer; +import io.personium.common.auth.token.Role; +import io.personium.common.es.util.IndexNameEncoder; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.PersoniumCoreLog; +import io.personium.core.auth.AccessContext; +import io.personium.core.auth.BoxPrivilege; +import io.personium.core.auth.OAuth2Helper.Key; +import io.personium.core.http.header.ByteRangeSpec; +import io.personium.core.http.header.RangeHeaderHandler; +import io.personium.core.model.Box; +import io.personium.core.model.Cell; +import io.personium.core.model.DavCmp; +import io.personium.core.model.DavDestination; +import io.personium.core.model.ModelFactory; +import io.personium.core.model.ctl.ComplexType; +import io.personium.core.model.ctl.EntityType; +import io.personium.core.model.file.BinaryDataAccessor; +import io.personium.core.model.file.BinaryDataNotFoundException; +import io.personium.core.model.file.StreamingOutputForDavFile; +import io.personium.core.model.file.StreamingOutputForDavFileWithRange; +import io.personium.core.model.impl.es.odata.UserSchemaODataProducer; +import io.personium.core.model.jaxb.Ace; +import io.personium.core.model.jaxb.Acl; +import io.personium.core.model.jaxb.ObjectIo; +import io.personium.core.model.lock.Lock; +import io.personium.core.model.lock.LockKeyComposer; +import io.personium.core.model.lock.LockManager; +import io.personium.core.odata.PersoniumODataProducer; /** * DavCmp implementation using FileSystem. @@ -222,8 +222,8 @@ public boolean isEmpty() { } return !(svcSourceCol.getChildrenCount() > 0); } - DcCoreLog.Misc.UNREACHABLE_CODE_ERROR.writeLog(); - throw DcCoreException.Server.UNKNOWN_ERROR; + PersoniumCoreLog.Misc.UNREACHABLE_CODE_ERROR.writeLog(); + throw PersoniumCoreException.Server.UNKNOWN_ERROR; } @Override @@ -352,7 +352,7 @@ public final void loadAndCheckDavInconsistency() { load(); if (this.metaFile == null) { // Boxから辿ってidで検索して、Davデータに不整合があった場合 - throw DcCoreException.Dav.DAV_INCONSISTENCY_FOUND; + throw PersoniumCoreException.Dav.DAV_INCONSISTENCY_FOUND; } } @@ -367,7 +367,7 @@ private Element parseProp(String value) { ByteArrayInputStream is = new ByteArrayInputStream(value.getBytes(CharEncoding.UTF_8)); doc = builder.parse(is); } catch (Exception e1) { - throw DcCoreException.Dav.DAV_INCONSISTENCY_FOUND.reason(e1); + throw PersoniumCoreException.Dav.DAV_INCONSISTENCY_FOUND.reason(e1); } Element e = doc.getDocumentElement(); return e; @@ -403,13 +403,13 @@ public Multistatus proppatch(final Propertyupdate propUpdate, final String url) for (Prop prop : propsToSet) { if (null == prop) { - throw DcCoreException.Dav.XML_CONTENT_ERROR; + throw PersoniumCoreException.Dav.XML_CONTENT_ERROR; } List lpe = prop.getAny(); for (Element elem : lpe) { res.setProperty(elem, HttpStatus.SC_OK); String key = elem.getLocalName() + "@" + elem.getNamespaceURI(); - String value = DcCoreUtils.nodeToString(elem); + String value = PersoniumCoreUtils.nodeToString(elem); log.debug("key: " + key); log.debug("val: " + value); propsJson.put(key, value); @@ -419,7 +419,7 @@ public Multistatus proppatch(final Propertyupdate propUpdate, final String url) List propsToRemove = propUpdate.getPropsToRemove(); for (Prop prop : propsToRemove) { if (null == prop) { - throw DcCoreException.Dav.XML_CONTENT_ERROR; + throw PersoniumCoreException.Dav.XML_CONTENT_ERROR; } List lpe = prop.getAny(); for (Element elem : lpe) { @@ -453,10 +453,10 @@ public final ResponseBuilder acl(final Reader reader) { try { aclToSet = ObjectIo.unmarshal(reader, Acl.class); } catch (Exception e1) { - throw DcCoreException.Dav.XML_CONTENT_ERROR.reason(e1); + throw PersoniumCoreException.Dav.XML_CONTENT_ERROR.reason(e1); } if (!aclToSet.validateAcl(isCellLevel())) { - throw DcCoreException.Dav.XML_VALIDATE_ERROR; + throw PersoniumCoreException.Dav.XML_VALIDATE_ERROR; } // ロック Lock lock = this.lock(); @@ -487,7 +487,7 @@ public final ResponseBuilder acl(final Reader reader) { try { aclJson = (JSONObject) parser.parse(aclToSet.toJSON()); } catch (ParseException e) { - throw DcCoreException.Dav.XML_ERROR.reason(e); + throw PersoniumCoreException.Dav.XML_ERROR.reason(e); } // ESへxm:baseの値を登録しない TODO これでいいのか? aclJson.remove(KEY_ACL_BASE); @@ -510,7 +510,7 @@ public final ResponseBuilder putForCreate(final String contentType, final InputS // 親DavNodeが存在するが、作成対象のDavNodeが存在する場合:他のリクエストによって作成されたたtめ、更新処理を実行 this.parent.load(); if (!this.parent.exists()) { - throw DcCoreException.Dav.HAS_NOT_PARENT.params(this.parent.getUrl()); + throw PersoniumCoreException.Dav.HAS_NOT_PARENT.params(this.parent.getUrl()); } // 作成対象のDavNodeが存在する場合は更新処理 @@ -573,7 +573,7 @@ final ResponseBuilder doPutForCreate(final String contentType, final InputStream this.metaFile.setContentLength(writtenBytes); this.metaFile.save(); } catch (IOException ex) { - throw DcCoreException.Dav.FS_INCONSISTENCY_FOUND.reason(ex); + throw PersoniumCoreException.Dav.FS_INCONSISTENCY_FOUND.reason(ex); } this.isPhantom = false; return javax.ws.rs.core.Response.ok().status(HttpStatus.SC_CREATED).header(HttpHeaders.ETAG, this.getEtag()); @@ -594,7 +594,7 @@ final ResponseBuilder doPutForUpdate(final String contentType, final InputStream // 指定etagがあり、かつそれが*ではなく内部データから導出されるものと異なるときはエラー if (etag != null && !"*".equals(etag) && !this.getEtag().equals(etag)) { - throw DcCoreException.Dav.ETAG_NOT_MATCH; + throw PersoniumCoreException.Dav.ETAG_NOT_MATCH; } try { @@ -613,7 +613,7 @@ final ResponseBuilder doPutForUpdate(final String contentType, final InputStream this.metaFile.setContentLength(contentFile.length()); this.metaFile.save(); } catch (IOException ex) { - throw DcCoreException.Dav.FS_INCONSISTENCY_FOUND.reason(ex); + throw PersoniumCoreException.Dav.FS_INCONSISTENCY_FOUND.reason(ex); } // response @@ -644,19 +644,19 @@ public final ResponseBuilder get(final String rangeHeaderField) { // Rangeヘッダの範囲チェック if (!range.isSatisfiable()) { - DcCoreLog.Dav.REQUESTED_RANGE_NOT_SATISFIABLE.params(range.getRangeHeaderField()).writeLog(); - throw DcCoreException.Dav.REQUESTED_RANGE_NOT_SATISFIABLE; + PersoniumCoreLog.Dav.REQUESTED_RANGE_NOT_SATISFIABLE.params(range.getRangeHeaderField()).writeLog(); + throw PersoniumCoreException.Dav.REQUESTED_RANGE_NOT_SATISFIABLE; } if (range.getByteRangeSpecCount() > 1) { // MultiPartレスポンスには未対応 - throw DcCoreException.Misc.NOT_IMPLEMENTED.params("Range-MultiPart"); + throw PersoniumCoreException.Misc.NOT_IMPLEMENTED.params("Range-MultiPart"); } else { StreamingOutput sout = new StreamingOutputForDavFileWithRange(fileFullPath, fileSize, range); res = davFileResponseForRange(sout, fileSize, contentType, range); } } - return res.header(HttpHeaders.ETAG, this.getEtag()).header(DcCoreUtils.HttpHeaders.ACCEPT_RANGES, + return res.header(HttpHeaders.ETAG, this.getEtag()).header(PersoniumCoreUtils.HttpHeaders.ACCEPT_RANGES, RangeHeaderHandler.BYTES_UNIT); } catch (BinaryDataNotFoundException nex) { @@ -664,7 +664,7 @@ public final ResponseBuilder get(final String rangeHeaderField) { if (!this.exists()) { throw getNotFoundException().params(this.getUrl()); } - throw DcCoreException.Dav.DAV_UNAVAILABLE.reason(nex); + throw PersoniumCoreException.Dav.DAV_UNAVAILABLE.reason(nex); } } @@ -704,7 +704,7 @@ private ResponseBuilder davFileResponseForRange(final StreamingOutput sout, long // iPadのsafariにおいてChunkedのRangeレスポンスを処理できなかったので明にContent-Lengthを返却している。 return javax.ws.rs.core.Response.status(HttpStatus.SC_PARTIAL_CONTENT).entity(sout) - .header(DcCoreUtils.HttpHeaders.CONTENT_RANGE, brs.makeContentRangeHeaderField()) + .header(PersoniumCoreUtils.HttpHeaders.CONTENT_RANGE, brs.makeContentRangeHeaderField()) .header(HttpHeaders.CONTENT_LENGTH, brs.getContentLength()) .header(HttpHeaders.CONTENT_TYPE, contentType); } @@ -751,25 +751,25 @@ public final ResponseBuilder mkcol(final String type) { if (!this.parent.exists()) { // クリティカルなタイミングで先に親を削除されてしまい、 // 親が存在しないので409エラーとする - throw DcCoreException.Dav.HAS_NOT_PARENT.params(this.parent.getUrl()); + throw PersoniumCoreException.Dav.HAS_NOT_PARENT.params(this.parent.getUrl()); } if (this.exists()) { // クリティカルなタイミングで先にコレクションを作られてしまい、 // すでに存在するのでEXCEPTION - throw DcCoreException.Dav.METHOD_NOT_ALLOWED; + throw PersoniumCoreException.Dav.METHOD_NOT_ALLOWED; } // コレクションの階層数のチェック DavCmpFsImpl current = this; int depth = 0; - int maxDepth = DcCoreConfig.getMaxCollectionDepth(); + int maxDepth = PersoniumUnitConfig.getMaxCollectionDepth(); while (null != current.parent) { current = current.parent; depth++; } if (depth > maxDepth) { // コレクション数の制限を超えたため、400エラーとする - throw DcCoreException.Dav.COLLECTION_DEPTH_ERROR; + throw PersoniumCoreException.Dav.COLLECTION_DEPTH_ERROR; } // 親コレクション内のコレクション・ファイル数のチェック @@ -822,7 +822,7 @@ public ResponseBuilder move(String etag, String overwrite, DavDestination davDes } // 指定etagがあり、かつそれが*ではなく内部データから導出されるものと異なるときはエラー if (etag != null && !"*".equals(etag) && !this.getEtag().equals(etag)) { - throw DcCoreException.Dav.ETAG_NOT_MATCH; + throw PersoniumCoreException.Dav.ETAG_NOT_MATCH; } // 移動元のDavNodeをリロードしたことにより親DavNodeが別のリソースに切り替わっている可能性があるため、リロードする。 @@ -873,10 +873,10 @@ public ResponseBuilder move(String etag, String overwrite, DavDestination davDes private void checkChildResourceCount() { // 親コレクション内のコレクション・ファイル数のチェック - int maxChildResource = DcCoreConfig.getMaxChildResourceCount(); + int maxChildResource = PersoniumUnitConfig.getMaxChildResourceCount(); if (this.parent.getChildrenCount() >= maxChildResource) { // コレクション内に作成可能なコレクション・ファイル数の制限を超えたため、400エラーとする - throw DcCoreException.Dav.COLLECTION_CHILDRESOURCE_ERROR; + throw PersoniumCoreException.Dav.COLLECTION_CHILDRESOURCE_ERROR; } } @@ -900,7 +900,7 @@ public final ResponseBuilder unlinkChild(final String childName, final Long asof public final ResponseBuilder delete(final String ifMatch, boolean recursive) { // 指定etagがあり、かつそれが*ではなく内部データから導出されるものと異なるときはエラー if (ifMatch != null && !"*".equals(ifMatch) && !this.getEtag().equals(ifMatch)) { - throw DcCoreException.Dav.ETAG_NOT_MATCH; + throw PersoniumCoreException.Dav.ETAG_NOT_MATCH; } // ロック Lock lock = this.lock(); @@ -913,11 +913,11 @@ public final ResponseBuilder delete(final String ifMatch, boolean recursive) { if (!recursive) { // WebDAVコレクションであって子孫リソースがあったら、エラーとする if (TYPE_COL_WEBDAV.equals(this.getType()) && this.getChildrenCount() > 0) { - throw DcCoreException.Dav.HAS_CHILDREN; + throw PersoniumCoreException.Dav.HAS_CHILDREN; } } else { // TODO impl recursive - throw DcCoreException.Misc.NOT_IMPLEMENTED; + throw PersoniumCoreException.Misc.NOT_IMPLEMENTED; } this.doDelete(); } finally { @@ -932,7 +932,7 @@ private void doDelete() { try { FileUtils.deleteDirectory(this.fsDir); } catch (IOException e) { - throw DcCoreException.Dav.FS_INCONSISTENCY_FOUND.reason(e); + throw PersoniumCoreException.Dav.FS_INCONSISTENCY_FOUND.reason(e); } } @@ -949,8 +949,8 @@ protected BinaryDataAccessor getBinaryDataAccessor() { unitUserName = IndexNameEncoder.encodeEsIndexName(owner); } - return new BinaryDataAccessor(DcCoreConfig.getBlobStoreRoot(), unitUserName, - DcCoreConfig.getPhysicalDeleteMode(), DcCoreConfig.getFsyncEnabled()); + return new BinaryDataAccessor(PersoniumUnitConfig.getBlobStoreRoot(), unitUserName, + PersoniumUnitConfig.getPhysicalDeleteMode(), PersoniumUnitConfig.getFsyncEnabled()); } @Override @@ -959,12 +959,12 @@ public final DavCmp getParent() { } @Override - public final DcODataProducer getODataProducer() { + public final PersoniumODataProducer getODataProducer() { return ModelFactory.ODataCtl.userData(this.cell, this); } @Override - public final DcODataProducer getSchemaODataProducer(Cell cellObject) { + public final PersoniumODataProducer getSchemaODataProducer(Cell cellObject) { return ModelFactory.ODataCtl.userSchema(cellObject, this); } @@ -1083,7 +1083,7 @@ private String baseUrlToRoleResourceUrl(String baseUrlStr, String roloResourceUr baseUrl = new Role(new URL(baseUrlStr + "__")); roloResourceUrl = new Role(new URL(roloResourceUrlStr)); } catch (MalformedURLException e) { - throw DcCoreException.Dav.ROLE_NOT_FOUND.reason(e); + throw PersoniumCoreException.Dav.ROLE_NOT_FOUND.reason(e); } if (baseUrl.getBoxName().equals(roloResourceUrl.getBoxName())) { // base:xmlのBOXとロールリソースURLのBOXが同じ場合 @@ -1112,7 +1112,7 @@ public String getCellId() { public DavMetadataFile getDavMetadataFile() { return this.metaFile; } - + /** * @return FsPath */ @@ -1144,8 +1144,8 @@ public String getUrl() { * Additional info (reason etc.) for the message should be set after calling this method. * @return NotFoundException */ - public DcCoreException getNotFoundException() { - return DcCoreException.Dav.RESOURCE_NOT_FOUND; + public PersoniumCoreException getNotFoundException() { + return PersoniumCoreException.Dav.RESOURCE_NOT_FOUND; } @Override diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/fs/DavMetadataFile.java b/src/main/java/io/personium/core/model/impl/fs/DavMetadataFile.java similarity index 96% rename from src/main/java/com/fujitsu/dc/core/model/impl/fs/DavMetadataFile.java rename to src/main/java/io/personium/core/model/impl/fs/DavMetadataFile.java index f98b5e040..218f47d78 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/fs/DavMetadataFile.java +++ b/src/main/java/io/personium/core/model/impl/fs/DavMetadataFile.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.fs; +package io.personium.core.model.impl.fs; import java.io.File; import java.io.IOException; @@ -27,8 +27,8 @@ import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; -import com.fujitsu.dc.common.es.util.DcUUID; -import com.fujitsu.dc.core.DcCoreException; +import io.personium.common.es.util.PersoniumUUID; +import io.personium.core.PersoniumCoreException; /** * a class for handling internal fs file storing Dav metadata. @@ -77,7 +77,7 @@ private DavMetadataFile(File file) { private void setDefault() { long date = new Date().getTime(); - this.setNodeId(DcUUID.randomUUID()); + this.setNodeId(PersoniumUUID.randomUUID()); this.setUpdated(date); this.setPublished(date); this.setVersion(0L); @@ -136,7 +136,7 @@ public void load() { this.json = (JSONObject) parser.parse(reader); } catch (IOException | ParseException e) { // IO failure or JSON is broken - throw DcCoreException.Dav.DAV_INCONSISTENCY_FOUND.reason(e); + throw PersoniumCoreException.Dav.DAV_INCONSISTENCY_FOUND.reason(e); } } diff --git a/src/main/java/com/fujitsu/dc/core/model/impl/fs/package-info.java b/src/main/java/io/personium/core/model/impl/fs/package-info.java similarity index 93% rename from src/main/java/com/fujitsu/dc/core/model/impl/fs/package-info.java rename to src/main/java/io/personium/core/model/impl/fs/package-info.java index 216c19830..12e182f6d 100644 --- a/src/main/java/com/fujitsu/dc/core/model/impl/fs/package-info.java +++ b/src/main/java/io/personium/core/model/impl/fs/package-info.java @@ -14,4 +14,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.fs; +package io.personium.core.model.impl.fs; diff --git a/src/main/java/com/fujitsu/dc/core/model/jaxb/Ace.java b/src/main/java/io/personium/core/model/jaxb/Ace.java similarity index 94% rename from src/main/java/com/fujitsu/dc/core/model/jaxb/Ace.java rename to src/main/java/io/personium/core/model/jaxb/Ace.java index eab893276..d3799ccb8 100644 --- a/src/main/java/com/fujitsu/dc/core/model/jaxb/Ace.java +++ b/src/main/java/io/personium/core/model/jaxb/Ace.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.jaxb; +package io.personium.core.model.jaxb; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/com/fujitsu/dc/core/model/jaxb/Acl.java b/src/main/java/io/personium/core/model/jaxb/Acl.java similarity index 83% rename from src/main/java/com/fujitsu/dc/core/model/jaxb/Acl.java rename to src/main/java/io/personium/core/model/jaxb/Acl.java index fee82b514..2e6d7c9e2 100644 --- a/src/main/java/com/fujitsu/dc/core/model/jaxb/Acl.java +++ b/src/main/java/io/personium/core/model/jaxb/Acl.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.jaxb; +package io.personium.core.model.jaxb; import java.io.IOException; import java.io.StringReader; @@ -35,13 +35,13 @@ import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; -import com.fujitsu.dc.common.auth.token.Role; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.auth.BoxPrivilege; -import com.fujitsu.dc.core.auth.CellPrivilege; -import com.fujitsu.dc.core.auth.Privilege; +import io.personium.common.auth.token.Role; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.auth.AccessContext; +import io.personium.core.auth.BoxPrivilege; +import io.personium.core.auth.CellPrivilege; +import io.personium.core.auth.Privilege; /** * ACLを表すモデルオブジェクト. @@ -63,13 +63,13 @@ public final class Acl { String base; /** - * dc:requireSchemaAuthz. + * p:requireSchemaAuthz. */ - @XmlAttribute(namespace = DcCoreUtils.XmlConst.NS_DC1) + @XmlAttribute(namespace = PersoniumCoreUtils.XmlConst.NS_PERSONIUM) String requireSchemaAuthz; /** - * dc:requireSchemaAuthz setter. + * p:requireSchemaAuthz setter. * @param requireSchemaAuthz requireSchemaAuthz */ public void setRequireSchemaAuthz(String requireSchemaAuthz) { @@ -77,7 +77,7 @@ public void setRequireSchemaAuthz(String requireSchemaAuthz) { } /** - * dc:requireSchemaAuthz getter. + * p:requireSchemaAuthz getter. * @return requireSchemaAuthz */ public String getRequireSchemaAuthz() { @@ -122,9 +122,9 @@ public String toJSON() { ObjectIo.toJson(this, sw); return sw.toString(); } catch (IOException e) { - throw DcCoreException.Server.DATA_STORE_UNKNOWN_ERROR.reason(e); + throw PersoniumCoreException.Server.DATA_STORE_UNKNOWN_ERROR.reason(e); } catch (JAXBException e) { - throw DcCoreException.Server.DATA_STORE_UNKNOWN_ERROR.reason(e); + throw PersoniumCoreException.Server.DATA_STORE_UNKNOWN_ERROR.reason(e); } } static final String KEY_REQUIRE_SCHEMA_AUTHZ = "@requireSchemaAuthz"; @@ -143,11 +143,11 @@ public static Acl fromJson(final String jsonString) { ret.setRequireSchemaAuthz((String) j.get(KEY_REQUIRE_SCHEMA_AUTHZ)); return ret; } catch (IOException e) { - throw DcCoreException.Server.DATA_STORE_UNKNOWN_ERROR.reason(e); + throw PersoniumCoreException.Server.DATA_STORE_UNKNOWN_ERROR.reason(e); } catch (JAXBException e) { - throw DcCoreException.Server.DATA_STORE_UNKNOWN_ERROR.reason(e); + throw PersoniumCoreException.Server.DATA_STORE_UNKNOWN_ERROR.reason(e); } catch (ParseException e) { - throw DcCoreException.Server.DATA_STORE_UNKNOWN_ERROR.reason(e); + throw PersoniumCoreException.Server.DATA_STORE_UNKNOWN_ERROR.reason(e); } } @@ -213,14 +213,15 @@ public boolean validateAcl(boolean isCellLevel) { Map cellPrivilegeMap = CellPrivilege.getPrivilegeMap(); Map boxPrivilegeMap = BoxPrivilege.getPrivilegeMap(); - for (com.fujitsu.dc.core.model.jaxb.Privilege privilege : ace.grant.privileges) { + for (io.personium.core.model.jaxb.Privilege privilege : ace.grant.privileges) { // privilegeが空でないこと if (privilege.body == null) { return false; } // Privilegeに設定可能なタグであるかチェック if (isCellLevel) { - if (!cellPrivilegeMap.containsKey(privilege.body.getLocalName())) { + if (!cellPrivilegeMap.containsKey(privilege.body.getLocalName()) + && !boxPrivilegeMap.containsKey(privilege.body.getLocalName())) { return false; } } else { diff --git a/src/main/java/com/fujitsu/dc/core/model/jaxb/Grant.java b/src/main/java/io/personium/core/model/jaxb/Grant.java similarity index 93% rename from src/main/java/com/fujitsu/dc/core/model/jaxb/Grant.java rename to src/main/java/io/personium/core/model/jaxb/Grant.java index 3b99b402f..94d53c872 100644 --- a/src/main/java/com/fujitsu/dc/core/model/jaxb/Grant.java +++ b/src/main/java/io/personium/core/model/jaxb/Grant.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.jaxb; +package io.personium.core.model.jaxb; import java.util.List; diff --git a/src/main/java/com/fujitsu/dc/core/model/jaxb/Mkcol.java b/src/main/java/io/personium/core/model/jaxb/Mkcol.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/model/jaxb/Mkcol.java rename to src/main/java/io/personium/core/model/jaxb/Mkcol.java index 55ee5d2ea..77dcb38d7 100644 --- a/src/main/java/com/fujitsu/dc/core/model/jaxb/Mkcol.java +++ b/src/main/java/io/personium/core/model/jaxb/Mkcol.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.jaxb; +package io.personium.core.model.jaxb; import java.util.ArrayList; import java.util.List; @@ -31,7 +31,7 @@ import org.apache.wink.webdav.model.Set; import org.w3c.dom.Element; -import com.fujitsu.dc.core.model.DavCmp; +import io.personium.core.model.DavCmp; /** * mkcol タグに対応するJAXBオブジェクト. @@ -81,7 +81,7 @@ public Resourcetype getResourcetype() { * @return ColType文字列 * @throws RequestException 例外 */ - public String getDcColType() throws RequestException { + public String getWebdavColType() throws RequestException { Resourcetype rt = this.getResourcetype(); if (rt == null) { throw new RequestException("resourcetype should be defined in mkcol request, See RFC5689 : extended MKCOL"); @@ -101,7 +101,7 @@ public String getDcColType() throws RequestException { String localName = e.getLocalName(); String nsUri = e.getNamespaceURI(); - if ("urn:x-dc1:xmlns".equals(nsUri)) { + if ("urn:x-personium:xmlns".equals(nsUri)) { if ("odata".equals(localName)) { return DavCmp.TYPE_COL_ODATA; } else if ("service".equals(localName)) { diff --git a/src/main/java/com/fujitsu/dc/core/model/jaxb/MkcolResponse.java b/src/main/java/io/personium/core/model/jaxb/MkcolResponse.java similarity index 94% rename from src/main/java/com/fujitsu/dc/core/model/jaxb/MkcolResponse.java rename to src/main/java/io/personium/core/model/jaxb/MkcolResponse.java index 10a4d10e1..202f00133 100644 --- a/src/main/java/com/fujitsu/dc/core/model/jaxb/MkcolResponse.java +++ b/src/main/java/io/personium/core/model/jaxb/MkcolResponse.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.jaxb; +package io.personium.core.model.jaxb; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/com/fujitsu/dc/core/model/jaxb/ObjectFactory.java b/src/main/java/io/personium/core/model/jaxb/ObjectFactory.java similarity index 94% rename from src/main/java/com/fujitsu/dc/core/model/jaxb/ObjectFactory.java rename to src/main/java/io/personium/core/model/jaxb/ObjectFactory.java index fc1d7adc4..f759a24b4 100644 --- a/src/main/java/com/fujitsu/dc/core/model/jaxb/ObjectFactory.java +++ b/src/main/java/io/personium/core/model/jaxb/ObjectFactory.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.jaxb; +package io.personium.core.model.jaxb; import javax.xml.bind.annotation.XmlRegistry; diff --git a/src/main/java/com/fujitsu/dc/core/model/jaxb/ObjectIo.java b/src/main/java/io/personium/core/model/jaxb/ObjectIo.java similarity index 95% rename from src/main/java/com/fujitsu/dc/core/model/jaxb/ObjectIo.java rename to src/main/java/io/personium/core/model/jaxb/ObjectIo.java index 66eac874a..ed76e1c90 100644 --- a/src/main/java/com/fujitsu/dc/core/model/jaxb/ObjectIo.java +++ b/src/main/java/io/personium/core/model/jaxb/ObjectIo.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.jaxb; +package io.personium.core.model.jaxb; import java.io.BufferedReader; import java.io.IOException; @@ -56,7 +56,7 @@ private ObjectIo() { static { try { - // com.fujitsu.dc.core.model.jaxb パッケージのcontextを作成 + // io.personium.core.model.jaxb パッケージのcontextを作成 context = JAXBContext.newInstance(ObjectIo.class.getPackage().getName()); Map ns2json = new HashMap(); ns2json.put("DAV:", "D"); diff --git a/src/main/java/com/fujitsu/dc/core/model/jaxb/Principal.java b/src/main/java/io/personium/core/model/jaxb/Principal.java similarity index 93% rename from src/main/java/com/fujitsu/dc/core/model/jaxb/Principal.java rename to src/main/java/io/personium/core/model/jaxb/Principal.java index c2d9f7ab4..38e03f837 100644 --- a/src/main/java/com/fujitsu/dc/core/model/jaxb/Principal.java +++ b/src/main/java/io/personium/core/model/jaxb/Principal.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.jaxb; +package io.personium.core.model.jaxb; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/src/main/java/com/fujitsu/dc/core/model/jaxb/Privilege.java b/src/main/java/io/personium/core/model/jaxb/Privilege.java similarity index 93% rename from src/main/java/com/fujitsu/dc/core/model/jaxb/Privilege.java rename to src/main/java/io/personium/core/model/jaxb/Privilege.java index 09fa47c49..4cc035b2f 100644 --- a/src/main/java/com/fujitsu/dc/core/model/jaxb/Privilege.java +++ b/src/main/java/io/personium/core/model/jaxb/Privilege.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.jaxb; +package io.personium.core.model.jaxb; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/src/main/java/com/fujitsu/dc/core/model/jaxb/ValidResourcetype.java b/src/main/java/io/personium/core/model/jaxb/ValidResourcetype.java similarity index 93% rename from src/main/java/com/fujitsu/dc/core/model/jaxb/ValidResourcetype.java rename to src/main/java/io/personium/core/model/jaxb/ValidResourcetype.java index c6aa25c0b..a7713b0d5 100644 --- a/src/main/java/com/fujitsu/dc/core/model/jaxb/ValidResourcetype.java +++ b/src/main/java/io/personium/core/model/jaxb/ValidResourcetype.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.jaxb; +package io.personium.core.model.jaxb; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/src/main/java/com/fujitsu/dc/core/model/jaxb/package-info.java b/src/main/java/io/personium/core/model/jaxb/package-info.java similarity index 83% rename from src/main/java/com/fujitsu/dc/core/model/jaxb/package-info.java rename to src/main/java/io/personium/core/model/jaxb/package-info.java index 35e72f8f7..558e34088 100644 --- a/src/main/java/com/fujitsu/dc/core/model/jaxb/package-info.java +++ b/src/main/java/io/personium/core/model/jaxb/package-info.java @@ -23,9 +23,9 @@ xmlns = { // "DAV:"はプレフィックス指定なしの場合、marshall実行時にJAXBが"ns1"のように機械的なプレフィックスを付けるため、空白文字を指定 @javax.xml.bind.annotation.XmlNs(prefix = "", namespaceURI = "DAV:"), - // "urn:x-dc1:xmlns"は"dc"で固定 - @javax.xml.bind.annotation.XmlNs(prefix = "dc", namespaceURI = "urn:x-dc1:xmlns") + // "urn:x-personium:xmlns"は"p"で固定 + @javax.xml.bind.annotation.XmlNs(prefix = "p", namespaceURI = "urn:x-personium:xmlns") } ) -package com.fujitsu.dc.core.model.jaxb; +package io.personium.core.model.jaxb; diff --git a/src/main/java/com/fujitsu/dc/core/model/lock/AccountLockManager.java b/src/main/java/io/personium/core/model/lock/AccountLockManager.java similarity index 84% rename from src/main/java/com/fujitsu/dc/core/model/lock/AccountLockManager.java rename to src/main/java/io/personium/core/model/lock/AccountLockManager.java index 88841529c..e5e1e33b5 100644 --- a/src/main/java/com/fujitsu/dc/core/model/lock/AccountLockManager.java +++ b/src/main/java/io/personium/core/model/lock/AccountLockManager.java @@ -14,11 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.lock; +package io.personium.core.model.lock; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.utils.MemcachedClient.MemcachedClientException; +import io.personium.core.PersoniumCoreException; +import io.personium.core.utils.MemcachedClient.MemcachedClientException; /** * Lockを管理するユーティリティ. @@ -44,7 +44,7 @@ public static void registAccountLockObjct(final String accountId) { if (success) { return; } - throw DcCoreException.Server.SERVER_CONNECTION_ERROR; + throw PersoniumCoreException.Server.SERVER_CONNECTION_ERROR; } /** @@ -59,7 +59,7 @@ public static boolean hasLockObject(final String accountId) { String lockPublic = singleton.doGetAccountLock(key); return (lockPublic != null); } catch (MemcachedClientException e) { - throw DcCoreException.Server.SERVER_CONNECTION_ERROR; + throw PersoniumCoreException.Server.SERVER_CONNECTION_ERROR; } } } diff --git a/src/main/java/com/fujitsu/dc/core/model/lock/CellLockManager.java b/src/main/java/io/personium/core/model/lock/CellLockManager.java similarity index 96% rename from src/main/java/com/fujitsu/dc/core/model/lock/CellLockManager.java rename to src/main/java/io/personium/core/model/lock/CellLockManager.java index 8b4106935..fa5f5c189 100644 --- a/src/main/java/com/fujitsu/dc/core/model/lock/CellLockManager.java +++ b/src/main/java/io/personium/core/model/lock/CellLockManager.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.lock; +package io.personium.core.model.lock; diff --git a/src/main/java/com/fujitsu/dc/core/model/lock/InProcessLockManager.java b/src/main/java/io/personium/core/model/lock/InProcessLockManager.java similarity index 95% rename from src/main/java/com/fujitsu/dc/core/model/lock/InProcessLockManager.java rename to src/main/java/io/personium/core/model/lock/InProcessLockManager.java index c5f912bb5..3f64ba4c5 100644 --- a/src/main/java/com/fujitsu/dc/core/model/lock/InProcessLockManager.java +++ b/src/main/java/io/personium/core/model/lock/InProcessLockManager.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.lock; +package io.personium.core.model.lock; import java.util.HashMap; import java.util.Map; diff --git a/src/main/java/com/fujitsu/dc/core/model/lock/Lock.java b/src/main/java/io/personium/core/model/lock/Lock.java similarity index 94% rename from src/main/java/com/fujitsu/dc/core/model/lock/Lock.java rename to src/main/java/io/personium/core/model/lock/Lock.java index 6055675fa..c9875e26a 100644 --- a/src/main/java/com/fujitsu/dc/core/model/lock/Lock.java +++ b/src/main/java/io/personium/core/model/lock/Lock.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.lock; +package io.personium.core.model.lock; import java.io.Serializable; diff --git a/src/main/java/com/fujitsu/dc/core/model/lock/LockKeyComposer.java b/src/main/java/io/personium/core/model/lock/LockKeyComposer.java similarity index 90% rename from src/main/java/com/fujitsu/dc/core/model/lock/LockKeyComposer.java rename to src/main/java/io/personium/core/model/lock/LockKeyComposer.java index 0add0eccc..e285bef5d 100644 --- a/src/main/java/com/fujitsu/dc/core/model/lock/LockKeyComposer.java +++ b/src/main/java/io/personium/core/model/lock/LockKeyComposer.java @@ -14,9 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.lock; +package io.personium.core.model.lock; -import com.fujitsu.dc.core.DcCoreConfig; +import io.personium.core.PersoniumUnitConfig; /** * Lockキーを生成するクラス. @@ -62,7 +62,7 @@ private static String createLockScopeKey(String cellId, String boxId, String nod return cellId; } else { // CellIDがNullの場合はunitPrefix - return DcCoreConfig.getEsUnitPrefix(); + return PersoniumUnitConfig.getEsUnitPrefix(); } } diff --git a/src/main/java/com/fujitsu/dc/core/model/lock/LockManager.java b/src/main/java/io/personium/core/model/lock/LockManager.java similarity index 81% rename from src/main/java/com/fujitsu/dc/core/model/lock/LockManager.java rename to src/main/java/io/personium/core/model/lock/LockManager.java index 6515dd443..3b6ca4dd0 100644 --- a/src/main/java/com/fujitsu/dc/core/model/lock/LockManager.java +++ b/src/main/java/io/personium/core/model/lock/LockManager.java @@ -14,14 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.lock; +package io.personium.core.model.lock; import java.util.Date; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.utils.MemcachedClient; -import com.fujitsu.dc.core.utils.MemcachedClient.MemcachedClientException; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.utils.MemcachedClient; +import io.personium.core.utils.MemcachedClient.MemcachedClientException; /** * Lockを管理するユーティリティ. @@ -29,12 +29,12 @@ public abstract class LockManager { static volatile LockManager singleton; - static volatile String lockType = DcCoreConfig.getLockType(); - static volatile long lockRetryInterval = Long.valueOf(DcCoreConfig.getLockRetryInterval()); - static volatile int lockRetryTimes = Integer.valueOf(DcCoreConfig.getLockRetryTimes()); - static volatile String lockMemcachedHost = DcCoreConfig.getLockMemcachedHost(); - static volatile String lockMemcachedPort = DcCoreConfig.getLockMemcachedPort(); - static volatile int accountLockLifeTime = Integer.valueOf(DcCoreConfig.getAccountLockLifetime()); + static volatile String lockType = PersoniumUnitConfig.getLockType(); + static volatile long lockRetryInterval = Long.valueOf(PersoniumUnitConfig.getLockRetryInterval()); + static volatile int lockRetryTimes = Integer.valueOf(PersoniumUnitConfig.getLockRetryTimes()); + static volatile String lockMemcachedHost = PersoniumUnitConfig.getLockMemcachedHost(); + static volatile String lockMemcachedPort = PersoniumUnitConfig.getLockMemcachedPort(); + static volatile int accountLockLifeTime = Integer.valueOf(PersoniumUnitConfig.getAccountLockLifetime()); /** * Memcached タイプ. @@ -108,7 +108,7 @@ public static Lock getLock(String category, String cellId, String boxId, String lock = singleton.doGetLock(fullKey); } catch (MemcachedClientException e) { MemcachedClient.reportError(); - throw DcCoreException.Server.GET_LOCK_STATE_ERROR; + throw PersoniumCoreException.Server.GET_LOCK_STATE_ERROR; } if (lock == null) { lock = new Lock(fullKey, createdAt); @@ -120,11 +120,11 @@ public static Lock getLock(String category, String cellId, String boxId, String try { Thread.sleep(lockRetryInterval); } catch (InterruptedException e) { - throw DcCoreException.Server.DATA_STORE_UNKNOWN_ERROR.reason(e); + throw PersoniumCoreException.Server.DATA_STORE_UNKNOWN_ERROR.reason(e); } timesRetry++; } - throw DcCoreException.Misc.TOO_MANY_CONCURRENT_REQUESTS; + throw PersoniumCoreException.Misc.TOO_MANY_CONCURRENT_REQUESTS; } /* diff --git a/src/main/java/com/fujitsu/dc/core/model/lock/MemcachedLockManager.java b/src/main/java/io/personium/core/model/lock/MemcachedLockManager.java similarity index 94% rename from src/main/java/com/fujitsu/dc/core/model/lock/MemcachedLockManager.java rename to src/main/java/io/personium/core/model/lock/MemcachedLockManager.java index 7bfefa67a..949685569 100644 --- a/src/main/java/com/fujitsu/dc/core/model/lock/MemcachedLockManager.java +++ b/src/main/java/io/personium/core/model/lock/MemcachedLockManager.java @@ -14,9 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.lock; +package io.personium.core.model.lock; -import com.fujitsu.dc.core.utils.MemcachedClient; +import io.personium.core.utils.MemcachedClient; /** */ diff --git a/src/main/java/com/fujitsu/dc/core/model/lock/ReadDeleteModeLockManager.java b/src/main/java/io/personium/core/model/lock/ReadDeleteModeLockManager.java similarity index 82% rename from src/main/java/com/fujitsu/dc/core/model/lock/ReadDeleteModeLockManager.java rename to src/main/java/io/personium/core/model/lock/ReadDeleteModeLockManager.java index 4caee4fc6..2b3fc362a 100644 --- a/src/main/java/com/fujitsu/dc/core/model/lock/ReadDeleteModeLockManager.java +++ b/src/main/java/io/personium/core/model/lock/ReadDeleteModeLockManager.java @@ -14,10 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.lock; +package io.personium.core.model.lock; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.utils.MemcachedClient.MemcachedClientException; +import io.personium.core.PersoniumCoreException; +import io.personium.core.utils.MemcachedClient.MemcachedClientException; /** * PCSの動作モードを参照するクラス. @@ -38,7 +38,7 @@ public static boolean isReadDeleteOnlyMode() { String response = singleton.doGetReadDeleteOnlyMode(LOCK_KEY); return (response != null); } catch (MemcachedClientException e) { - throw DcCoreException.Server.SERVER_CONNECTION_ERROR; + throw PersoniumCoreException.Server.SERVER_CONNECTION_ERROR; } } } diff --git a/src/main/java/com/fujitsu/dc/core/model/lock/UnitUserLockManager.java b/src/main/java/io/personium/core/model/lock/UnitUserLockManager.java similarity index 83% rename from src/main/java/com/fujitsu/dc/core/model/lock/UnitUserLockManager.java rename to src/main/java/io/personium/core/model/lock/UnitUserLockManager.java index ccf75bba5..05ee80827 100644 --- a/src/main/java/com/fujitsu/dc/core/model/lock/UnitUserLockManager.java +++ b/src/main/java/io/personium/core/model/lock/UnitUserLockManager.java @@ -14,11 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.lock; +package io.personium.core.model.lock; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.utils.MemcachedClient; -import com.fujitsu.dc.core.utils.MemcachedClient.MemcachedClientException; +import io.personium.core.PersoniumCoreException; +import io.personium.core.utils.MemcachedClient; +import io.personium.core.utils.MemcachedClient.MemcachedClientException; /** * UnitUserごとのLockを管理するユーティリティ. @@ -46,7 +46,7 @@ public static boolean hasLockObject(final String unitUserName) { String lockPublic = singleton.doGetUnituserLock(key); return (lockPublic != null); } catch (MemcachedClientException e) { - throw DcCoreException.Server.SERVER_CONNECTION_ERROR; + throw PersoniumCoreException.Server.SERVER_CONNECTION_ERROR; } } @@ -66,7 +66,7 @@ public static void registLockObjct(final String unitUserName) { lock = singleton.doGetUnituserLock(key); } catch (MemcachedClientException e) { MemcachedClient.reportError(); - throw DcCoreException.Server.GET_LOCK_STATE_ERROR; + throw PersoniumCoreException.Server.GET_LOCK_STATE_ERROR; } if (lock == null) { lock = "service mentenance."; @@ -78,11 +78,11 @@ public static void registLockObjct(final String unitUserName) { try { Thread.sleep(lockRetryInterval); } catch (InterruptedException e) { - throw DcCoreException.Server.DATA_STORE_UNKNOWN_ERROR.reason(e); + throw PersoniumCoreException.Server.DATA_STORE_UNKNOWN_ERROR.reason(e); } timesRetry++; } - throw DcCoreException.Misc.TOO_MANY_CONCURRENT_REQUESTS; + throw PersoniumCoreException.Misc.TOO_MANY_CONCURRENT_REQUESTS; } /** diff --git a/src/main/java/com/fujitsu/dc/core/model/lock/package-info.java b/src/main/java/io/personium/core/model/lock/package-info.java similarity index 91% rename from src/main/java/com/fujitsu/dc/core/model/lock/package-info.java rename to src/main/java/io/personium/core/model/lock/package-info.java index 8daff7f06..2901fd524 100644 --- a/src/main/java/com/fujitsu/dc/core/model/lock/package-info.java +++ b/src/main/java/io/personium/core/model/lock/package-info.java @@ -17,5 +17,5 @@ /** * Lock機構を提供するクラス群. */ -package com.fujitsu.dc.core.model.lock; +package io.personium.core.model.lock; diff --git a/src/main/java/com/fujitsu/dc/core/model/package-info.java b/src/main/java/io/personium/core/model/package-info.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/model/package-info.java rename to src/main/java/io/personium/core/model/package-info.java index c21982723..0792445de 100644 --- a/src/main/java/com/fujitsu/dc/core/model/package-info.java +++ b/src/main/java/io/personium/core/model/package-info.java @@ -17,4 +17,4 @@ /** * Model Objects. */ -package com.fujitsu.dc.core.model; +package io.personium.core.model; diff --git a/src/main/java/com/fujitsu/dc/core/model/progress/InProcessProgressManager.java b/src/main/java/io/personium/core/model/progress/InProcessProgressManager.java similarity index 93% rename from src/main/java/com/fujitsu/dc/core/model/progress/InProcessProgressManager.java rename to src/main/java/io/personium/core/model/progress/InProcessProgressManager.java index 6260658aa..36c6b0f44 100644 --- a/src/main/java/com/fujitsu/dc/core/model/progress/InProcessProgressManager.java +++ b/src/main/java/io/personium/core/model/progress/InProcessProgressManager.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.progress; +package io.personium.core.model.progress; import java.util.HashMap; import java.util.Map; diff --git a/src/main/java/com/fujitsu/dc/core/model/progress/MemcachedProgressManager.java b/src/main/java/io/personium/core/model/progress/MemcachedProgressManager.java similarity index 90% rename from src/main/java/com/fujitsu/dc/core/model/progress/MemcachedProgressManager.java rename to src/main/java/io/personium/core/model/progress/MemcachedProgressManager.java index 1d421fe96..8cd8ec1a0 100644 --- a/src/main/java/com/fujitsu/dc/core/model/progress/MemcachedProgressManager.java +++ b/src/main/java/io/personium/core/model/progress/MemcachedProgressManager.java @@ -14,9 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.progress; +package io.personium.core.model.progress; -import com.fujitsu.dc.core.utils.MemcachedClient; +import io.personium.core.utils.MemcachedClient; /** * 非同期処理状況をmemcachedへアクセスするためのクラス. diff --git a/src/main/java/com/fujitsu/dc/core/model/progress/Progress.java b/src/main/java/io/personium/core/model/progress/Progress.java similarity index 93% rename from src/main/java/com/fujitsu/dc/core/model/progress/Progress.java rename to src/main/java/io/personium/core/model/progress/Progress.java index 0b862736d..81ee92059 100644 --- a/src/main/java/com/fujitsu/dc/core/model/progress/Progress.java +++ b/src/main/java/io/personium/core/model/progress/Progress.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.progress; +package io.personium.core.model.progress; import java.io.Serializable; diff --git a/src/main/java/com/fujitsu/dc/core/model/progress/ProgressInfo.java b/src/main/java/io/personium/core/model/progress/ProgressInfo.java similarity index 94% rename from src/main/java/com/fujitsu/dc/core/model/progress/ProgressInfo.java rename to src/main/java/io/personium/core/model/progress/ProgressInfo.java index 1b5dd2f1c..38f42c422 100644 --- a/src/main/java/com/fujitsu/dc/core/model/progress/ProgressInfo.java +++ b/src/main/java/io/personium/core/model/progress/ProgressInfo.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.progress; +package io.personium.core.model.progress; import org.json.simple.JSONObject; diff --git a/src/main/java/com/fujitsu/dc/core/model/progress/ProgressManager.java b/src/main/java/io/personium/core/model/progress/ProgressManager.java similarity index 79% rename from src/main/java/com/fujitsu/dc/core/model/progress/ProgressManager.java rename to src/main/java/io/personium/core/model/progress/ProgressManager.java index 712eb68ff..0035c1793 100644 --- a/src/main/java/com/fujitsu/dc/core/model/progress/ProgressManager.java +++ b/src/main/java/io/personium/core/model/progress/ProgressManager.java @@ -14,26 +14,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.progress; +package io.personium.core.model.progress; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.utils.MemcachedClient; -import com.fujitsu.dc.core.utils.MemcachedClient.MemcachedClientException; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.utils.MemcachedClient; +import io.personium.core.utils.MemcachedClient.MemcachedClientException; /** * 非同期処理状況を管理するクラス * 処理状況の格納先については、LockManagerクラスと同じ方式とする. - * @see com.fujitsu.dc.core.model.lock.LockManager + * @see io.personium.core.model.lock.LockManager */ public abstract class ProgressManager { static volatile ProgressManager singleton; - static volatile String storeType = DcCoreConfig.getLockType(); - static volatile long retryInterval = Long.valueOf(DcCoreConfig.getLockRetryInterval()); - static volatile int retryTimes = Integer.valueOf(DcCoreConfig.getLockRetryTimes()); - static volatile String memcachedHost = DcCoreConfig.getLockMemcachedHost(); - static volatile String memcachedPort = DcCoreConfig.getLockMemcachedPort(); - static volatile int lifeTime = Integer.valueOf(DcCoreConfig.getBarInstallProgressLifeTimeExpireInSec()); + static volatile String storeType = PersoniumUnitConfig.getLockType(); + static volatile long retryInterval = Long.valueOf(PersoniumUnitConfig.getLockRetryInterval()); + static volatile int retryTimes = Integer.valueOf(PersoniumUnitConfig.getLockRetryTimes()); + static volatile String memcachedHost = PersoniumUnitConfig.getLockMemcachedHost(); + static volatile String memcachedPort = PersoniumUnitConfig.getLockMemcachedPort(); + static volatile int lifeTime = Integer.valueOf(PersoniumUnitConfig.getBarInstallProgressLifeTimeExpireInSec()); /** * Memcached タイプ. @@ -69,7 +69,7 @@ public static Progress getProgress(String fullKey) { return progress; } catch (MemcachedClientException e) { MemcachedClient.reportError(); - throw DcCoreException.Server.GET_LOCK_STATE_ERROR; + throw PersoniumCoreException.Server.GET_LOCK_STATE_ERROR; } } diff --git a/src/main/java/com/fujitsu/dc/core/model/progress/package-info.java b/src/main/java/io/personium/core/model/progress/package-info.java similarity index 91% rename from src/main/java/com/fujitsu/dc/core/model/progress/package-info.java rename to src/main/java/io/personium/core/model/progress/package-info.java index 2d471d867..88b4800f2 100644 --- a/src/main/java/com/fujitsu/dc/core/model/progress/package-info.java +++ b/src/main/java/io/personium/core/model/progress/package-info.java @@ -17,5 +17,5 @@ /** * 非同期処理機構を提供するクラス群. */ -package com.fujitsu.dc.core.model.progress; +package io.personium.core.model.progress; diff --git a/src/main/java/com/fujitsu/dc/core/odata/NavigationTargetKeyProperty.java b/src/main/java/io/personium/core/odata/NavigationTargetKeyProperty.java similarity index 94% rename from src/main/java/com/fujitsu/dc/core/odata/NavigationTargetKeyProperty.java rename to src/main/java/io/personium/core/odata/NavigationTargetKeyProperty.java index e943fd550..f9e7d3dde 100644 --- a/src/main/java/com/fujitsu/dc/core/odata/NavigationTargetKeyProperty.java +++ b/src/main/java/io/personium/core/odata/NavigationTargetKeyProperty.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.odata; +package io.personium.core.odata; import java.util.Map; diff --git a/src/main/java/com/fujitsu/dc/core/odata/OEntityWrapper.java b/src/main/java/io/personium/core/odata/OEntityWrapper.java similarity index 95% rename from src/main/java/com/fujitsu/dc/core/odata/OEntityWrapper.java rename to src/main/java/io/personium/core/odata/OEntityWrapper.java index d487d5fed..9335fbeaa 100644 --- a/src/main/java/com/fujitsu/dc/core/odata/OEntityWrapper.java +++ b/src/main/java/io/personium/core/odata/OEntityWrapper.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.odata; +package io.personium.core.odata; import java.util.HashMap; import java.util.List; diff --git a/src/main/java/com/fujitsu/dc/core/odata/DcEdmxFormatParser.java b/src/main/java/io/personium/core/odata/PersoniumEdmxFormatParser.java similarity index 96% rename from src/main/java/com/fujitsu/dc/core/odata/DcEdmxFormatParser.java rename to src/main/java/io/personium/core/odata/PersoniumEdmxFormatParser.java index 924406d86..587b37546 100644 --- a/src/main/java/com/fujitsu/dc/core/odata/DcEdmxFormatParser.java +++ b/src/main/java/io/personium/core/odata/PersoniumEdmxFormatParser.java @@ -36,7 +36,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.odata; +package io.personium.core.odata; import java.util.ArrayList; import java.util.List; @@ -77,25 +77,25 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.model.ctl.CtlSchema; +import io.personium.core.model.ctl.Common; +import io.personium.core.model.ctl.CtlSchema; /** * barインストール時に使用するEdmxのXML解析用パーサクラス. */ -public class DcEdmxFormatParser extends EdmxFormatParser { +public class PersoniumEdmxFormatParser extends EdmxFormatParser { /** * ログ用オブジェクト. */ - static Logger log = LoggerFactory.getLogger(DcEdmxFormatParser.class); + static Logger log = LoggerFactory.getLogger(PersoniumEdmxFormatParser.class); private final EdmDataServices.Builder dataServices = EdmDataServices.newBuilder(); /** * コンストラクタ. */ - public DcEdmxFormatParser() { + public PersoniumEdmxFormatParser() { } /** @@ -107,7 +107,7 @@ public DcEdmxFormatParser() { public EdmDataServices parseMetadata(XMLEventReader2 reader) { List schemas = new ArrayList(); List namespaces = new ArrayList(); - namespaces.add(new PrefixedNamespace(Common.DC_NAMESPACE.getUri(), Common.DC_NAMESPACE.getPrefix())); + namespaces.add(new PrefixedNamespace(Common.P_NAMESPACE.getUri(), Common.P_NAMESPACE.getPrefix())); ODataVersion version = null; boolean foundDataServices = false; @@ -558,9 +558,9 @@ private EdmProperty.Builder parseEdmProperty(XMLEvent2 event) { String scale = getAttributeValueIfExists(event.asStartElement(), "Scale"); String isDeclared = getAttributeValueIfExists( - event.asStartElement(), new QName2(Common.DC_NAMESPACE.getUri(), "IsDeclared")); + event.asStartElement(), new QName2(Common.P_NAMESPACE.getUri(), "IsDeclared")); String format = getAttributeValueIfExists( - event.asStartElement(), new QName2(Common.DC_NAMESPACE.getUri(), "Format")); + event.asStartElement(), new QName2(Common.P_NAMESPACE.getUri(), "Format")); String storeGeneratedPattern = getAttributeValueIfExists( event.asStartElement(), new QName2(NS_EDMANNOTATION, "StoreGeneratedPattern")); diff --git a/src/main/java/com/fujitsu/dc/core/odata/DcExpressionParser.java b/src/main/java/io/personium/core/odata/PersoniumExpressionParser.java similarity index 97% rename from src/main/java/com/fujitsu/dc/core/odata/DcExpressionParser.java rename to src/main/java/io/personium/core/odata/PersoniumExpressionParser.java index 83c5e9fae..d5b9e70cc 100644 --- a/src/main/java/com/fujitsu/dc/core/odata/DcExpressionParser.java +++ b/src/main/java/io/personium/core/odata/PersoniumExpressionParser.java @@ -36,7 +36,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.odata; +package io.personium.core.odata; import java.math.BigDecimal; import java.util.ArrayList; @@ -68,12 +68,12 @@ import org.slf4j.LoggerFactory; /** - * DcExpressionParserクラス. + * PersoniumExpressionParserクラス. * OData4jのライブラリのソースよりコピー */ -public class DcExpressionParser { +public class PersoniumExpressionParser { - static Logger log = LoggerFactory.getLogger(DcExpressionParser.class); + static Logger log = LoggerFactory.getLogger(PersoniumExpressionParser.class); private static final int TOKEN_SIZE_3 = 3; private static final int TOKEN_SIZE_4 = 4; @@ -81,7 +81,7 @@ public class DcExpressionParser { private static final int TOKEN_SIZE_6 = 6; private static final int BINARY_EXPRESSION_CONSTANT = 3; - private DcExpressionParser() { + private PersoniumExpressionParser() { } diff --git a/src/main/java/com/fujitsu/dc/core/odata/DcFormatParserFactory.java b/src/main/java/io/personium/core/odata/PersoniumFormatParserFactory.java similarity index 91% rename from src/main/java/com/fujitsu/dc/core/odata/DcFormatParserFactory.java rename to src/main/java/io/personium/core/odata/PersoniumFormatParserFactory.java index 54efefa19..52a00f5b0 100644 --- a/src/main/java/com/fujitsu/dc/core/odata/DcFormatParserFactory.java +++ b/src/main/java/io/personium/core/odata/PersoniumFormatParserFactory.java @@ -34,7 +34,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.odata; +package io.personium.core.odata; import javax.ws.rs.core.MediaType; @@ -46,9 +46,9 @@ /** * ODataのFormatParserFactory. */ -public class DcFormatParserFactory { +public class PersoniumFormatParserFactory { - private DcFormatParserFactory() { + private PersoniumFormatParserFactory() { } /** @@ -93,7 +93,7 @@ public static class JsonParsers implements FormatParsers { @Override public FormatParser getEntryFormatParser(Settings settings) { - return new DcJsonEntryFormatParser(settings); + return new PersoniumJsonEntryFormatParser(settings); } } diff --git a/src/main/java/com/fujitsu/dc/core/odata/DcFormatWriterFactory.java b/src/main/java/io/personium/core/odata/PersoniumFormatWriterFactory.java similarity index 93% rename from src/main/java/com/fujitsu/dc/core/odata/DcFormatWriterFactory.java rename to src/main/java/io/personium/core/odata/PersoniumFormatWriterFactory.java index 9d8a92a1d..0fb485969 100644 --- a/src/main/java/com/fujitsu/dc/core/odata/DcFormatWriterFactory.java +++ b/src/main/java/io/personium/core/odata/PersoniumFormatWriterFactory.java @@ -34,7 +34,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.odata; +package io.personium.core.odata; import java.util.List; @@ -68,7 +68,7 @@ /** * FormatWriterFactoryのラッパークラス. */ -public class DcFormatWriterFactory { +public class PersoniumFormatWriterFactory { /** * インターフェース. @@ -94,7 +94,7 @@ private interface FormatWriters { FormatWriter> getCollectionFormatWriter(); } - private DcFormatWriterFactory() { + private PersoniumFormatWriterFactory() { } /** @@ -204,12 +204,12 @@ public FormatWriter getServiceDocumentFormatWriter() { @Override public FormatWriter getFeedFormatWriter() { - return new DcJsonFeedFormatWriter(callback); + return new PersoniumJsonFeedFormatWriter(callback); } @Override public FormatWriter getEntryFormatWriter() { - return new DcJsonEntryFormatWriter(callback); + return new PersoniumJsonEntryFormatWriter(callback); } @Override @@ -224,12 +224,12 @@ public FormatWriter getRequestEntryFormatWriter() { @Override public FormatWriter getSingleLinkFormatWriter() { - return new DcJsonSingleLinkFormatWriter(callback); + return new PersoniumJsonSingleLinkFormatWriter(callback); } @Override public FormatWriter getSingleLinksFormatWriter() { - return new DcJsonSingleLinksFormatWriter(callback); + return new PersoniumJsonSingleLinksFormatWriter(callback); } @Override diff --git a/src/main/java/com/fujitsu/dc/core/odata/DcJsonCollectionFormatParser.java b/src/main/java/io/personium/core/odata/PersoniumJsonCollectionFormatParser.java similarity index 79% rename from src/main/java/com/fujitsu/dc/core/odata/DcJsonCollectionFormatParser.java rename to src/main/java/io/personium/core/odata/PersoniumJsonCollectionFormatParser.java index 983cc83c9..c81e8dd60 100644 --- a/src/main/java/com/fujitsu/dc/core/odata/DcJsonCollectionFormatParser.java +++ b/src/main/java/io/personium/core/odata/PersoniumJsonCollectionFormatParser.java @@ -34,7 +34,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.odata; +package io.personium.core.odata; import java.io.Reader; @@ -50,17 +50,17 @@ import org.odata4j.format.FormatParser; import org.odata4j.format.Settings; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.odata.DcJsonStreamReaderFactory.JsonStreamReader; -import com.fujitsu.dc.core.odata.DcJsonStreamReaderFactory.JsonStreamReader.JsonEvent; -import com.fujitsu.dc.core.odata.DcJsonStreamReaderFactory.JsonStreamReader.JsonValueEvent; -import com.fujitsu.dc.core.utils.ODataUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.Common; +import io.personium.core.odata.PersoniumJsonStreamReaderFactory.JsonStreamReader; +import io.personium.core.odata.PersoniumJsonStreamReaderFactory.JsonStreamReader.JsonEvent; +import io.personium.core.odata.PersoniumJsonStreamReaderFactory.JsonStreamReader.JsonValueEvent; +import io.personium.core.utils.ODataUtils; /** * OCollectionのパーサー. */ -public class DcJsonCollectionFormatParser extends DcJsonFormatParser implements +public class PersoniumJsonCollectionFormatParser extends PersoniumJsonFormatParser implements FormatParser> { private final EdmCollectionType returnType; @@ -73,7 +73,7 @@ public class DcJsonCollectionFormatParser extends DcJsonFormatParser implements * @param md スキーマ情報 * @param name プロパティ名 */ - public DcJsonCollectionFormatParser(EdmCollectionType collectionType, EdmDataServices md, String name) { + public PersoniumJsonCollectionFormatParser(EdmCollectionType collectionType, EdmDataServices md, String name) { super(null); super.setMetadata(md); returnType = collectionType; @@ -82,7 +82,7 @@ public DcJsonCollectionFormatParser(EdmCollectionType collectionType, EdmDataSer @Override public OCollection parse(Reader reader) { - JsonStreamReader jsr = DcJsonStreamReaderFactory.createJsonStreamReader(reader); + JsonStreamReader jsr = PersoniumJsonStreamReaderFactory.createJsonStreamReader(reader); try { // parse the entry OCollection o = parseCollection(jsr); @@ -113,7 +113,7 @@ protected OCollection parseCollection(JsonStreamReader jsr) { // ComplexTypeが存在する場合は、パースを実施してComplexTypeObjectを取得する Settings s = new Settings(getVersion(), getMetadata(), getEntitySetName(), getEntityKey(), null, false, ct); - DcJsonComplexObjectFormatParser cofp = new DcJsonComplexObjectFormatParser(s); + PersoniumJsonComplexObjectFormatParser cofp = new PersoniumJsonComplexObjectFormatParser(s); while (jsr.hasNext()) { OComplexObject obj = cofp.parseSingleObject(jsr); if (null != obj) { @@ -125,7 +125,7 @@ protected OCollection parseCollection(JsonStreamReader jsr) { } else { // ComplexTypeがスキーマ定義上に存在しなければエラーとする - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propertyName); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propertyName); } } @@ -148,22 +148,22 @@ protected void parseCollectionOfSimple(OCollection.Builder builder, Jso if (propValue != null) { if (this.returnType.getItemType().equals(EdmSimpleType.BOOLEAN) && !ODataUtils.validateBoolean(propValue)) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propertyName); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propertyName); } else if (this.returnType.getItemType().equals(EdmSimpleType.SINGLE) && !ODataUtils.validateSingle(propValue)) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propertyName); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propertyName); } else if (this.returnType.getItemType().equals(EdmSimpleType.INT32) && !ODataUtils.validateInt32(propValue)) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propertyName); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propertyName); } else if (this.returnType.getItemType().equals(EdmSimpleType.DOUBLE) && !ODataUtils.validateDouble(propValue)) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propertyName); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propertyName); } else if (this.returnType.getItemType().equals(EdmSimpleType.STRING) && !ODataUtils.validateString(propValue)) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propertyName); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propertyName); } else if (this.returnType.getItemType().equals(EdmSimpleType.DATETIME)) { if (!ODataUtils.validateDateTime(propValue)) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propertyName); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propertyName); } if (Common.SYSUTCDATETIME.equals(propValue)) { String crrTime = String.valueOf(getCurrentTimeMillis()); diff --git a/src/main/java/com/fujitsu/dc/core/odata/DcJsonComplexObjectFormatParser.java b/src/main/java/io/personium/core/odata/PersoniumJsonComplexObjectFormatParser.java similarity index 83% rename from src/main/java/com/fujitsu/dc/core/odata/DcJsonComplexObjectFormatParser.java rename to src/main/java/io/personium/core/odata/PersoniumJsonComplexObjectFormatParser.java index e050c52fb..82a10253e 100644 --- a/src/main/java/com/fujitsu/dc/core/odata/DcJsonComplexObjectFormatParser.java +++ b/src/main/java/io/personium/core/odata/PersoniumJsonComplexObjectFormatParser.java @@ -34,7 +34,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.odata; +package io.personium.core.odata; import java.io.Reader; import java.util.ArrayList; @@ -54,22 +54,22 @@ import org.odata4j.format.json.JsonStreamReaderFactory.JsonParseException; import org.odata4j.format.json.JsonTypeConverter; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.odata.DcJsonStreamReaderFactory.JsonStreamReader; -import com.fujitsu.dc.core.odata.DcJsonStreamReaderFactory.JsonStreamReader.JsonEvent; -import com.fujitsu.dc.core.utils.ODataUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.Common; +import io.personium.core.odata.PersoniumJsonStreamReaderFactory.JsonStreamReader; +import io.personium.core.odata.PersoniumJsonStreamReaderFactory.JsonStreamReader.JsonEvent; +import io.personium.core.utils.ODataUtils; /** * Parser for OComplexObjects in JSON. */ -public class DcJsonComplexObjectFormatParser extends DcJsonFormatParser implements FormatParser { +public class PersoniumJsonComplexObjectFormatParser extends PersoniumJsonFormatParser implements FormatParser { /** * コンストラクタ. * @param s 設定情報 */ - public DcJsonComplexObjectFormatParser(Settings s) { + public PersoniumJsonComplexObjectFormatParser(Settings s) { super(s); if (s == null) { returnType = null; @@ -88,7 +88,7 @@ public DcJsonComplexObjectFormatParser(Settings s) { */ @Override public OComplexObject parse(Reader reader) { - JsonStreamReader jsr = DcJsonStreamReaderFactory.createJsonStreamReader(reader); + JsonStreamReader jsr = PersoniumJsonStreamReaderFactory.createJsonStreamReader(reader); try { OComplexObject o = parseSingleObject(jsr); return o; @@ -167,7 +167,7 @@ protected void addProperty(List> props, String name, JsonStreamRead if (event.isEndProperty()) { if (ep == null) { // プロパティ定義がComplexType定義上に存在しなければエラーとする - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); } if (ep.getType().isSimple()) { // 値チェック @@ -175,22 +175,22 @@ protected void addProperty(List> props, String name, JsonStreamRead if (propValue != null) { if (ep.getType().equals(EdmSimpleType.BOOLEAN) && !ODataUtils.validateBoolean(propValue)) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); } else if (ep.getType().equals(EdmSimpleType.SINGLE) && !ODataUtils.validateSingle(propValue)) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); } else if (ep.getType().equals(EdmSimpleType.INT32) && !ODataUtils.validateInt32(propValue)) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); } else if (ep.getType().equals(EdmSimpleType.DOUBLE) && !ODataUtils.validateDouble(propValue)) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); } else if (ep.getType().equals(EdmSimpleType.STRING) && !ODataUtils.validateString(propValue)) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); } else if (ep.getType().equals(EdmSimpleType.DATETIME)) { if (!ODataUtils.validateDateTime(propValue)) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); } if (Common.SYSUTCDATETIME.equals(propValue)) { String crrTime = String.valueOf(getCurrentTimeMillis()); @@ -221,7 +221,7 @@ protected void addProperty(List> props, String name, JsonStreamRead val.complexObject.getProperties())); } else { // ComplexTypeデータ以外はエラーとする - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); } } else if (event.isStartArray()) { // 配列オブジェクトの場合 @@ -230,7 +230,7 @@ protected void addProperty(List> props, String name, JsonStreamRead // スキーマ定義が存在してCollectionKindがNoneでなければ、配列としてパースする if (null != ep && ep.getCollectionKind() != CollectionKind.NONE) { val.collectionType = new EdmCollectionType(ep.getCollectionKind(), ep.getType()); - DcJsonCollectionFormatParser cfp = new DcJsonCollectionFormatParser(val.collectionType, + PersoniumJsonCollectionFormatParser cfp = new PersoniumJsonCollectionFormatParser(val.collectionType, getMetadata(), name); val.collection = cfp.parseCollection(jsr); } @@ -239,7 +239,7 @@ protected void addProperty(List> props, String name, JsonStreamRead if (val.collectionType != null && val.collection != null) { props.add(OProperties.collection(name, val.collectionType, val.collection)); } else { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); } } else { throw new JsonParseException("expecting endproperty, got: " + event.toString()); @@ -270,11 +270,11 @@ protected JsonObjectPropertyValue getValue(JsonEvent event, if (null != ct) { // ComplexTypeが存在する場合は、パースを実施してComplexTypeObjectを取得する Settings s = new Settings(getVersion(), getMetadata(), null, null, null, false, ct); - DcJsonComplexObjectFormatParser cofp = new DcJsonComplexObjectFormatParser(s); + PersoniumJsonComplexObjectFormatParser cofp = new PersoniumJsonComplexObjectFormatParser(s); rt.complexObject = cofp.parseSingleObject(jsr, event); } else { // ComplexTypeがスキーマ定義上に存在しなければエラーとする - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); } ensureEndProperty(jsr.nextEvent()); @@ -282,7 +282,7 @@ protected JsonObjectPropertyValue getValue(JsonEvent event, // ComplexTypeの値がNullの場合 return null; } else { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); } return rt; } diff --git a/src/main/java/com/fujitsu/dc/core/odata/DcJsonEntryFormatParser.java b/src/main/java/io/personium/core/odata/PersoniumJsonEntryFormatParser.java similarity index 83% rename from src/main/java/com/fujitsu/dc/core/odata/DcJsonEntryFormatParser.java rename to src/main/java/io/personium/core/odata/PersoniumJsonEntryFormatParser.java index 5eae41341..1ba9d2dee 100644 --- a/src/main/java/com/fujitsu/dc/core/odata/DcJsonEntryFormatParser.java +++ b/src/main/java/io/personium/core/odata/PersoniumJsonEntryFormatParser.java @@ -34,7 +34,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.odata; +package io.personium.core.odata; import java.io.Reader; @@ -42,18 +42,18 @@ import org.odata4j.format.FormatParser; import org.odata4j.format.Settings; -import com.fujitsu.dc.core.odata.DcJsonStreamReaderFactory.JsonStreamReader; +import io.personium.core.odata.PersoniumJsonStreamReaderFactory.JsonStreamReader; /** * JsonEntryFormatParser. */ -public class DcJsonEntryFormatParser extends DcJsonFormatParser implements FormatParser { +public class PersoniumJsonEntryFormatParser extends PersoniumJsonFormatParser implements FormatParser { /** * コンストラクタ. * @param settings セッティング */ - public DcJsonEntryFormatParser(Settings settings) { + public PersoniumJsonEntryFormatParser(Settings settings) { super(settings); } @@ -64,7 +64,7 @@ public DcJsonEntryFormatParser(Settings settings) { */ @Override public Entry parse(Reader reader) { - JsonStreamReader jsr = DcJsonStreamReaderFactory.createJsonStreamReader(reader); + JsonStreamReader jsr = PersoniumJsonStreamReaderFactory.createJsonStreamReader(reader); try { ensureNext(jsr); diff --git a/src/main/java/com/fujitsu/dc/core/odata/DcJsonEntryFormatWriter.java b/src/main/java/io/personium/core/odata/PersoniumJsonEntryFormatWriter.java similarity index 89% rename from src/main/java/com/fujitsu/dc/core/odata/DcJsonEntryFormatWriter.java rename to src/main/java/io/personium/core/odata/PersoniumJsonEntryFormatWriter.java index 2d8a72b6e..a077b39f0 100644 --- a/src/main/java/com/fujitsu/dc/core/odata/DcJsonEntryFormatWriter.java +++ b/src/main/java/io/personium/core/odata/PersoniumJsonEntryFormatWriter.java @@ -34,7 +34,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.odata; +package io.personium.core.odata; import javax.ws.rs.core.UriInfo; @@ -44,13 +44,13 @@ /** * JsonEntryFormatWriterのラッパークラス. */ -public class DcJsonEntryFormatWriter extends DcJsonFormatWriter { +public class PersoniumJsonEntryFormatWriter extends PersoniumJsonFormatWriter { /** * コンストラクタ. * @param jsonpCallback コールバック */ - public DcJsonEntryFormatWriter(String jsonpCallback) { + public PersoniumJsonEntryFormatWriter(String jsonpCallback) { super(jsonpCallback); } diff --git a/src/main/java/com/fujitsu/dc/core/odata/DcJsonFeedFormatParser.java b/src/main/java/io/personium/core/odata/PersoniumJsonFeedFormatParser.java similarity index 90% rename from src/main/java/com/fujitsu/dc/core/odata/DcJsonFeedFormatParser.java rename to src/main/java/io/personium/core/odata/PersoniumJsonFeedFormatParser.java index 042170c8c..7d98da1a9 100644 --- a/src/main/java/com/fujitsu/dc/core/odata/DcJsonFeedFormatParser.java +++ b/src/main/java/io/personium/core/odata/PersoniumJsonFeedFormatParser.java @@ -34,7 +34,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.odata; +package io.personium.core.odata; import java.util.List; @@ -48,9 +48,9 @@ import org.odata4j.format.Settings; /** - * DcJsonFeedFormatParser. + * PersoniumJsonFeedFormatParser. */ -public class DcJsonFeedFormatParser extends DcJsonFormatParser { +public class PersoniumJsonFeedFormatParser extends PersoniumJsonFormatParser { /** * JsonEntry. @@ -95,7 +95,7 @@ public String getETag() { * コンストラクタ. * @param settings セッティング情報 */ - public DcJsonFeedFormatParser(Settings settings) { + public PersoniumJsonFeedFormatParser(Settings settings) { super(settings); } diff --git a/src/main/java/com/fujitsu/dc/core/odata/DcJsonFeedFormatWriter.java b/src/main/java/io/personium/core/odata/PersoniumJsonFeedFormatWriter.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/odata/DcJsonFeedFormatWriter.java rename to src/main/java/io/personium/core/odata/PersoniumJsonFeedFormatWriter.java index 484d0ce48..7cc95a806 100644 --- a/src/main/java/com/fujitsu/dc/core/odata/DcJsonFeedFormatWriter.java +++ b/src/main/java/io/personium/core/odata/PersoniumJsonFeedFormatWriter.java @@ -34,7 +34,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.odata; +package io.personium.core.odata; import javax.ws.rs.core.UriBuilder; import javax.ws.rs.core.UriInfo; @@ -46,13 +46,13 @@ /** * JsonFeedFormatWriterのラッパークラス. */ -public class DcJsonFeedFormatWriter extends DcJsonFormatWriter { +public class PersoniumJsonFeedFormatWriter extends PersoniumJsonFormatWriter { /** * コンストラクタ. * @param jsonpCallback コールバック */ - public DcJsonFeedFormatWriter(String jsonpCallback) { + public PersoniumJsonFeedFormatWriter(String jsonpCallback) { super(jsonpCallback); } diff --git a/src/main/java/com/fujitsu/dc/core/odata/DcJsonFormatParser.java b/src/main/java/io/personium/core/odata/PersoniumJsonFormatParser.java similarity index 86% rename from src/main/java/com/fujitsu/dc/core/odata/DcJsonFormatParser.java rename to src/main/java/io/personium/core/odata/PersoniumJsonFormatParser.java index 4acd032c8..e971d9188 100644 --- a/src/main/java/com/fujitsu/dc/core/odata/DcJsonFormatParser.java +++ b/src/main/java/io/personium/core/odata/PersoniumJsonFormatParser.java @@ -34,7 +34,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.odata; +package io.personium.core.odata; import java.util.ArrayList; import java.util.List; @@ -63,17 +63,17 @@ import org.odata4j.format.json.JsonTypeConverter; import org.odata4j.producer.edm.Edm; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.odata.DcJsonFeedFormatParser.JsonEntry; -import com.fujitsu.dc.core.odata.DcJsonStreamReaderFactory.JsonStreamReader; -import com.fujitsu.dc.core.odata.DcJsonStreamReaderFactory.JsonStreamReader.JsonEvent; -import com.fujitsu.dc.core.utils.ODataUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.Common; +import io.personium.core.odata.PersoniumJsonFeedFormatParser.JsonEntry; +import io.personium.core.odata.PersoniumJsonStreamReaderFactory.JsonStreamReader; +import io.personium.core.odata.PersoniumJsonStreamReaderFactory.JsonStreamReader.JsonEvent; +import io.personium.core.utils.ODataUtils; /** * JsonFormatParser. */ -public class DcJsonFormatParser { +public class PersoniumJsonFormatParser { /** __metadata. */ protected static final String METADATA_PROPERTY = "__metadata"; @@ -150,7 +150,7 @@ public OEntityKey getEntityKey() { * コンストラクタ. * @param settings セッティング情報 */ - protected DcJsonFormatParser(Settings settings) { + protected PersoniumJsonFormatParser(Settings settings) { if (settings != null) { this.version = settings.version; this.metadata = settings.metadata; @@ -189,7 +189,7 @@ protected JsonEntry parseEntry(EdmEntitySet ees, JsonStreamReader jsr) { name = event.asStartProperty().getName(); ees = addProperty(entry, ees, name, jsr); } catch (IllegalArgumentException e) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name).reason(e); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name).reason(e); } } else if (event.isEndObject()) { break; @@ -252,7 +252,7 @@ protected EdmEntitySet addProperty(JsonEntry entry, EdmEntitySet ees, String nam try { propValue = event.asEndProperty().getObject(); } catch (NumberFormatException e) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name).reason(e); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name).reason(e); } // 型によって登録するEntityPropertyを変更する @@ -272,7 +272,7 @@ protected EdmEntitySet addProperty(JsonEntry entry, EdmEntitySet ees, String nam } } } else { - throw DcCoreException.OData.FIELED_INVALID_ERROR.params("unknown property " + name + " for " + throw PersoniumCoreException.OData.FIELED_INVALID_ERROR.params("unknown property " + name + " for " + entry.getEntityType().getName()); } } else { @@ -282,24 +282,24 @@ protected EdmEntitySet addProperty(JsonEntry entry, EdmEntitySet ees, String nam EdmType type = ep.getType(); if (type.equals(EdmSimpleType.BOOLEAN) && !ODataUtils.validateBoolean(propValue)) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); } else if (type.equals(EdmSimpleType.STRING) && !ODataUtils.validateString(propValue)) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); } else if (type.equals(EdmSimpleType.DATETIME)) { if (!ODataUtils.validateDateTime(propValue)) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); } if (Common.SYSUTCDATETIME.equals(propValue)) { String crrTime = String.valueOf(getCurrentTimeMillis()); propValue = String.format("/Date(%s)/", crrTime); } } else if (type.equals(EdmSimpleType.SINGLE) && !ODataUtils.validateSingle(propValue)) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); } else if (type.equals(EdmSimpleType.INT32) && !ODataUtils.validateInt32(propValue)) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); } else if (type.equals(EdmSimpleType.DOUBLE) && !ODataUtils.validateDouble(propValue)) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); } } if (ep.getType().isSimple()) { @@ -312,7 +312,7 @@ protected EdmEntitySet addProperty(JsonEntry entry, EdmEntitySet ees, String nam (EdmSimpleType) EdmSimpleType.STRING, null)); } else { // ComplexType型で、ComplexType型以外の値が指定された場合("aaa")はエラーとする - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); } } } @@ -326,7 +326,7 @@ protected EdmEntitySet addProperty(JsonEntry entry, EdmEntitySet ees, String nam val.complexObject.getProperties())); } else { // ComplexTypeデータ以外はエラーとする - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); } } else if (event.isStartArray()) { // 配列オブジェクトの場合 @@ -336,7 +336,7 @@ protected EdmEntitySet addProperty(JsonEntry entry, EdmEntitySet ees, String nam EdmProperty eprop = entry.getEntityType().findProperty(name); if (null != eprop && eprop.getCollectionKind() != CollectionKind.NONE) { val.collectionType = new EdmCollectionType(eprop.getCollectionKind(), eprop.getType()); - DcJsonCollectionFormatParser cfp = new DcJsonCollectionFormatParser(val.collectionType, + PersoniumJsonCollectionFormatParser cfp = new PersoniumJsonCollectionFormatParser(val.collectionType, this.metadata, name); val.collection = cfp.parseCollection(jsr); } @@ -345,10 +345,10 @@ protected EdmEntitySet addProperty(JsonEntry entry, EdmEntitySet ees, String nam if (val.collectionType != null && val.collection != null) { entry.properties.add(OProperties.collection(name, val.collectionType, val.collection)); } else { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); } } else { - throw DcCoreException.OData.INVALID_TYPE_ERROR.params(name); + throw PersoniumCoreException.OData.INVALID_TYPE_ERROR.params(name); } return ees; } @@ -378,7 +378,7 @@ protected JsonObjectPropertyValue getValue(JsonEvent event, if (eprop == null) { // プロパティがスキーマ定義上に存在しなければエラーとする - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); } else { // スキーマ定義からComplexType定義を取得する EdmComplexType ct = metadata.findEdmComplexType(eprop.getType().getFullyQualifiedTypeName()); @@ -386,11 +386,11 @@ protected JsonObjectPropertyValue getValue(JsonEvent event, if (null != ct) { // ComplexTypeが存在する場合は、パースを実施してComplexTypeObjectを取得する Settings s = new Settings(version, metadata, entitySetName, entityKey, null, false, ct); - DcJsonComplexObjectFormatParser cofp = new DcJsonComplexObjectFormatParser(s); + PersoniumJsonComplexObjectFormatParser cofp = new PersoniumJsonComplexObjectFormatParser(s); rt.complexObject = cofp.parseSingleObject(jsr, event); } else { // ComplexTypeがスキーマ定義上に存在しなければエラーとする - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(name); } } diff --git a/src/main/java/com/fujitsu/dc/core/odata/DcJsonFormatWriter.java b/src/main/java/io/personium/core/odata/PersoniumJsonFormatWriter.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/odata/DcJsonFormatWriter.java rename to src/main/java/io/personium/core/odata/PersoniumJsonFormatWriter.java index 394490a58..71a697b96 100644 --- a/src/main/java/com/fujitsu/dc/core/odata/DcJsonFormatWriter.java +++ b/src/main/java/io/personium/core/odata/PersoniumJsonFormatWriter.java @@ -34,7 +34,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.odata; +package io.personium.core.odata; import java.io.Writer; import java.util.Iterator; @@ -58,14 +58,14 @@ import org.odata4j.format.json.JsonFormatWriter; import org.odata4j.format.json.JsonWriter; -import com.fujitsu.dc.core.rs.odata.AbstractODataResource; -import com.fujitsu.dc.core.rs.odata.ODataResource; +import io.personium.core.rs.odata.AbstractODataResource; +import io.personium.core.rs.odata.ODataResource; /** - * DcJsonFormatWriterクラス. + * PersoniumJsonFormatWriterクラス. * @param */ -public abstract class DcJsonFormatWriter extends JsonFormatWriter { +public abstract class PersoniumJsonFormatWriter extends JsonFormatWriter { /** * "results". @@ -76,13 +76,13 @@ public abstract class DcJsonFormatWriter extends JsonFormatWriter { * コンストラクタ. * @param jsonpCallback コールバック */ - public DcJsonFormatWriter(String jsonpCallback) { + public PersoniumJsonFormatWriter(String jsonpCallback) { super(jsonpCallback); } @Override public void write(UriInfo uriInfo, Writer w, T target) { - JsonWriter jw = new DcJsonWriter(w); + JsonWriter jw = new PersoniumJsonWriter(w); if (getJsonpCallback() != null) { jw.startCallback(getJsonpCallback()); } @@ -249,7 +249,7 @@ public static String getEntityRelId(EdmEntitySet entitySet, OEntityKey entityKey @Override protected void writeValue(JsonWriter jw, EdmType type, Object pvalue) { if (pvalue != null && type.equals(EdmSimpleType.DOUBLE)) { - ((DcJsonWriter) jw).writeNumber((Double) pvalue); + ((PersoniumJsonWriter) jw).writeNumber((Double) pvalue); } else { super.writeValue(jw, type, pvalue); } diff --git a/src/main/java/com/fujitsu/dc/core/odata/DcJsonSingleLinkFormatWriter.java b/src/main/java/io/personium/core/odata/PersoniumJsonSingleLinkFormatWriter.java similarity index 87% rename from src/main/java/com/fujitsu/dc/core/odata/DcJsonSingleLinkFormatWriter.java rename to src/main/java/io/personium/core/odata/PersoniumJsonSingleLinkFormatWriter.java index e541abfcf..5de3b6c06 100644 --- a/src/main/java/com/fujitsu/dc/core/odata/DcJsonSingleLinkFormatWriter.java +++ b/src/main/java/io/personium/core/odata/PersoniumJsonSingleLinkFormatWriter.java @@ -34,25 +34,25 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.odata; +package io.personium.core.odata; import javax.ws.rs.core.UriInfo; import org.odata4j.format.SingleLink; import org.odata4j.format.json.JsonWriter; -import com.fujitsu.dc.core.rs.odata.AbstractODataResource; +import io.personium.core.rs.odata.AbstractODataResource; /** * JsonEntryFormatWriterのラッパークラス. */ -public class DcJsonSingleLinkFormatWriter extends DcJsonFormatWriter { +public class PersoniumJsonSingleLinkFormatWriter extends PersoniumJsonFormatWriter { /** * コンストラクタ. * @param jsonpCallback コールバック */ - public DcJsonSingleLinkFormatWriter(String jsonpCallback) { + public PersoniumJsonSingleLinkFormatWriter(String jsonpCallback) { super(jsonpCallback); } diff --git a/src/main/java/com/fujitsu/dc/core/odata/DcJsonSingleLinksFormatWriter.java b/src/main/java/io/personium/core/odata/PersoniumJsonSingleLinksFormatWriter.java similarity index 87% rename from src/main/java/com/fujitsu/dc/core/odata/DcJsonSingleLinksFormatWriter.java rename to src/main/java/io/personium/core/odata/PersoniumJsonSingleLinksFormatWriter.java index dc1af267d..fb0e3a26c 100644 --- a/src/main/java/com/fujitsu/dc/core/odata/DcJsonSingleLinksFormatWriter.java +++ b/src/main/java/io/personium/core/odata/PersoniumJsonSingleLinksFormatWriter.java @@ -34,7 +34,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.odata; +package io.personium.core.odata; import javax.ws.rs.core.UriInfo; @@ -45,13 +45,13 @@ /** * JsonEntryFormatWriterのラッパークラス. */ -public class DcJsonSingleLinksFormatWriter extends DcJsonFormatWriter { +public class PersoniumJsonSingleLinksFormatWriter extends PersoniumJsonFormatWriter { /** * コンストラクタ. * @param jsonpCallback コールバック */ - public DcJsonSingleLinksFormatWriter(String jsonpCallback) { + public PersoniumJsonSingleLinksFormatWriter(String jsonpCallback) { super(jsonpCallback); } @@ -68,7 +68,7 @@ protected void writeContent(UriInfo uriInfo, JsonWriter jw, SingleLinks links) { } else { jw.writeSeparator(); } - DcJsonSingleLinkFormatWriter.writeUri(jw, link); + PersoniumJsonSingleLinkFormatWriter.writeUri(jw, link); } jw.endArray(); jw.endObject(); diff --git a/src/main/java/com/fujitsu/dc/core/odata/DcJsonStreamReaderFactory.java b/src/main/java/io/personium/core/odata/PersoniumJsonStreamReaderFactory.java similarity index 93% rename from src/main/java/com/fujitsu/dc/core/odata/DcJsonStreamReaderFactory.java rename to src/main/java/io/personium/core/odata/PersoniumJsonStreamReaderFactory.java index eb7f493c9..a5d21912c 100644 --- a/src/main/java/com/fujitsu/dc/core/odata/DcJsonStreamReaderFactory.java +++ b/src/main/java/io/personium/core/odata/PersoniumJsonStreamReaderFactory.java @@ -34,7 +34,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.odata; +package io.personium.core.odata; import java.io.IOException; import java.io.Reader; @@ -43,25 +43,25 @@ import java.util.Locale; import java.util.Stack; -import com.fujitsu.dc.core.odata.DcJsonStreamReaderFactory.JsonParseException; -import com.fujitsu.dc.core.odata.DcJsonStreamReaderFactory.JsonStreamReader; -import com.fujitsu.dc.core.odata.DcJsonStreamReaderFactory.JsonStreamReader.JsonEndPropertyEvent; -import com.fujitsu.dc.core.odata.DcJsonStreamReaderFactory.JsonStreamReader.JsonEvent; -import com.fujitsu.dc.core.odata.DcJsonStreamReaderFactory.JsonStreamReader.JsonStartPropertyEvent; -import com.fujitsu.dc.core.odata.DcJsonStreamReaderFactory.JsonStreamReader.JsonValueEvent; -import com.fujitsu.dc.core.odata.DcJsonStreamReaderFactory.JsonStreamTokenizer; -import com.fujitsu.dc.core.odata.DcJsonStreamReaderFactory.JsonStreamTokenizer.JsonToken; -import com.fujitsu.dc.core.odata.DcJsonStreamReaderFactory.JsonStreamTokenizer.JsonTokenType; +import io.personium.core.odata.PersoniumJsonStreamReaderFactory.JsonParseException; +import io.personium.core.odata.PersoniumJsonStreamReaderFactory.JsonStreamReader; +import io.personium.core.odata.PersoniumJsonStreamReaderFactory.JsonStreamReader.JsonEndPropertyEvent; +import io.personium.core.odata.PersoniumJsonStreamReaderFactory.JsonStreamReader.JsonEvent; +import io.personium.core.odata.PersoniumJsonStreamReaderFactory.JsonStreamReader.JsonStartPropertyEvent; +import io.personium.core.odata.PersoniumJsonStreamReaderFactory.JsonStreamReader.JsonValueEvent; +import io.personium.core.odata.PersoniumJsonStreamReaderFactory.JsonStreamTokenizer; +import io.personium.core.odata.PersoniumJsonStreamReaderFactory.JsonStreamTokenizer.JsonToken; +import io.personium.core.odata.PersoniumJsonStreamReaderFactory.JsonStreamTokenizer.JsonTokenType; /** - * DcJsonStreamReaderFactory. + * PersoniumJsonStreamReaderFactory. * JSONをストリームで読み込むReaderのファクトリー */ -public class DcJsonStreamReaderFactory { +public class PersoniumJsonStreamReaderFactory { /** * コンストラクタ. */ - private DcJsonStreamReaderFactory() { + private PersoniumJsonStreamReaderFactory() { } /** diff --git a/src/main/java/com/fujitsu/dc/core/odata/DcJsonWriter.java b/src/main/java/io/personium/core/odata/PersoniumJsonWriter.java similarity index 94% rename from src/main/java/com/fujitsu/dc/core/odata/DcJsonWriter.java rename to src/main/java/io/personium/core/odata/PersoniumJsonWriter.java index 29d7e381b..1621698c2 100644 --- a/src/main/java/com/fujitsu/dc/core/odata/DcJsonWriter.java +++ b/src/main/java/io/personium/core/odata/PersoniumJsonWriter.java @@ -34,7 +34,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.odata; +package io.personium.core.odata; import java.io.IOException; import java.io.Writer; @@ -46,7 +46,7 @@ /** * JsonWriterのラッパークラス. */ -public class DcJsonWriter extends JsonWriter { +public class PersoniumJsonWriter extends JsonWriter { private static final int MAX_INTEGER_DIGITS = 15; private static final int MAX_FRACTION_DIGITS = 14; @@ -57,7 +57,7 @@ public class DcJsonWriter extends JsonWriter { * コンストラクタ. * @param writer ライター */ - public DcJsonWriter(Writer writer) { + public PersoniumJsonWriter(Writer writer) { super(writer); this.writer = writer; } diff --git a/src/main/java/com/fujitsu/dc/core/odata/DcODataProducer.java b/src/main/java/io/personium/core/odata/PersoniumODataProducer.java similarity index 91% rename from src/main/java/com/fujitsu/dc/core/odata/DcODataProducer.java rename to src/main/java/io/personium/core/odata/PersoniumODataProducer.java index a838766b5..5a163ffce 100644 --- a/src/main/java/com/fujitsu/dc/core/odata/DcODataProducer.java +++ b/src/main/java/io/personium/core/odata/PersoniumODataProducer.java @@ -34,7 +34,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.odata; +package io.personium.core.odata; import java.util.LinkedHashMap; import java.util.List; @@ -47,14 +47,14 @@ import org.odata4j.producer.EntityResponse; import org.odata4j.producer.ODataProducer; -import com.fujitsu.dc.core.model.impl.es.doc.EntitySetDocHandler; -import com.fujitsu.dc.core.rs.odata.BulkRequest; -import com.fujitsu.dc.core.rs.odata.ODataBatchResource.NavigationPropertyBulkContext; +import io.personium.core.model.impl.es.doc.EntitySetDocHandler; +import io.personium.core.rs.odata.BulkRequest; +import io.personium.core.rs.odata.ODataBatchResource.NavigationPropertyBulkContext; /** * ETag・主キー変更に対応させたODataProducer. */ -public interface DcODataProducer extends ODataProducer { +public interface PersoniumODataProducer extends ODataProducer { /** * ETag・主キー変更対応のEntity更新. * @param entitySetName entitySetName @@ -67,9 +67,9 @@ public interface DcODataProducer extends ODataProducer { * Accountのパスワード変更. * @param entitySetName entitySetName * @param originalKey 更新対象キー - * @param dcCredHeader dcCredHeader + * @param pCredHeader dcCredHeader */ - void updatePassword(final EdmEntitySet entitySetName, final OEntityKey originalKey, final String dcCredHeader); + void updatePassword(final EdmEntitySet entitySetName, final OEntityKey originalKey, final String pCredHeader); /** * Accountの最終ログイン時刻変更. diff --git a/src/main/java/com/fujitsu/dc/core/odata/DcOptionsQueryParser.java b/src/main/java/io/personium/core/odata/PersoniumOptionsQueryParser.java similarity index 81% rename from src/main/java/com/fujitsu/dc/core/odata/DcOptionsQueryParser.java rename to src/main/java/io/personium/core/odata/PersoniumOptionsQueryParser.java index 5b07f133a..9bccc3750 100644 --- a/src/main/java/com/fujitsu/dc/core/odata/DcOptionsQueryParser.java +++ b/src/main/java/io/personium/core/odata/PersoniumOptionsQueryParser.java @@ -34,7 +34,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.odata; +package io.personium.core.odata; import java.util.List; @@ -45,13 +45,13 @@ import org.odata4j.expression.OrderByExpression; import org.odata4j.producer.resources.OptionsQueryParser; -import com.fujitsu.dc.core.DcCoreException; +import io.personium.core.PersoniumCoreException; /** - * DcOptionsQueryParserクラス. + * PersoniumOptionsQueryParserクラス. * OData4jのライブラリのソースよりコピー */ -public final class DcOptionsQueryParser extends OptionsQueryParser { +public final class PersoniumOptionsQueryParser extends OptionsQueryParser { /** * Orderbyのクエリをパースする. @@ -62,7 +62,7 @@ public static List parseOrderBy(String orderBy) { if (orderBy == null) { return null; } - return DcExpressionParser.parseOrderBy(orderBy); + return PersoniumExpressionParser.parseOrderBy(orderBy); } /** @@ -74,14 +74,14 @@ public static BoolCommonExpression parseFilter(String filter) { if (filter == null) { return null; } - CommonExpression ce = DcExpressionParser.parse(filter); + CommonExpression ce = PersoniumExpressionParser.parse(filter); if (ce instanceof BoolCommonExpression) { return (BoolCommonExpression) ce; } if (ce instanceof MethodCallExpression) { - throw DcCoreException.OData.UNSUPPORTED_QUERY_FUNCTION.params(""); + throw PersoniumCoreException.OData.UNSUPPORTED_QUERY_FUNCTION.params(""); } else { - throw DcCoreException.OData.UNSUPPORTED_QUERY_OPERATOR.params(""); + throw PersoniumCoreException.OData.UNSUPPORTED_QUERY_OPERATOR.params(""); } } @@ -94,7 +94,7 @@ public static List parseSelect(String select) { if (select == null) { return null; } - return DcExpressionParser.parseExpand(select); + return PersoniumExpressionParser.parseExpand(select); } /** @@ -106,6 +106,6 @@ public static List parseExpand(String expand) { if (expand == null) { return null; } - return DcExpressionParser.parseExpandQuery(expand); + return PersoniumExpressionParser.parseExpandQuery(expand); } } diff --git a/src/main/java/com/fujitsu/dc/core/odata/package-info.java b/src/main/java/io/personium/core/odata/package-info.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/odata/package-info.java rename to src/main/java/io/personium/core/odata/package-info.java index 03be10343..9c57bb33a 100644 --- a/src/main/java/com/fujitsu/dc/core/odata/package-info.java +++ b/src/main/java/io/personium/core/odata/package-info.java @@ -17,5 +17,5 @@ /** * classes to supplement lacking functionalities of OData4J. */ -package com.fujitsu.dc.core.odata; +package io.personium.core.odata; diff --git a/src/main/java/com/fujitsu/dc/core/package-info.java b/src/main/java/io/personium/core/package-info.java similarity index 93% rename from src/main/java/com/fujitsu/dc/core/package-info.java rename to src/main/java/io/personium/core/package-info.java index e7f2674e1..8a21b6bc1 100644 --- a/src/main/java/com/fujitsu/dc/core/package-info.java +++ b/src/main/java/io/personium/core/package-info.java @@ -17,5 +17,5 @@ /** * 本アプリケーションの基本的なクラス群です. */ -package com.fujitsu.dc.core; +package io.personium.core; diff --git a/src/main/java/com/fujitsu/dc/core/rs/FacadeResource.java b/src/main/java/io/personium/core/rs/FacadeResource.java similarity index 68% rename from src/main/java/com/fujitsu/dc/core/rs/FacadeResource.java rename to src/main/java/io/personium/core/rs/FacadeResource.java index 148c6b89c..8e21ab814 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/FacadeResource.java +++ b/src/main/java/io/personium/core/rs/FacadeResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs; +package io.personium.core.rs; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.CookieParam; @@ -30,14 +30,14 @@ import org.apache.commons.codec.CharEncoding; import org.apache.http.HttpHeaders; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.ModelFactory; -import com.fujitsu.dc.core.model.lock.CellLockManager; -import com.fujitsu.dc.core.rs.cell.CellResource; -import com.fujitsu.dc.core.rs.unit.UnitCtlResource; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.auth.AccessContext; +import io.personium.core.model.Cell; +import io.personium.core.model.ModelFactory; +import io.personium.core.model.lock.CellLockManager; +import io.personium.core.rs.cell.CellResource; +import io.personium.core.rs.unit.UnitCtlResource; /** * すべてのリクエストの入り口となるJax-RS Resource. @@ -50,42 +50,42 @@ public class FacadeResource { /** * クッキー認証の際、クッキー内に埋め込まれている情報のキー. */ - public static final String DC_COOKIE_KEY = "dc_cookie"; + public static final String p_cookie_KEY = "p_cookie"; /** * クッキー認証の際、クエリパラメタに指定されるキー. */ - public static final String COOKIE_PEER_QUERY_KEY = "dc_cookie_peer"; + public static final String COOKIE_PEER_QUERY_KEY = "p_cookie_peer"; /** - * @param cookieAuthValue クッキー内の dc_cookieキーに指定された値 - * @param cookiePeer dc_cookie_peerクエリに指定された値 + * @param cookieAuthValue クッキー内の p_cookieキーに指定された値 + * @param cookiePeer p_cookie_peerクエリに指定された値 * @param authzHeaderValue Authorization ヘッダ * @param host Host ヘッダ * @param uriInfo UriInfo - * @param xDcUnitUser X-Dc-UnitUserヘッダ + * @param xPersoniumUnitUser X-Personium-UnitUserヘッダ * @param httpServletRequest HttpServletRequest * @return CellResourceオブジェクトまたはResponseオブジェクト */ @Path("{path1}") public final Object facade( - @CookieParam(DC_COOKIE_KEY) final String cookieAuthValue, + @CookieParam(p_cookie_KEY) final String cookieAuthValue, @QueryParam(COOKIE_PEER_QUERY_KEY) final String cookiePeer, @HeaderParam(HttpHeaders.AUTHORIZATION) final String authzHeaderValue, @HeaderParam(HttpHeaders.HOST) final String host, - @HeaderParam(DcCoreUtils.HttpHeaders.X_DC_UNIT_USER) final String xDcUnitUser, + @HeaderParam(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_UNIT_USER) final String xPersoniumUnitUser, @Context final UriInfo uriInfo, @Context HttpServletRequest httpServletRequest) { Cell cell = ModelFactory.cell(uriInfo); AccessContext ac = AccessContext.create(authzHeaderValue, uriInfo, cookiePeer, cookieAuthValue, cell, uriInfo.getBaseUri().toString(), - host, xDcUnitUser); + host, xPersoniumUnitUser); if (cell == null) { - throw DcCoreException.Dav.CELL_NOT_FOUND; + throw PersoniumCoreException.Dav.CELL_NOT_FOUND; } long cellStatus = CellLockManager.getCellStatus(cell.getId()); if (cellStatus == CellLockManager.CELL_STATUS_BULK_DELETION) { - throw DcCoreException.Dav.CELL_NOT_FOUND; + throw PersoniumCoreException.Dav.CELL_NOT_FOUND; } CellLockManager.incrementReferenceCount(cell.getId()); @@ -94,32 +94,32 @@ public final Object facade( } /** - * @param cookieAuthValue クッキー内の dc_cookieキーに指定された値 - * @param cookiePeer dc_cookie_peerクエリに指定された値 + * @param cookieAuthValue クッキー内の p_cookieキーに指定された値 + * @param cookiePeer p_cookie_peerクエリに指定された値 * @param authzHeaderValue Authorization ヘッダ * @param host Host ヘッダ - * @param xDcUnitUser ヘッダ + * @param xPersoniumUnitUser ヘッダ * @param uriInfo UriInfo * @return UnitCtlResourceオブジェクト */ @Path("__ctl") public final UnitCtlResource ctl( - @CookieParam(DC_COOKIE_KEY) final String cookieAuthValue, + @CookieParam(p_cookie_KEY) final String cookieAuthValue, @QueryParam(COOKIE_PEER_QUERY_KEY) final String cookiePeer, @HeaderParam(HttpHeaders.AUTHORIZATION) final String authzHeaderValue, @HeaderParam(HttpHeaders.HOST) final String host, - @HeaderParam(DcCoreUtils.HttpHeaders.X_DC_UNIT_USER) final String xDcUnitUser, + @HeaderParam(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_UNIT_USER) final String xPersoniumUnitUser, @Context final UriInfo uriInfo) { AccessContext ac = AccessContext.create(authzHeaderValue, uriInfo, cookiePeer, cookieAuthValue, null, uriInfo.getBaseUri().toString(), - host, xDcUnitUser); + host, xPersoniumUnitUser); return new UnitCtlResource(ac, uriInfo); } /** * @param authzHeaderValue Authorization ヘッダ * @param host Host ヘッダ - * @param xDcUnitUser ヘッダ + * @param xPersoniumUnitUser ヘッダ * @param uriInfo UriInfo * @return UnitCtlResourceオブジェクト */ @@ -127,12 +127,12 @@ public final UnitCtlResource ctl( public final StatusResource status( @HeaderParam(HttpHeaders.AUTHORIZATION) final String authzHeaderValue, @HeaderParam(HttpHeaders.HOST) final String host, - @HeaderParam(DcCoreUtils.HttpHeaders.X_DC_UNIT_USER) final String xDcUnitUser, + @HeaderParam(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_UNIT_USER) final String xPersoniumUnitUser, @Context final UriInfo uriInfo) { return new StatusResource(); } - static final String CROSSDOMAIN_XML = DcCoreUtils.readStringResource("crossdomain.xml", CharEncoding.UTF_8); + static final String CROSSDOMAIN_XML = PersoniumCoreUtils.readStringResource("crossdomain.xml", CharEncoding.UTF_8); /** * Crossdomain.xmlを返します。 diff --git a/src/main/java/com/fujitsu/dc/core/rs/DcCoreApplication.java b/src/main/java/io/personium/core/rs/PersoniumCoreApplication.java similarity index 60% rename from src/main/java/com/fujitsu/dc/core/rs/DcCoreApplication.java rename to src/main/java/io/personium/core/rs/PersoniumCoreApplication.java index fc51d385b..4193410ee 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/DcCoreApplication.java +++ b/src/main/java/io/personium/core/rs/PersoniumCoreApplication.java @@ -14,30 +14,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs; +package io.personium.core.rs; import java.util.HashSet; import java.util.Set; import javax.ws.rs.core.Application; -import com.fujitsu.dc.common.auth.token.LocalToken; -import com.fujitsu.dc.common.auth.token.TransCellAccessToken; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreLog; +import io.personium.common.auth.token.LocalToken; +import io.personium.common.auth.token.TransCellAccessToken; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreLog; /** - * DC-Coreの/_cell_/* 以下URLを担当するJAX-RSのApplication. + * Personium-coreの/_cell_/* 以下URLを担当するJAX-RSのApplication. */ -public class DcCoreApplication extends Application { +public class PersoniumCoreApplication extends Application { static { try { - TransCellAccessToken.configureX509(DcCoreConfig.getX509PrivateKey(), DcCoreConfig.getX509Certificate(), - DcCoreConfig.getX509RootCertificate()); - LocalToken.setKeyString(DcCoreConfig.getTokenSecretKey()); + TransCellAccessToken.configureX509(PersoniumUnitConfig.getX509PrivateKey(), PersoniumUnitConfig.getX509Certificate(), + PersoniumUnitConfig.getX509RootCertificate()); + LocalToken.setKeyString(PersoniumUnitConfig.getTokenSecretKey()); } catch (Exception e) { - DcCoreLog.Server.FAILED_TO_START_SERVER.reason(e).writeLog(); + PersoniumCoreLog.Server.FAILED_TO_START_SERVER.reason(e).writeLog(); throw new RuntimeException(e); } } @@ -49,7 +49,7 @@ public class DcCoreApplication extends Application { @Override public final Set> getClasses() { Set> classes = new HashSet>(); - classes.add(DcCoreExceptionMapper.class); + classes.add(PersoniumCoreExceptionMapper.class); // classes.add(UnitCtlResource.class); // classes.add(CellResource.class); classes.add(FacadeResource.class); diff --git a/src/main/java/com/fujitsu/dc/core/rs/DcCoreExceptionMapper.java b/src/main/java/io/personium/core/rs/PersoniumCoreExceptionMapper.java similarity index 69% rename from src/main/java/com/fujitsu/dc/core/rs/DcCoreExceptionMapper.java rename to src/main/java/io/personium/core/rs/PersoniumCoreExceptionMapper.java index 491455c1c..1a0a7a974 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/DcCoreExceptionMapper.java +++ b/src/main/java/io/personium/core/rs/PersoniumCoreExceptionMapper.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs; +package io.personium.core.rs; import java.util.UUID; @@ -27,30 +27,30 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.DcCoreMessageUtils.Severity; -import com.fujitsu.dc.core.exceptions.ODataErrorMessage; +import io.personium.core.PersoniumCoreException; +import io.personium.core.PersoniumCoreMessageUtils.Severity; +import io.personium.core.exceptions.ODataErrorMessage; /** * 本アプリケーションの例外マッパー. ログ出力と適切な形でのエラー応答出力を行う。 */ @Provider -public final class DcCoreExceptionMapper implements ExceptionMapper { +public final class PersoniumCoreExceptionMapper implements ExceptionMapper { static final int ERROR_ID_ROOT = 100000; - static Logger log = LoggerFactory.getLogger(DcCoreExceptionMapper.class); + static Logger log = LoggerFactory.getLogger(PersoniumCoreExceptionMapper.class); @Override public Response toResponse(final Exception exception) { - // DcCoreException ならば - if (exception instanceof DcCoreException) { - return this.handleDcCoreException((DcCoreException) exception); + // PersoniumCoreException ならば + if (exception instanceof PersoniumCoreException) { + return this.handlePersoniumCoreException((PersoniumCoreException) exception); } // JaxRS例外 ならば if (exception instanceof WebApplicationException) { return this.handleWebApplicationException((WebApplicationException) exception); } /* - * DcCoreException以外の例外の扱い。ただし、WebApplicationExceptionやそのサブクラスを投げられると、 + * PersoniumCoreException以外の例外の扱い。ただし、WebApplicationExceptionやそのサブクラスを投げられると、 * JAX-RS層で処理されてしまい、ここには来ない模様。(Jerseyではそうなっている) */ // ログ出力 @@ -70,15 +70,15 @@ public Response toResponse(final Exception exception) { } /* - * DcCoreExceptionの扱い。 + * PersoniumCoreExceptionの扱い。 */ - private Response handleDcCoreException(final DcCoreException dcCoreException) { - Severity sv = dcCoreException.getSeverity(); - String code = dcCoreException.getCode(); - String message = dcCoreException.getMessage(); - Response res = dcCoreException.createResponse(); + private Response handlePersoniumCoreException(final PersoniumCoreException pce) { + Severity sv = pce.getSeverity(); + String code = pce.getCode(); + String message = pce.getMessage(); + Response res = pce.createResponse(); String format = String.format("[%s] - %s", code, message); - Throwable cause = dcCoreException.getCause(); + Throwable cause = pce.getCause(); // ログ出力 switch (sv) { case INFO: @@ -91,18 +91,18 @@ private Response handleDcCoreException(final DcCoreException dcCoreException) { log.error(format, cause); break; default: - log.error("Exception Severity Not Defined", dcCoreException); + log.error("Exception Severity Not Defined", pce); } return res; } /* - * DcCoreExceptionの扱い。 + * PersoniumCoreExceptionの扱い。 */ private Response handleWebApplicationException(final WebApplicationException webappException) { Response res = webappException.getResponse(); if (HttpStatus.SC_METHOD_NOT_ALLOWED == res.getStatus()) { - return this.handleDcCoreException(DcCoreException.Misc.METHOD_NOT_ALLOWED); + return this.handlePersoniumCoreException(PersoniumCoreException.Misc.METHOD_NOT_ALLOWED); } return res; } diff --git a/src/main/java/com/fujitsu/dc/core/rs/StatusResource.java b/src/main/java/io/personium/core/rs/StatusResource.java similarity index 87% rename from src/main/java/com/fujitsu/dc/core/rs/StatusResource.java rename to src/main/java/io/personium/core/rs/StatusResource.java index a9ed62b64..2e1d2346c 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/StatusResource.java +++ b/src/main/java/io/personium/core/rs/StatusResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs; +package io.personium.core.rs; import java.util.Properties; @@ -29,9 +29,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.es.EsClient; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.model.impl.es.EsModel; +import io.personium.common.es.EsClient; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.model.impl.es.EsModel; /** * StatusResourceに対応するJAX-RS Resource クラス. @@ -52,7 +52,7 @@ public Response get() { StringBuilder sb = new StringBuilder(); // プロパティ一覧 - Properties props = DcCoreConfig.getProperties(); + Properties props = PersoniumUnitConfig.getProperties(); JSONObject responseJson = new JSONObject(); JSONObject propertiesJson = new JSONObject(); for (String key : props.stringPropertyNames()) { @@ -84,7 +84,7 @@ public Response get() { @POST public Response post() { // プロパティリロード - DcCoreConfig.reload(); + PersoniumUnitConfig.reload(); return Response.status(HttpStatus.SC_NO_CONTENT).build(); } @@ -94,7 +94,7 @@ public Response post() { */ Boolean checkAds() { try { - Properties p = DcCoreConfig.getEsAdsDbcpProps(); + Properties p = PersoniumUnitConfig.getEsAdsDbcpProps(); BasicDataSourceFactory.createDataSource(p); return true; } catch (Exception e) { diff --git a/src/main/java/com/fujitsu/dc/core/rs/box/BoxResource.java b/src/main/java/io/personium/core/rs/box/BoxResource.java similarity index 81% rename from src/main/java/com/fujitsu/dc/core/rs/box/BoxResource.java rename to src/main/java/io/personium/core/rs/box/BoxResource.java index 1bc51aec9..2e531a2b8 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/box/BoxResource.java +++ b/src/main/java/io/personium/core/rs/box/BoxResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.box; +package io.personium.core.rs.box; import java.io.InputStream; import java.io.Reader; @@ -44,28 +44,29 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.annotations.ACL; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.auth.BoxPrivilege; -import com.fujitsu.dc.core.bar.BarFileInstaller; -import com.fujitsu.dc.core.eventbus.DcEventBus; -import com.fujitsu.dc.core.eventbus.JSONEvent; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.BoxCmp; -import com.fujitsu.dc.core.model.BoxRsCmp; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.DavRsCmp; -import com.fujitsu.dc.core.model.ModelFactory; -import com.fujitsu.dc.core.model.ctl.Event; -import com.fujitsu.dc.core.model.ctl.Event.LEVEL; -import com.fujitsu.dc.core.model.progress.Progress; -import com.fujitsu.dc.core.model.progress.ProgressInfo; -import com.fujitsu.dc.core.model.progress.ProgressManager; -import com.fujitsu.dc.core.rs.cell.CellCtlResource; -import com.fujitsu.dc.core.rs.cell.EventResource; -import com.fujitsu.dc.core.rs.odata.ODataEntityResource; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.annotations.ACL; +import io.personium.core.auth.AccessContext; +import io.personium.core.auth.BoxPrivilege; +import io.personium.core.bar.BarFileInstaller; +import io.personium.core.eventbus.PersoniumEventBus; +import io.personium.core.eventbus.JSONEvent; +import io.personium.core.model.Box; +import io.personium.core.model.BoxCmp; +import io.personium.core.model.BoxRsCmp; +import io.personium.core.model.Cell; +import io.personium.core.model.CellRsCmp; +import io.personium.core.model.DavRsCmp; +import io.personium.core.model.ModelFactory; +import io.personium.core.model.ctl.Event; +import io.personium.core.model.ctl.Event.LEVEL; +import io.personium.core.model.progress.Progress; +import io.personium.core.model.progress.ProgressInfo; +import io.personium.core.model.progress.ProgressManager; +import io.personium.core.rs.cell.CellCtlResource; +import io.personium.core.rs.cell.EventResource; +import io.personium.core.rs.odata.ODataEntityResource; /** * JAX-RS Resource for Box root URL. @@ -90,7 +91,7 @@ public final class BoxResource { * @param jaxRsRequest JAX-RS用HTTPリクエスト */ public BoxResource(final Cell cell, final String boxName, final AccessContext accessContext, - final DavRsCmp cellRsCmp, final HttpServletRequest request, Request jaxRsRequest) { + final CellRsCmp cellRsCmp, final HttpServletRequest request, Request jaxRsRequest) { // 親はなし。パス名としてとりあえずboxNameをいれておく。 this.cell = cell; this.boxName = boxName; @@ -109,7 +110,7 @@ public BoxResource(final Cell cell, final String boxName, final AccessContext ac if (this.box != null) { //BoxCmp is necessary only if this Box exists BoxCmp davCmp = ModelFactory.boxCmp(this.box); - this.davRsCmp = new BoxRsCmp(davCmp, this.cell, this.accessContext, this.box); + this.davRsCmp = new BoxRsCmp(cellRsCmp, davCmp, this.accessContext, this.box); } else { //This box does not exist. String reqPathInfo = request.getPathInfo(); @@ -122,7 +123,7 @@ public BoxResource(final Cell cell, final String boxName, final AccessContext ac } // Unless the HTTP method is MKCOL, respond with 404. if (!("MKCOL".equals(jaxRsRequest.getMethod()) && reqPathInfo.endsWith(pathForBox))) { - throw DcCoreException.Dav.BOX_NOT_FOUND.params(this.cell.getUrl() + boxName); + throw PersoniumCoreException.Dav.BOX_NOT_FOUND.params(this.cell.getUrl() + boxName); } } @@ -202,7 +203,7 @@ public Response get() { try { jsonObj = (JSONObject) (new JSONParser()).parse(jsonString); } catch (ParseException e) { - throw DcCoreException.Server.DATA_STORE_UNKNOWN_ERROR.reason(e); + throw PersoniumCoreException.Server.DATA_STORE_UNKNOWN_ERROR.reason(e); } // キャッシュから取得できたが、boxインストールの処理状況ではない場合 @@ -266,7 +267,7 @@ private JSONObject createResponse(JSONObject values) { */ @WebDAVMethod.PROPFIND public Response propfind(final Reader requestBodyXml, - @HeaderParam(DcCoreUtils.HttpHeaders.DEPTH) final String depth, + @HeaderParam(PersoniumCoreUtils.HttpHeaders.DEPTH) final String depth, @HeaderParam(HttpHeaders.CONTENT_LENGTH) final Long contentLength, @HeaderParam("Transfer-Encoding") final String transferEncoding) { @@ -310,7 +311,7 @@ public Response acl(final Reader reader) { /** * MKCOLメソッドの処理. boxインストールを行う. * @param uriInfo UriInfo - * @param dcCredHeader dcCredHeader + * @param pCredHeader dcCredHeader * @param contentType Content-Typeヘッダの値 * @param contentLength Content-Lengthヘッダの値 * @param requestKey イベントログに出力するRequestKeyフィールドの値 @@ -320,13 +321,13 @@ public Response acl(final Reader reader) { @WebDAVMethod.MKCOL public Response mkcol( @Context final UriInfo uriInfo, - @HeaderParam(DcCoreUtils.HttpHeaders.X_DC_CREDENTIAL) final String dcCredHeader, + @HeaderParam(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_CREDENTIAL) final String pCredHeader, @HeaderParam(HttpHeaders.CONTENT_TYPE) final String contentType, @HeaderParam(HttpHeaders.CONTENT_LENGTH) final String contentLength, - @HeaderParam(DcCoreUtils.HttpHeaders.X_DC_REQUESTKEY) String requestKey, + @HeaderParam(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_REQUESTKEY) String requestKey, final InputStream inStream) { - DcEventBus eventBus = new DcEventBus(this.cell); + PersoniumEventBus eventBus = new PersoniumEventBus(this.cell); Event event = null; Response res = null; try { @@ -336,8 +337,8 @@ public Response mkcol( reqBody.setLevel(LEVEL.INFO); reqBody.setObject(this.cell.getUrl() + boxName); reqBody.setResult(""); - // X-Dc-RequestKeyの解析(指定なしの場合にデフォルト値を補充) - requestKey = EventResource.validateXDcRequestKey(requestKey); + // X-Personium-RequestKeyの解析(指定なしの場合にデフォルト値を補充) + requestKey = EventResource.validateXPersoniumRequestKey(requestKey); // TODO findBugs対策↓ log.debug(requestKey); @@ -345,11 +346,11 @@ public Response mkcol( // eventBus.outputEventLog(event); if (Box.DEFAULT_BOX_NAME.equals(this.boxName)) { - throw DcCoreException.Misc.METHOD_NOT_ALLOWED; + throw PersoniumCoreException.Misc.METHOD_NOT_ALLOWED; } // Boxを作成するためにCellCtlResource、ODataEntityResource(ODataProducer)が必要 - // この時点では "X-Dc-Credential" ヘッダーは不要なのでnullを指定する + // この時点では "X-Personium-Credential" ヘッダーは不要なのでnullを指定する CellCtlResource cellctl = new CellCtlResource(this.accessContext, null, this.cellRsCmp); String keyName = "'" + this.boxName + "'"; ODataEntityResource odataEntity = new ODataEntityResource(cellctl, Box.EDM_TYPE_NAME, keyName); @@ -358,7 +359,7 @@ public Response mkcol( headers.put(HttpHeaders.CONTENT_TYPE, contentType); headers.put(HttpHeaders.CONTENT_LENGTH, contentLength); - // X-Dc-RequestKeyの解析(指定なしの場合にデフォルト値を補充) + // X-Personium-RequestKeyの解析(指定なしの場合にデフォルト値を補充) BarFileInstaller installer = new BarFileInstaller(this.cell, this.boxName, odataEntity, uriInfo); @@ -366,9 +367,9 @@ public Response mkcol( event.setResult(Integer.toString(res.getStatus())); } catch (RuntimeException e) { // TODO 内部イベントの正式対応が必要 - if (e instanceof DcCoreException) { - event.setResult(Integer.toString(((DcCoreException) e).getStatus())); - if (((DcCoreException) e).getStatus() > HttpStatus.SC_INTERNAL_SERVER_ERROR) { + if (e instanceof PersoniumCoreException) { + event.setResult(Integer.toString(((PersoniumCoreException) e).getStatus())); + if (((PersoniumCoreException) e).getStatus() > HttpStatus.SC_INTERNAL_SERVER_ERROR) { event.setLevel(LEVEL.WARN); } else { event.setLevel(LEVEL.ERROR); @@ -396,6 +397,6 @@ public Response move( // Boxリソースに対するMOVEメソッドは使用禁止 this.davRsCmp.checkAccessContext(this.davRsCmp.getAccessContext(), BoxPrivilege.WRITE); - throw DcCoreException.Dav.RESOURCE_PROHIBITED_TO_MOVE_BOX; + throw PersoniumCoreException.Dav.RESOURCE_PROHIBITED_TO_MOVE_BOX; } } diff --git a/src/main/java/com/fujitsu/dc/core/rs/box/DavCollectionResource.java b/src/main/java/io/personium/core/rs/box/DavCollectionResource.java similarity index 81% rename from src/main/java/com/fujitsu/dc/core/rs/box/DavCollectionResource.java rename to src/main/java/io/personium/core/rs/box/DavCollectionResource.java index f48562394..8709f2a22 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/box/DavCollectionResource.java +++ b/src/main/java/io/personium/core/rs/box/DavCollectionResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.box; +package io.personium.core.rs.box; import java.io.Reader; @@ -33,13 +33,13 @@ import org.apache.http.HttpStatus; import org.apache.wink.webdav.WebDAVMethod; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.annotations.ACL; -import com.fujitsu.dc.core.auth.BoxPrivilege; -import com.fujitsu.dc.core.model.DavCmp; -import com.fujitsu.dc.core.model.DavMoveResource; -import com.fujitsu.dc.core.model.DavRsCmp; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.annotations.ACL; +import io.personium.core.auth.BoxPrivilege; +import io.personium.core.model.DavCmp; +import io.personium.core.model.DavMoveResource; +import io.personium.core.model.DavRsCmp; /** * プレーンなWebDAVコレクションに対応するJAX-RS Resource クラス. @@ -89,14 +89,14 @@ public Response proppatch(final Reader requestBodyXml) { * @return JAX-RS応答オブジェクト */ @DELETE - public Response delete(@HeaderParam(DcCoreUtils.HttpHeaders.X_DC_RECURSIVE) final String recursiveHeader) { + public Response delete(@HeaderParam(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_RECURSIVE) final String recursiveHeader) { boolean recursive = false; - // X-Dc-Recursive Header + // X-Personium-Recursive Header if (recursiveHeader != null) { try { recursive = Boolean.valueOf(recursiveHeader); } catch (Exception e) { - throw DcCoreException.Misc.PRECONDITION_FAILED.params(DcCoreUtils.HttpHeaders.X_DC_RECURSIVE); + throw PersoniumCoreException.Misc.PRECONDITION_FAILED.params(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_RECURSIVE); } } // アクセス制御(親の権限をチェックする) @@ -118,7 +118,7 @@ public Response delete(@HeaderParam(DcCoreUtils.HttpHeaders.X_DC_RECURSIVE) fina */ @WebDAVMethod.PROPFIND public Response propfind(final Reader requestBodyXml, - @HeaderParam(DcCoreUtils.HttpHeaders.DEPTH) final String depth, + @HeaderParam(PersoniumCoreUtils.HttpHeaders.DEPTH) final String depth, @HeaderParam(HttpHeaders.CONTENT_LENGTH) final Long contentLength, @HeaderParam("Transfer-Encoding") final String transferEncoding) { @@ -148,7 +148,7 @@ public Response mkcol() { // アクセス制御 this.davRsCmp.checkAccessContext(this.davRsCmp.getAccessContext(), BoxPrivilege.WRITE); - throw DcCoreException.Dav.METHOD_NOT_ALLOWED; + throw PersoniumCoreException.Dav.METHOD_NOT_ALLOWED; } /** @@ -172,15 +172,15 @@ public Response options() { // アクセス制御 this.davRsCmp.checkAccessContext(this.davRsCmp.getAccessContext(), BoxPrivilege.READ); - return DcCoreUtils.responseBuilderForOptions( + return PersoniumCoreUtils.responseBuilderForOptions( HttpMethod.GET, HttpMethod.PUT, HttpMethod.DELETE, - com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.MKCOL, - com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.MOVE, - com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPFIND, - com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPPATCH, - com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.ACL + io.personium.common.utils.PersoniumCoreUtils.HttpMethod.MKCOL, + io.personium.common.utils.PersoniumCoreUtils.HttpMethod.MOVE, + io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPFIND, + io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPPATCH, + io.personium.common.utils.PersoniumCoreUtils.HttpMethod.ACL ).build(); } diff --git a/src/main/java/com/fujitsu/dc/core/rs/box/DavFileResource.java b/src/main/java/io/personium/core/rs/box/DavFileResource.java similarity index 86% rename from src/main/java/com/fujitsu/dc/core/rs/box/DavFileResource.java rename to src/main/java/io/personium/core/rs/box/DavFileResource.java index b4e194d8c..af4543ede 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/box/DavFileResource.java +++ b/src/main/java/io/personium/core/rs/box/DavFileResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.box; +package io.personium.core.rs.box; import java.io.InputStream; import java.io.Reader; @@ -32,12 +32,12 @@ import org.apache.wink.webdav.WebDAVMethod; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.annotations.ACL; -import com.fujitsu.dc.core.auth.BoxPrivilege; -import com.fujitsu.dc.core.model.DavCmp; -import com.fujitsu.dc.core.model.DavMoveResource; -import com.fujitsu.dc.core.model.DavRsCmp; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.annotations.ACL; +import io.personium.core.auth.BoxPrivilege; +import io.personium.core.model.DavCmp; +import io.personium.core.model.DavMoveResource; +import io.personium.core.model.DavRsCmp; /** * JAX-RS Resource class for a plain WebDAV file resource. @@ -130,7 +130,7 @@ public Response proppatch(final Reader requestBodyXml) { */ @WebDAVMethod.PROPFIND public Response propfind(final Reader requestBodyXml, - @HeaderParam(DcCoreUtils.HttpHeaders.DEPTH) final String depth, + @HeaderParam(PersoniumCoreUtils.HttpHeaders.DEPTH) final String depth, @HeaderParam(HttpHeaders.CONTENT_LENGTH) final Long contentLength, @HeaderParam("Transfer-Encoding") final String transferEncoding) { @@ -172,14 +172,14 @@ public Response move( public Response options() { // Access Control this.davRsCmp.checkAccessContext(this.davRsCmp.getAccessContext(), BoxPrivilege.READ); - return DcCoreUtils.responseBuilderForOptions( + return PersoniumCoreUtils.responseBuilderForOptions( HttpMethod.GET, HttpMethod.PUT, HttpMethod.DELETE, - com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.MOVE, - com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPFIND, - com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPPATCH, - com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.ACL + io.personium.common.utils.PersoniumCoreUtils.HttpMethod.MOVE, + io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPFIND, + io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPPATCH, + io.personium.common.utils.PersoniumCoreUtils.HttpMethod.ACL ).build(); } } diff --git a/src/main/java/com/fujitsu/dc/core/rs/box/NullResource.java b/src/main/java/io/personium/core/rs/box/NullResource.java similarity index 81% rename from src/main/java/com/fujitsu/dc/core/rs/box/NullResource.java rename to src/main/java/io/personium/core/rs/box/NullResource.java index 518ec2bc1..16bc710e5 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/box/NullResource.java +++ b/src/main/java/io/personium/core/rs/box/NullResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.box; +package io.personium.core.rs.box; import java.io.IOException; import java.io.InputStream; @@ -44,19 +44,19 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.annotations.ACL; -import com.fujitsu.dc.core.annotations.REPORT; -import com.fujitsu.dc.core.auth.BoxPrivilege; -import com.fujitsu.dc.core.model.DavCmp; -import com.fujitsu.dc.core.model.DavCommon; -import com.fujitsu.dc.core.model.DavRsCmp; -import com.fujitsu.dc.core.model.jaxb.Mkcol; -import com.fujitsu.dc.core.model.jaxb.Mkcol.RequestException; -import com.fujitsu.dc.core.model.jaxb.MkcolResponse; -import com.fujitsu.dc.core.model.jaxb.ObjectFactory; -import com.fujitsu.dc.core.model.jaxb.ObjectIo; -import com.fujitsu.dc.core.utils.ResourceUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.annotations.ACL; +import io.personium.core.annotations.REPORT; +import io.personium.core.auth.BoxPrivilege; +import io.personium.core.model.DavCmp; +import io.personium.core.model.DavCommon; +import io.personium.core.model.DavRsCmp; +import io.personium.core.model.jaxb.Mkcol; +import io.personium.core.model.jaxb.Mkcol.RequestException; +import io.personium.core.model.jaxb.MkcolResponse; +import io.personium.core.model.jaxb.ObjectFactory; +import io.personium.core.model.jaxb.ObjectIo; +import io.personium.core.utils.ResourceUtils; /** * Box以下の存在しないパスを担当するJAX-RSリソース. @@ -88,7 +88,7 @@ public final Response get() { // アクセス制御 this.davRsCmp.checkAccessContext(this.davRsCmp.getAccessContext(), BoxPrivilege.READ); - throw DcCoreException.Dav.RESOURCE_NOT_FOUND.params(this.davRsCmp.getUrl()); + throw PersoniumCoreException.Dav.RESOURCE_NOT_FOUND.params(this.davRsCmp.getUrl()); } /** @@ -112,11 +112,11 @@ public final Response put( */ if (!DavCommon.isValidResourceName(this.davRsCmp.getDavCmp().getName())) { - throw DcCoreException.Dav.RESOURCE_NAME_INVALID; + throw PersoniumCoreException.Dav.RESOURCE_NAME_INVALID; } if (this.isParentNull) { - throw DcCoreException.Dav.HAS_NOT_PARENT.params(this.davRsCmp.getParent().getUrl()); + throw PersoniumCoreException.Dav.HAS_NOT_PARENT.params(this.davRsCmp.getParent().getUrl()); } return this.davRsCmp.getDavCmp().putForCreate(contentType, inputStream).build(); @@ -145,11 +145,11 @@ public Response mkcol(@HeaderParam(HttpHeaders.CONTENT_TYPE) final String conten * have been created. */ if (this.isParentNull) { - throw DcCoreException.Dav.HAS_NOT_PARENT.params(this.davRsCmp.getParent().getUrl()); + throw PersoniumCoreException.Dav.HAS_NOT_PARENT.params(this.davRsCmp.getParent().getUrl()); } if (!DavCommon.isValidResourceName(this.davRsCmp.getDavCmp().getName())) { - throw DcCoreException.Dav.RESOURCE_NAME_INVALID; + throw PersoniumCoreException.Dav.RESOURCE_NAME_INVALID; } // リクエストが空なら素直にwebdavでコレクションを作成する @@ -162,12 +162,12 @@ public Response mkcol(@HeaderParam(HttpHeaders.CONTENT_TYPE) final String conten try { mkcol = ObjectIo.unmarshal(inputStream, Mkcol.class); } catch (Exception e1) { - throw DcCoreException.Dav.XML_ERROR.reason(e1); + throw PersoniumCoreException.Dav.XML_ERROR.reason(e1); } ObjectFactory factory = new ObjectFactory(); String colType; try { - colType = mkcol.getDcColType(); + colType = mkcol.getWebdavColType(); log.debug(colType); Response response = this.davRsCmp.getDavCmp().mkcol(colType).build(); // ServiceCollectionの場合は、ServiceSource用のWebdavCollectionを生成する @@ -227,7 +227,7 @@ public final Response delete() { // アクセス制御 this.davRsCmp.checkAccessContext(this.davRsCmp.getAccessContext(), BoxPrivilege.WRITE); - throw DcCoreException.Dav.RESOURCE_NOT_FOUND.params(this.davRsCmp.getUrl()); + throw PersoniumCoreException.Dav.RESOURCE_NOT_FOUND.params(this.davRsCmp.getUrl()); } /** @@ -239,7 +239,7 @@ public final Response post() { // アクセス制御 this.davRsCmp.checkAccessContext(this.davRsCmp.getAccessContext(), BoxPrivilege.WRITE); - throw DcCoreException.Dav.RESOURCE_NOT_FOUND.params(this.davRsCmp.getUrl()); + throw PersoniumCoreException.Dav.RESOURCE_NOT_FOUND.params(this.davRsCmp.getUrl()); } /** @@ -251,7 +251,7 @@ public final Response report() { // アクセス制御 this.davRsCmp.checkAccessContext(this.davRsCmp.getAccessContext(), BoxPrivilege.READ); - throw DcCoreException.Dav.RESOURCE_NOT_FOUND.params(this.davRsCmp.getUrl()); + throw PersoniumCoreException.Dav.RESOURCE_NOT_FOUND.params(this.davRsCmp.getUrl()); } /** @@ -263,7 +263,7 @@ public final Response propfind() { // アクセス制御 this.davRsCmp.checkAccessContext(this.davRsCmp.getAccessContext(), BoxPrivilege.READ); - throw DcCoreException.Dav.RESOURCE_NOT_FOUND.params(this.davRsCmp.getUrl()); + throw PersoniumCoreException.Dav.RESOURCE_NOT_FOUND.params(this.davRsCmp.getUrl()); } /** @@ -275,7 +275,7 @@ public final Response proppatch() { // アクセス制御 this.davRsCmp.checkAccessContext(this.davRsCmp.getAccessContext(), BoxPrivilege.WRITE); - throw DcCoreException.Dav.RESOURCE_NOT_FOUND.params(this.davRsCmp.getUrl()); + throw PersoniumCoreException.Dav.RESOURCE_NOT_FOUND.params(this.davRsCmp.getUrl()); } /** @@ -287,7 +287,7 @@ public final Response acl() { // アクセス制御 this.davRsCmp.checkAccessContext(this.davRsCmp.getAccessContext(), BoxPrivilege.WRITE); - throw DcCoreException.Dav.RESOURCE_NOT_FOUND.params(this.davRsCmp.getUrl()); + throw PersoniumCoreException.Dav.RESOURCE_NOT_FOUND.params(this.davRsCmp.getUrl()); } /** @@ -299,7 +299,7 @@ public final Response move() { // アクセス制御 this.davRsCmp.checkAccessContext(this.davRsCmp.getAccessContext(), BoxPrivilege.WRITE); - throw DcCoreException.Dav.RESOURCE_NOT_FOUND.params(this.davRsCmp.getUrl()); + throw PersoniumCoreException.Dav.RESOURCE_NOT_FOUND.params(this.davRsCmp.getUrl()); } /** diff --git a/src/main/java/com/fujitsu/dc/core/rs/box/ODataSvcCollectionResource.java b/src/main/java/io/personium/core/rs/box/ODataSvcCollectionResource.java similarity index 84% rename from src/main/java/com/fujitsu/dc/core/rs/box/ODataSvcCollectionResource.java rename to src/main/java/io/personium/core/rs/box/ODataSvcCollectionResource.java index 356d35763..940740c38 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/box/ODataSvcCollectionResource.java +++ b/src/main/java/io/personium/core/rs/box/ODataSvcCollectionResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.box; +package io.personium.core.rs.box; import java.io.Reader; @@ -29,18 +29,18 @@ import org.apache.wink.webdav.WebDAVMethod; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.annotations.ACL; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.auth.BoxPrivilege; -import com.fujitsu.dc.core.auth.OAuth2Helper.AcceptableAuthScheme; -import com.fujitsu.dc.core.auth.Privilege; -import com.fujitsu.dc.core.model.DavCmp; -import com.fujitsu.dc.core.model.DavMoveResource; -import com.fujitsu.dc.core.model.DavRsCmp; -import com.fujitsu.dc.core.model.jaxb.Acl; -import com.fujitsu.dc.core.rs.odata.ODataResource; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.annotations.ACL; +import io.personium.core.auth.AccessContext; +import io.personium.core.auth.BoxPrivilege; +import io.personium.core.auth.OAuth2Helper.AcceptableAuthScheme; +import io.personium.core.auth.Privilege; +import io.personium.core.model.DavCmp; +import io.personium.core.model.DavMoveResource; +import io.personium.core.model.DavRsCmp; +import io.personium.core.model.jaxb.Acl; +import io.personium.core.rs.odata.ODataResource; /** * ODataSvcResourceを担当するJAX-RSリソース. @@ -69,7 +69,7 @@ public ODataSvcCollectionResource(final DavRsCmp parent, final DavCmp davCmp) { */ @WebDAVMethod.PROPFIND public Response propfind(final Reader requestBodyXml, - @HeaderParam(DcCoreUtils.HttpHeaders.DEPTH) final String depth, + @HeaderParam(PersoniumCoreUtils.HttpHeaders.DEPTH) final String depth, @HeaderParam(HttpHeaders.CONTENT_LENGTH) final Long contentLength, @HeaderParam("Transfer-Encoding") final String transferEncoding) { @@ -116,7 +116,7 @@ public Response delete() { // ODataのスキーマ・データがすでにある場合、処理を失敗させる。 if (!this.davRsCmp.getDavCmp().isEmpty()) { - throw DcCoreException.Dav.HAS_CHILDREN; + throw PersoniumCoreException.Dav.HAS_CHILDREN; } return this.davRsCmp.getDavCmp().delete(null, false).build(); } @@ -130,13 +130,13 @@ public Response delete() { public Response optionsRoot() { // アクセス制御 this.checkAccessContext(this.getAccessContext(), BoxPrivilege.READ); - return DcCoreUtils.responseBuilderForOptions( + return PersoniumCoreUtils.responseBuilderForOptions( HttpMethod.GET, HttpMethod.DELETE, - DcCoreUtils.HttpMethod.MOVE, - DcCoreUtils.HttpMethod.PROPFIND, - DcCoreUtils.HttpMethod.PROPPATCH, - DcCoreUtils.HttpMethod.ACL + PersoniumCoreUtils.HttpMethod.MOVE, + PersoniumCoreUtils.HttpMethod.PROPFIND, + PersoniumCoreUtils.HttpMethod.PROPPATCH, + PersoniumCoreUtils.HttpMethod.ACL ).build(); } diff --git a/src/main/java/com/fujitsu/dc/core/rs/box/ODataSvcSchemaResource.java b/src/main/java/io/personium/core/rs/box/ODataSvcSchemaResource.java similarity index 87% rename from src/main/java/com/fujitsu/dc/core/rs/box/ODataSvcSchemaResource.java rename to src/main/java/io/personium/core/rs/box/ODataSvcSchemaResource.java index 403b7445e..c9c25870d 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/box/ODataSvcSchemaResource.java +++ b/src/main/java/io/personium/core/rs/box/ODataSvcSchemaResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.box; +package io.personium.core.rs.box; import java.io.StringWriter; import java.util.List; @@ -44,23 +44,23 @@ import org.odata4j.producer.ODataProducer; import org.odata4j.producer.QueryInfo; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.auth.BoxPrivilege; -import com.fujitsu.dc.core.auth.OAuth2Helper.AcceptableAuthScheme; -import com.fujitsu.dc.core.auth.Privilege; -import com.fujitsu.dc.core.model.DavRsCmp; -import com.fujitsu.dc.core.model.ctl.AssociationEnd; -import com.fujitsu.dc.core.model.ctl.ComplexType; -import com.fujitsu.dc.core.model.ctl.ComplexTypeProperty; -import com.fujitsu.dc.core.model.ctl.CtlSchema; -import com.fujitsu.dc.core.model.ctl.EntityType; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.core.odata.DcOptionsQueryParser; -import com.fujitsu.dc.core.odata.OEntityWrapper; -import com.fujitsu.dc.core.rs.odata.ODataResource; -import com.fujitsu.dc.core.utils.ODataUtils; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.auth.AccessContext; +import io.personium.core.auth.BoxPrivilege; +import io.personium.core.auth.OAuth2Helper.AcceptableAuthScheme; +import io.personium.core.auth.Privilege; +import io.personium.core.model.DavRsCmp; +import io.personium.core.model.ctl.AssociationEnd; +import io.personium.core.model.ctl.ComplexType; +import io.personium.core.model.ctl.ComplexTypeProperty; +import io.personium.core.model.ctl.CtlSchema; +import io.personium.core.model.ctl.EntityType; +import io.personium.core.model.ctl.Property; +import io.personium.core.odata.PersoniumOptionsQueryParser; +import io.personium.core.odata.OEntityWrapper; +import io.personium.core.rs.odata.ODataResource; +import io.personium.core.utils.ODataUtils; /** * ODataSvcSchemaResourceを担当するJAX-RSリソース. @@ -116,7 +116,7 @@ public void checkSchemaAuth(AccessContext ac) { */ @Override @GET - @Path("") +// @Path("") public Response getRoot(@Context final UriInfo uriInfo, @QueryParam("$format") final String format, @Context HttpHeaders httpHeaders) { @@ -131,7 +131,7 @@ public Response getRoot(@Context final UriInfo uriInfo, StringWriter w = new StringWriter(); AtomServiceDocumentFormatWriter fw = new AtomServiceDocumentFormatWriter(); - fw.write(DcCoreUtils.createUriInfo(uriInfo, 0), w, edmDataServices); + fw.write(PersoniumCoreUtils.createUriInfo(uriInfo, 0), w, edmDataServices); return Response.ok(w.toString(), fw.getContentType()) .header(ODataConstants.Headers.DATA_SERVICE_VERSION, ODataConstants.DATA_SERVICE_VERSION_HEADER) @@ -172,7 +172,7 @@ public Response getMetadata() { */ @Override @OPTIONS - @Path("") +// @Path("") public Response optionsRoot() { // アクセス制御 this.checkAccessContext(this.getAccessContext(), BoxPrivilege.READ); @@ -207,7 +207,7 @@ public void beforeMerge(final OEntityWrapper oEntityWrapper, final OEntityKey oE if (entityTypeName.equals(Property.EDM_TYPE_NAME) || entityTypeName.equals(ComplexType.EDM_TYPE_NAME) || entityTypeName.equals(ComplexTypeProperty.EDM_TYPE_NAME)) { - throw DcCoreException.Misc.METHOD_NOT_IMPLEMENTED; + throw PersoniumCoreException.Misc.METHOD_NOT_IMPLEMENTED; } } @@ -243,7 +243,7 @@ public void beforeLinkDelete(OEntityId sourceEntity, String targetNavProp) { } /** - * dc:Format以外のチェック処理. + * p:Format以外のチェック処理. * @param props プロパティ一覧 */ @Override @@ -268,11 +268,11 @@ public void validate(List> props) { && !propValue.equals(EdmSimpleType.DOUBLE.getFullyQualifiedTypeName()) && !propValue.equals(EdmSimpleType.DATETIME.getFullyQualifiedTypeName())) { // 登録済みのComplexTypeのチェック - BoolCommonExpression filter = DcOptionsQueryParser.parseFilter("Name eq '" + propValue + "'"); + BoolCommonExpression filter = PersoniumOptionsQueryParser.parseFilter("Name eq '" + propValue + "'"); QueryInfo query = new QueryInfo(null, null, null, filter, null, null, null, null, null); CountResponse reponse = this.getODataProducer().getEntitiesCount(ComplexType.EDM_TYPE_NAME, query); if (reponse.getCount() == 0) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propName); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propName); } } } else if (propName.equals(Property.P_COLLECTION_KIND.getName())) { @@ -280,7 +280,7 @@ public void validate(List> props) { // None / List if (!propValue.equals(Property.COLLECTION_KIND_NONE) && !propValue.equals(CollectionKind.List.toString())) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propName); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propName); } } else if (propName.equals(Property.P_DEFAULT_VALUE.getName())) { // DefaultValueのバリデート @@ -300,7 +300,7 @@ public void validate(List> props) { result = ODataUtils.validateDateTime(propValue); } if (!result) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propName); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propName); } } } @@ -321,7 +321,7 @@ private void checkNonSupportLinks(String sourceEntity, String targetNavProp) { && targetNavProp.equals(ComplexTypeProperty.EDM_TYPE_NAME)) || (sourceEntity.equals(ComplexTypeProperty.EDM_TYPE_NAME) && targetNavProp.equals(ComplexType.EDM_TYPE_NAME))) { - throw DcCoreException.OData.NO_SUCH_ASSOCIATION; + throw PersoniumCoreException.OData.NO_SUCH_ASSOCIATION; } } diff --git a/src/main/java/com/fujitsu/dc/core/rs/box/DcEngineSourceCollection.java b/src/main/java/io/personium/core/rs/box/PersoniumEngineSourceCollection.java similarity index 75% rename from src/main/java/com/fujitsu/dc/core/rs/box/DcEngineSourceCollection.java rename to src/main/java/io/personium/core/rs/box/PersoniumEngineSourceCollection.java index d72c4bd5a..03e787016 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/box/DcEngineSourceCollection.java +++ b/src/main/java/io/personium/core/rs/box/PersoniumEngineSourceCollection.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.box; +package io.personium.core.rs.box; import java.io.Reader; @@ -29,16 +29,16 @@ import org.apache.wink.webdav.WebDAVMethod; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.auth.BoxPrivilege; -import com.fujitsu.dc.core.model.DavCmp; -import com.fujitsu.dc.core.model.DavRsCmp; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.auth.BoxPrivilege; +import io.personium.core.model.DavCmp; +import io.personium.core.model.DavRsCmp; /** - * DcEngineSourceCollectionResourceを担当するJAX-RSリソース. + * PersoniumEngineSourceCollectionResourceを担当するJAX-RSリソース. */ -public class DcEngineSourceCollection { +public class PersoniumEngineSourceCollection { DavRsCmp davRsCmp; @@ -47,7 +47,7 @@ public class DcEngineSourceCollection { * @param parent 親リソース * @param davCmp バックエンド実装に依存する処理を受け持つ部品 */ - DcEngineSourceCollection(final DavRsCmp parent, final DavCmp davCmp) { + PersoniumEngineSourceCollection(final DavRsCmp parent, final DavCmp davCmp) { this.davRsCmp = new DavRsCmp(parent, davCmp); } @@ -64,9 +64,9 @@ public Object nextPath(@PathParam("nextPath") final String nextPath, DavCmp nextCmp = this.davRsCmp.getDavCmp().getChild(nextPath); String type = nextCmp.getType(); if (DavCmp.TYPE_NULL.equals(type)) { - return new DcEngineSourceNullResource(this.davRsCmp, nextCmp); + return new PersoniumEngineSourceNullResource(this.davRsCmp, nextCmp); } else if (DavCmp.TYPE_DAV_FILE.equals(type)) { - return new DcEngineSourceFileResource(this.davRsCmp, nextCmp); + return new PersoniumEngineSourceFileResource(this.davRsCmp, nextCmp); } // TODO Collectionタイプが不正な値の場合は5XX系で返却する @@ -82,7 +82,7 @@ public Object nextPath(@PathParam("nextPath") final String nextPath, */ @WebDAVMethod.PROPFIND public Response propfind(final Reader requestBodyXml, - @HeaderParam(DcCoreUtils.HttpHeaders.DEPTH) final String depth, + @HeaderParam(PersoniumCoreUtils.HttpHeaders.DEPTH) final String depth, @HeaderParam(HttpHeaders.CONTENT_LENGTH) final Long contentLength, @HeaderParam("Transfer-Encoding") final String transferEncoding) { @@ -99,7 +99,7 @@ public void move() { // アクセス制御 this.davRsCmp.checkAccessContext( this.davRsCmp.getAccessContext(), BoxPrivilege.WRITE); - throw DcCoreException.Dav.SERVICE_SOURCE_COLLECTION_PROHIBITED_TO_MOVE; + throw PersoniumCoreException.Dav.SERVICE_SOURCE_COLLECTION_PROHIBITED_TO_MOVE; } /** @@ -110,8 +110,8 @@ public void move() { public Response options() { // 移動元に対するアクセス制御 this.davRsCmp.checkAccessContext(this.davRsCmp.getAccessContext(), BoxPrivilege.READ); - return DcCoreUtils.responseBuilderForOptions( - com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPFIND + return PersoniumCoreUtils.responseBuilderForOptions( + io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPFIND ).build(); } } diff --git a/src/main/java/com/fujitsu/dc/core/rs/box/DcEngineSourceFileResource.java b/src/main/java/io/personium/core/rs/box/PersoniumEngineSourceFileResource.java similarity index 64% rename from src/main/java/com/fujitsu/dc/core/rs/box/DcEngineSourceFileResource.java rename to src/main/java/io/personium/core/rs/box/PersoniumEngineSourceFileResource.java index 4d5281711..c1b803a18 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/box/DcEngineSourceFileResource.java +++ b/src/main/java/io/personium/core/rs/box/PersoniumEngineSourceFileResource.java @@ -14,29 +14,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.box; +package io.personium.core.rs.box; import java.io.Reader; import javax.ws.rs.core.Response; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.annotations.ACL; -import com.fujitsu.dc.core.auth.BoxPrivilege; -import com.fujitsu.dc.core.model.DavCmp; -import com.fujitsu.dc.core.model.DavRsCmp; +import io.personium.core.PersoniumCoreException; +import io.personium.core.annotations.ACL; +import io.personium.core.auth.BoxPrivilege; +import io.personium.core.model.DavCmp; +import io.personium.core.model.DavRsCmp; /** - * DcEngineのソースファイルリソースに対応するJAX-RS Resource クラス. + * PersoniumEngineのソースファイルリソースに対応するJAX-RS Resource クラス. */ -public final class DcEngineSourceFileResource extends DavFileResource { +public final class PersoniumEngineSourceFileResource extends DavFileResource { /** * constructor. * @param parent 親 * @param davCmp 部品 */ - public DcEngineSourceFileResource(final DavRsCmp parent, final DavCmp davCmp) { + public PersoniumEngineSourceFileResource(final DavRsCmp parent, final DavCmp davCmp) { super(parent, davCmp); } @@ -49,6 +49,6 @@ public DcEngineSourceFileResource(final DavRsCmp parent, final DavCmp davCmp) { public Response acl(final Reader reader) { // アクセス制御 this.davRsCmp.checkAccessContext(this.davRsCmp.getAccessContext(), BoxPrivilege.WRITE_ACL); - throw DcCoreException.Dav.METHOD_NOT_ALLOWED; + throw PersoniumCoreException.Dav.METHOD_NOT_ALLOWED; } } diff --git a/src/main/java/com/fujitsu/dc/core/rs/box/DcEngineSourceNullResource.java b/src/main/java/io/personium/core/rs/box/PersoniumEngineSourceNullResource.java similarity index 76% rename from src/main/java/com/fujitsu/dc/core/rs/box/DcEngineSourceNullResource.java rename to src/main/java/io/personium/core/rs/box/PersoniumEngineSourceNullResource.java index 377c0c23d..b50b23650 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/box/DcEngineSourceNullResource.java +++ b/src/main/java/io/personium/core/rs/box/PersoniumEngineSourceNullResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.box; +package io.personium.core.rs.box; import java.io.InputStream; @@ -24,22 +24,22 @@ import org.apache.wink.webdav.WebDAVMethod; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.auth.BoxPrivilege; -import com.fujitsu.dc.core.model.DavCmp; -import com.fujitsu.dc.core.model.DavRsCmp; +import io.personium.core.PersoniumCoreException; +import io.personium.core.auth.BoxPrivilege; +import io.personium.core.model.DavCmp; +import io.personium.core.model.DavRsCmp; /** - * DcEngineSourceNullResourceを担当するJAX-RSリソース. + * PersoniumEngineSourceNullResourceを担当するJAX-RSリソース. */ -public class DcEngineSourceNullResource extends NullResource { +public class PersoniumEngineSourceNullResource extends NullResource { /** * constructor. * @param parent 親リソース * @param davCmp バックエンド実装に依存する処理を受け持つ部品 */ - DcEngineSourceNullResource(final DavRsCmp parent, final DavCmp davCmp) { + PersoniumEngineSourceNullResource(final DavRsCmp parent, final DavCmp davCmp) { super(parent, davCmp, false); } @@ -59,7 +59,7 @@ public Response mkcol(@HeaderParam(HttpHeaders.CONTENT_TYPE) final String conten final InputStream inputStream) { // アクセス制御 this.davRsCmp.checkAccessContext(this.davRsCmp.getAccessContext(), BoxPrivilege.WRITE); - throw DcCoreException.Dav.METHOD_NOT_ALLOWED; + throw PersoniumCoreException.Dav.METHOD_NOT_ALLOWED; } } diff --git a/src/main/java/com/fujitsu/dc/core/rs/box/DcEngineSvcCollectionResource.java b/src/main/java/io/personium/core/rs/box/PersoniumEngineSvcCollectionResource.java similarity index 81% rename from src/main/java/com/fujitsu/dc/core/rs/box/DcEngineSvcCollectionResource.java rename to src/main/java/io/personium/core/rs/box/PersoniumEngineSvcCollectionResource.java index 726d50baf..5639e5dcd 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/box/DcEngineSvcCollectionResource.java +++ b/src/main/java/io/personium/core/rs/box/PersoniumEngineSvcCollectionResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.box; +package io.personium.core.rs.box; import java.io.IOException; import java.io.InputStream; @@ -57,22 +57,22 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.annotations.ACL; -import com.fujitsu.dc.core.auth.BoxPrivilege; -import com.fujitsu.dc.core.model.DavCmp; -import com.fujitsu.dc.core.model.DavMoveResource; -import com.fujitsu.dc.core.model.DavRsCmp; -import com.fujitsu.dc.core.model.impl.es.DavCmpEsImpl; -import com.fujitsu.dc.core.model.impl.fs.DavCmpFsImpl; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.annotations.ACL; +import io.personium.core.auth.BoxPrivilege; +import io.personium.core.model.DavCmp; +import io.personium.core.model.DavMoveResource; +import io.personium.core.model.DavRsCmp; +import io.personium.core.model.impl.es.DavCmpEsImpl; +import io.personium.core.model.impl.fs.DavCmpFsImpl; /** - * DcEngineSvcCollectionResourceを担当するJAX-RSリソース. + * PersoniumEngineSvcCollectionResourceを担当するJAX-RSリソース. */ -public final class DcEngineSvcCollectionResource { - private static Logger log = LoggerFactory.getLogger(DcEngineSvcCollectionResource.class); +public final class PersoniumEngineSvcCollectionResource { + private static Logger log = LoggerFactory.getLogger(PersoniumEngineSvcCollectionResource.class); DavCmp davCmp = null; DavCollectionResource dcr = null; @@ -83,7 +83,7 @@ public final class DcEngineSvcCollectionResource { * @param parent DavRsCmp * @param davCmp DavCmp */ - public DcEngineSvcCollectionResource(final DavRsCmp parent, final DavCmp davCmp) { + public PersoniumEngineSvcCollectionResource(final DavRsCmp parent, final DavCmp davCmp) { this.davCmp = davCmp; this.dcr = new DavCollectionResource(parent, davCmp); this.davRsCmp = new DavRsCmp(parent, davCmp); @@ -99,7 +99,7 @@ public DcEngineSvcCollectionResource(final DavRsCmp parent, final DavCmp davCmp) */ @WebDAVMethod.PROPFIND public Response propfind(final Reader requestBodyXml, - @HeaderParam(DcCoreUtils.HttpHeaders.DEPTH) final String depth, + @HeaderParam(PersoniumCoreUtils.HttpHeaders.DEPTH) final String depth, @HeaderParam(HttpHeaders.CONTENT_LENGTH) final Long contentLength, @HeaderParam("Transfer-Encoding") final String transferEncoding) { @@ -119,7 +119,7 @@ public Response delete() { this.davRsCmp.getParent().checkAccessContext(this.davRsCmp.getAccessContext(), BoxPrivilege.WRITE); if (!this.davRsCmp.getDavCmp().isEmpty()) { - throw DcCoreException.Dav.HAS_CHILDREN; + throw PersoniumCoreException.Dav.HAS_CHILDREN; } return this.davCmp.delete(null, false).build(); } @@ -157,12 +157,12 @@ public Response acl(final Reader reader) { public Response options() { // アクセス制御 this.davRsCmp.checkAccessContext(this.davRsCmp.getAccessContext(), BoxPrivilege.READ); - return DcCoreUtils.responseBuilderForOptions( + return PersoniumCoreUtils.responseBuilderForOptions( HttpMethod.DELETE, - com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.MOVE, - com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPFIND, - com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPPATCH, - com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.ACL + io.personium.common.utils.PersoniumCoreUtils.HttpMethod.MOVE, + io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPFIND, + io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPPATCH, + io.personium.common.utils.PersoniumCoreUtils.HttpMethod.ACL ).build(); } @@ -171,13 +171,13 @@ public Response options() { * @return DavFileResource */ @Path("__src") - public DcEngineSourceCollection src() { + public PersoniumEngineSourceCollection src() { DavCmp nextCmp = this.davCmp.getChild(DavCmp.SERVICE_SRC_COLLECTION); if (nextCmp.exists()) { - return new DcEngineSourceCollection(this.davRsCmp, nextCmp); + return new PersoniumEngineSourceCollection(this.davRsCmp, nextCmp); } else { // サービスソースコレクションが存在しないため404エラーとする - throw DcCoreException.Dav.RESOURCE_NOT_FOUND; + throw PersoniumCoreException.Dav.RESOURCE_NOT_FOUND; } } @@ -271,8 +271,8 @@ public Response relaycommon( String cellName = this.davRsCmp.getCell().getName(); String boxName = this.davRsCmp.getBox().getName(); - String requestUrl = String.format("http://%s:%s/%s/%s/%s/service/%s", DcCoreConfig.getEngineHost(), - DcCoreConfig.getEnginePort(), DcCoreConfig.getEnginePath(), cellName, boxName, path); + String requestUrl = String.format("http://%s:%s/%s/%s/%s/service/%s", PersoniumUnitConfig.getEngineHost(), + PersoniumUnitConfig.getEnginePort(), PersoniumUnitConfig.getEnginePath(), cellName, boxName, path); // baseUrlを取得 String baseUrl = uriInfo.getBaseUri().toString(); @@ -304,15 +304,15 @@ public Response relaycommon( req.addHeader("X-Request-Uri", uriInfo.getRequestUri().toString()); if (davCmp instanceof DavCmpFsImpl) { DavCmpFsImpl dcmp = (DavCmpFsImpl) davCmp; - req.addHeader("X-Dc-Fs-Path", dcmp.getFsPath()); + req.addHeader("X-Personium-Fs-Path", dcmp.getFsPath()); } else if (davCmp instanceof DavCmpEsImpl) { DavCmpEsImpl dcmp = (DavCmpEsImpl) davCmp; - req.addHeader("X-Dc-Es-Index", dcmp.getEsColType().getIndex().getName()); - req.addHeader("X-Dc-Es-Id", dcmp.getNodeId()); - req.addHeader("X-Dc-Es-Type", dcmp.getEsColType().getType()); - req.addHeader("X-Dc-Es-Routing-Id", this.davRsCmp.getCell().getId()); + req.addHeader("X-Personium-Es-Index", dcmp.getEsColType().getIndex().getName()); + req.addHeader("X-Personium-Es-Id", dcmp.getNodeId()); + req.addHeader("X-Personium-Es-Type", dcmp.getEsColType().getType()); + req.addHeader("X-Personium-Es-Routing-Id", this.davRsCmp.getCell().getId()); } - req.addHeader("X-Dc-Box-Schema", this.davRsCmp.getBox().getSchema()); + req.addHeader("X-Personium-Box-Schema", this.davRsCmp.getBox().getSchema()); // リレイまでのヘッダを追加 MultivaluedMap multivalueHeaders = headers.getRequestHeaders(); @@ -342,9 +342,9 @@ public Response relaycommon( try { objResponse = client.execute(req); } catch (ClientProtocolException e) { - throw DcCoreException.ServiceCollection.SC_INVALID_HTTP_RESPONSE_ERROR; + throw PersoniumCoreException.ServiceCollection.SC_INVALID_HTTP_RESPONSE_ERROR; } catch (Exception ioe) { - throw DcCoreException.ServiceCollection.SC_ENGINE_CONNECTION_ERROR.reason(ioe); + throw PersoniumCoreException.ServiceCollection.SC_ENGINE_CONNECTION_ERROR.reason(ioe); } // ステータスコードを追加 @@ -374,9 +374,9 @@ public Response relaycommon( try { isResBody = entity.getContent(); } catch (IllegalStateException e) { - throw DcCoreException.ServiceCollection.SC_UNKNOWN_ERROR.reason(e); + throw PersoniumCoreException.ServiceCollection.SC_UNKNOWN_ERROR.reason(e); } catch (IOException e) { - throw DcCoreException.ServiceCollection.SC_ENGINE_CONNECTION_ERROR.reason(e); + throw PersoniumCoreException.ServiceCollection.SC_ENGINE_CONNECTION_ERROR.reason(e); } final InputStream isInvariable = isResBody; // 処理結果を出力 diff --git a/src/main/java/com/fujitsu/dc/core/rs/box/package-info.java b/src/main/java/io/personium/core/rs/box/package-info.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/rs/box/package-info.java rename to src/main/java/io/personium/core/rs/box/package-info.java index 80e5a7796..f633a5f59 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/box/package-info.java +++ b/src/main/java/io/personium/core/rs/box/package-info.java @@ -17,4 +17,4 @@ /** * Box-level JAX-RS Resource classes. */ -package com.fujitsu.dc.core.rs.box; +package io.personium.core.rs.box; diff --git a/src/main/java/com/fujitsu/dc/core/rs/cell/AuthResourceUtils.java b/src/main/java/io/personium/core/rs/cell/AuthResourceUtils.java similarity index 90% rename from src/main/java/com/fujitsu/dc/core/rs/cell/AuthResourceUtils.java rename to src/main/java/io/personium/core/rs/cell/AuthResourceUtils.java index b7525f194..568392910 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/cell/AuthResourceUtils.java +++ b/src/main/java/io/personium/core/rs/cell/AuthResourceUtils.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.cell; +package io.personium.core.rs.cell; import java.io.BufferedReader; import java.io.IOException; @@ -27,10 +27,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.auth.token.TransCellAccessToken; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.lock.AccountLockManager; +import io.personium.common.auth.token.TransCellAccessToken; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.model.Cell; +import io.personium.core.model.lock.AccountLockManager; /** * リソースクラスで汎用的に利用するメソッドを定義するユーティリティクラス. @@ -56,7 +56,7 @@ public static String getJavascript(String fileName) { BufferedReader reader = null; String rtnstr = null; try { - in = DcCoreConfig.class.getClassLoader().getResourceAsStream(fileName); + in = PersoniumUnitConfig.class.getClassLoader().getResourceAsStream(fileName); isr = new InputStreamReader(in, "UTF-8"/* 文字コード指定 */); reader = new BufferedReader(isr); StringBuffer buf = new StringBuffer(); diff --git a/src/main/java/com/fujitsu/dc/core/rs/cell/AuthzEndPointResource.java b/src/main/java/io/personium/core/rs/cell/AuthzEndPointResource.java similarity index 80% rename from src/main/java/com/fujitsu/dc/core/rs/cell/AuthzEndPointResource.java rename to src/main/java/io/personium/core/rs/cell/AuthzEndPointResource.java index 8a4dacbae..fd79b6356 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/cell/AuthzEndPointResource.java +++ b/src/main/java/io/personium/core/rs/cell/AuthzEndPointResource.java @@ -14,9 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.cell; +package io.personium.core.rs.cell; -import static com.fujitsu.dc.common.auth.token.AbstractOAuth2Token.MILLISECS_IN_AN_HOUR; +import static io.personium.common.auth.token.AbstractOAuth2Token.MILLISECS_IN_AN_HOUR; import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; @@ -55,38 +55,38 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token.TokenDsigException; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token.TokenParseException; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token.TokenRootCrtException; -import com.fujitsu.dc.common.auth.token.AccountAccessToken; -import com.fujitsu.dc.common.auth.token.CellLocalAccessToken; -import com.fujitsu.dc.common.auth.token.CellLocalRefreshToken; -import com.fujitsu.dc.common.auth.token.IAccessToken; -import com.fujitsu.dc.common.auth.token.IExtRoleContainingToken; -import com.fujitsu.dc.common.auth.token.IRefreshToken; -import com.fujitsu.dc.common.auth.token.Role; -import com.fujitsu.dc.common.auth.token.TransCellAccessToken; -import com.fujitsu.dc.common.auth.token.UnitLocalUnitUserToken; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreAuthnException; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.DcCoreLog; -import com.fujitsu.dc.core.DcCoreMessageUtils; -import com.fujitsu.dc.core.auth.OAuth2Helper; -import com.fujitsu.dc.core.auth.OAuth2Helper.Key; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.DavRsCmp; -import com.fujitsu.dc.core.model.ModelFactory; -import com.fujitsu.dc.core.model.ctl.Account; -import com.fujitsu.dc.core.model.impl.es.EsModel; -import com.fujitsu.dc.core.model.impl.es.QueryMapFactory; -import com.fujitsu.dc.core.model.impl.es.accessor.EntitySetAccessor; -import com.fujitsu.dc.core.model.impl.es.doc.OEntityDocHandler; -import com.fujitsu.dc.core.odata.DcODataProducer; -import com.fujitsu.dc.core.odata.OEntityWrapper; +import io.personium.common.auth.token.AbstractOAuth2Token; +import io.personium.common.auth.token.AbstractOAuth2Token.TokenDsigException; +import io.personium.common.auth.token.AbstractOAuth2Token.TokenParseException; +import io.personium.common.auth.token.AbstractOAuth2Token.TokenRootCrtException; +import io.personium.common.auth.token.AccountAccessToken; +import io.personium.common.auth.token.CellLocalAccessToken; +import io.personium.common.auth.token.CellLocalRefreshToken; +import io.personium.common.auth.token.IAccessToken; +import io.personium.common.auth.token.IExtRoleContainingToken; +import io.personium.common.auth.token.IRefreshToken; +import io.personium.common.auth.token.Role; +import io.personium.common.auth.token.TransCellAccessToken; +import io.personium.common.auth.token.UnitLocalUnitUserToken; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumCoreAuthnException; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.PersoniumCoreLog; +import io.personium.core.PersoniumCoreMessageUtils; +import io.personium.core.auth.OAuth2Helper; +import io.personium.core.auth.OAuth2Helper.Key; +import io.personium.core.model.Box; +import io.personium.core.model.Cell; +import io.personium.core.model.DavRsCmp; +import io.personium.core.model.ModelFactory; +import io.personium.core.model.ctl.Account; +import io.personium.core.model.impl.es.EsModel; +import io.personium.core.model.impl.es.QueryMapFactory; +import io.personium.core.model.impl.es.accessor.EntitySetAccessor; +import io.personium.core.model.impl.es.doc.OEntityDocHandler; +import io.personium.core.odata.PersoniumODataProducer; +import io.personium.core.odata.OEntityWrapper; import com.sun.jersey.api.client.ClientResponse.Status; /** @@ -114,17 +114,17 @@ public class AuthzEndPointResource { /** * ログインフォーム_初期表示メッセージ. */ - private final String passFormMsg = DcCoreMessageUtils.getMessage("PS-AU-0002"); + private final String passFormMsg = PersoniumCoreMessageUtils.getMessage("PS-AU-0002"); /** * ログインフォーム_ユーザID・パスワード未入力のメッセージ. */ - private final String noIdPassMsg = DcCoreMessageUtils.getMessage("PS-AU-0003"); + private final String noIdPassMsg = PersoniumCoreMessageUtils.getMessage("PS-AU-0003"); /** * Cookie認証失敗時のメッセージ. */ - private final String missCookieMsg = DcCoreMessageUtils.getMessage("PS-AU-0005"); + private final String missCookieMsg = PersoniumCoreMessageUtils.getMessage("PS-AU-0005"); /** * パスワード認証時に使用するAccountのUUID。パスワード認証後に最終ログイン時刻の更新に使用する. @@ -144,13 +144,13 @@ public AuthzEndPointResource(final Cell cell, final DavRsCmp davRsCmp) { /** * 認証のエンドポイント.

トークンの発行しわけ

*
    - *
  • dc_targetにURLが書いてあれば、そのCELLをTARGETのCELLとしてtransCellTokenを発行する。
  • + *
  • p_targetにURLが書いてあれば、そのCELLをTARGETのCELLとしてtransCellTokenを発行する。
  • *
* @param authzHeader Authorization ヘッダ - * @param dcOwner フォームパラメタ + * @param pOwner フォームパラメタ * @param username フォームパラメタ * @param password フォームパラメタ - * @param dcTarget フォームパラメタ + * @param pTarget フォームパラメタ * @param assertion フォームパラメタ * @param clientId フォームパラメタ * @param responseType フォームパラメタ @@ -165,10 +165,10 @@ public AuthzEndPointResource(final Cell cell, final DavRsCmp davRsCmp) { */ @POST public final Response authPost(@HeaderParam(HttpHeaders.AUTHORIZATION) final String authzHeader, - @FormParam(Key.OWNER) final String dcOwner, + @FormParam(Key.OWNER) final String pOwner, @FormParam(Key.USERNAME) final String username, @FormParam(Key.PASSWORD) final String password, - @FormParam(Key.TARGET) final String dcTarget, + @FormParam(Key.TARGET) final String pTarget, @FormParam(Key.ASSERTION) final String assertion, @FormParam(Key.CLIENT_ID) final String clientId, @FormParam(Key.RESPONSE_TYPE) final String responseType, @@ -180,14 +180,14 @@ public final Response authPost(@HeaderParam(HttpHeaders.AUTHORIZATION) final Str @FormParam(Key.CANCEL_FLG) final String isCancel, @Context final UriInfo uriInfo) { - return auth(dcOwner, username, password, dcTarget, assertion, clientId, responseType, redirectUri, host, + return auth(pOwner, username, password, pTarget, assertion, clientId, responseType, redirectUri, host, cookieRefreshToken, keepLogin, state, isCancel, uriInfo); } - private Response auth(final String dcOwner, + private Response auth(final String pOwner, final String username, final String password, - final String dcTarget, + final String pTarget, final String assertion, final String clientId, final String responseType, @@ -221,14 +221,14 @@ private Response auth(final String dcOwner, // clientIdで指定されたセルURLをスキーマに持つBoxが存在するかチェック // if (!checkAuthorization(normalizedClientId)) { - log.debug(DcCoreMessageUtils.getMessage("PS-ER-0003")); + log.debug(PersoniumCoreMessageUtils.getMessage("PS-ER-0003")); return this.returnErrorRedirect(cell.getUrl() + "__html/error", "PS-ER-0003"); } // clientIdとredirectUriパラメタチェック try { this.checkImplicitParam(normalizedClientId, normalizedRedirectUri, uriInfo.getBaseUri()); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { log.debug(e.getMessage()); if ((username == null && password == null) && (assertion == null || "".equals(assertion)) @@ -243,7 +243,7 @@ private Response auth(final String dcOwner, if ("1".equals(isCancel)) { // redirect_uriへリダイレクト return this.returnErrorRedirect(redirectUri, OAuth2Helper.Error.UNAUTHORIZED_CLIENT, - DcCoreMessageUtils.getMessage("PR401-AZ-0001"), state, "PR401-AZ-0001"); + PersoniumCoreMessageUtils.getMessage("PR401-AZ-0001"), state, "PR401-AZ-0001"); } String schema = clientId; @@ -259,18 +259,18 @@ private Response auth(final String dcOwner, OAuth2Helper.Error.UNSUPPORTED_RESPONSE_TYPE, state, "PR400-AZ-0001"); } else { return this.handleImplicitFlow(redirectUri, clientId, host, username, password, cookieRefreshToken, - dcTarget, keepLogin, assertion, schema, state, dcOwner); + pTarget, keepLogin, assertion, schema, state, pOwner); } } /** * 認証のエンドポイント.

トークンの発行しわけ

*
    - *
  • dc_targetにURLが書いてあれば、そのCELLをTARGETのCELLとしてtransCellTokenを発行する。
  • + *
  • p_targetにURLが書いてあれば、そのCELLをTARGETのCELLとしてtransCellTokenを発行する。
  • *
* @param authzHeader Authorization ヘッダ - * @param dcTarget クエリパラメタ - * @param dcOwner クエリパラメタ + * @param pTarget クエリパラメタ + * @param pOwner クエリパラメタ * @param assertion クエリパラメタ * @param clientId クエリパラメタ * @param responseType クエリパラメタ @@ -285,8 +285,8 @@ private Response auth(final String dcOwner, */ @GET public final Response authGet(@HeaderParam(HttpHeaders.AUTHORIZATION) final String authzHeader, - @QueryParam(Key.TARGET) final String dcTarget, - @QueryParam(Key.OWNER) final String dcOwner, + @QueryParam(Key.TARGET) final String pTarget, + @QueryParam(Key.OWNER) final String pOwner, @QueryParam(Key.ASSERTION) final String assertion, @QueryParam(Key.CLIENT_ID) final String clientId, @QueryParam(Key.RESPONSE_TYPE) final String responseType, @@ -298,26 +298,26 @@ public final Response authGet(@HeaderParam(HttpHeaders.AUTHORIZATION) final Stri @QueryParam(Key.CANCEL_FLG) final String isCancel, @Context final UriInfo uriInfo) { - return auth(dcOwner, null, null, dcTarget, assertion, clientId, responseType, redirectUri, host, + return auth(pOwner, null, null, pTarget, assertion, clientId, responseType, redirectUri, host, cookieRefreshToken, keepLogin, state, isCancel, uriInfo); } - private void checkDcTarget(final String dcTarget) { - String target = dcTarget; - if (target != null && !"".equals(dcTarget)) { + private void checkPTarget(final String pTarget) { + String target = pTarget; + if (target != null && !"".equals(pTarget)) { try { new URL(target); if (!target.endsWith("/")) { target = target + "/"; } if (target.contains("\n") || target.contains("\r")) { - // dc_targetがURLでない場合はエラー - throw DcCoreAuthnException.INVALID_TARGET; + // p_targetがURLでない場合はエラー + throw PersoniumCoreAuthnException.INVALID_TARGET; } } catch (MalformedURLException e) { - // dc_targetがURLでない場合はエラー - throw DcCoreAuthnException.INVALID_TARGET; + // p_targetがURLでない場合はエラー + throw PersoniumCoreAuthnException.INVALID_TARGET; } } } @@ -329,11 +329,11 @@ private void checkDcTarget(final String dcTarget) { * @param message メッセージ表示領域に出力する文字列 * @param state state * @param dcTraget dcTraget - * @param dcOwner dcOwner + * @param pOwner pOwner * @return HTML */ private String createForm(String clientId, String redirectUriStr, String message, String state, - String dcTraget, String dcOwner) { + String dcTraget, String pOwner) { List paramsList = new ArrayList(); @@ -343,13 +343,13 @@ private String createForm(String clientId, String redirectUriStr, String message } // タイトル - paramsList.add(DcCoreMessageUtils.getMessage("PS-AU-0001")); + paramsList.add(PersoniumCoreMessageUtils.getMessage("PS-AU-0001")); // アプリセルのprofile.json paramsList.add(clientId + Box.DEFAULT_BOX_NAME + PROFILE_JSON_NAME); // データセルのprofile.json paramsList.add(cell.getUrl() + Box.DEFAULT_BOX_NAME + PROFILE_JSON_NAME); // タイトル - paramsList.add(DcCoreMessageUtils.getMessage("PS-AU-0001")); + paramsList.add(PersoniumCoreMessageUtils.getMessage("PS-AU-0001")); // 呼び出し先 paramsList.add(cell.getUrl() + "__authz"); // メッセージ表示領域 @@ -361,10 +361,10 @@ private String createForm(String clientId, String redirectUriStr, String message } else { paramsList.add(dcTraget); } - if (dcOwner == null) { + if (pOwner == null) { paramsList.add(""); } else { - paramsList.add(dcOwner); + paramsList.add(pOwner); } paramsList.add(clientId); paramsList.add(redirectUriStr); @@ -372,7 +372,7 @@ private String createForm(String clientId, String redirectUriStr, String message Object[] params = paramsList.toArray(); - String html = DcCoreUtils.readStringResource("html/authform.html", CharEncoding.UTF_8); + String html = PersoniumCoreUtils.readStringResource("html/authform.html", CharEncoding.UTF_8); html = MessageFormat.format(html, params); return html; @@ -380,43 +380,43 @@ private String createForm(String clientId, String redirectUriStr, String message /** * ImplicitFlow時のパスワード認証処理. - * @param dcTarget + * @param pTarget * @param redirectUriStr * @param clientId * @param username * @param password * @param keepLogin * @param state - * @param dcOwner + * @param pOwner * @param host * @return */ - private Response handleImplicitFlowPassWord(final String dcTarget, + private Response handleImplicitFlowPassWord(final String pTarget, final String redirectUriStr, final String clientId, final String username, final String password, final String keepLogin, final String state, - final String dcOwner, + final String pOwner, final String host) { // ユーザIDとパスワードが一方でも未指定の場合、ログインエラーを返却する boolean passCheck = true; if (username == null || password == null || "".equals(username) || "".equals(password)) { ResponseBuilder rb = Response.ok().type(MediaType.TEXT_HTML); - return rb.entity(this.createForm(clientId, redirectUriStr, noIdPassMsg, state, dcTarget, dcOwner)) + return rb.entity(this.createForm(clientId, redirectUriStr, noIdPassMsg, state, pTarget, pOwner)) .header("Content-Type", "text/html; charset=UTF-8").build(); } OEntityWrapper oew = cell.getAccount(username); if (oew == null) { String resCode = "PS-AU-0004"; - String missIdPassMsg = DcCoreMessageUtils.getMessage(resCode); + String missIdPassMsg = PersoniumCoreMessageUtils.getMessage(resCode); log.info("MessageCode : " + resCode); log.info("responseMessage : " + missIdPassMsg); ResponseBuilder rb = Response.ok().type(MediaType.TEXT_HTML); - return rb.entity(this.createForm(clientId, redirectUriStr, missIdPassMsg, state, dcTarget, dcOwner)) + return rb.entity(this.createForm(clientId, redirectUriStr, missIdPassMsg, state, pTarget, pOwner)) .header("Content-Type", "text/html; charset=UTF-8").build(); } // 最終ログイン時刻を更新するために、UUIDをクラス変数にひかえておく @@ -430,11 +430,11 @@ private Response handleImplicitFlowPassWord(final String dcTarget, // memcachedのロック時間を更新 AuthResourceUtils.registAccountLock(accountId); String resCode = "PS-AU-0006"; - String accountLockMsg = DcCoreMessageUtils.getMessage(resCode); + String accountLockMsg = PersoniumCoreMessageUtils.getMessage(resCode); log.info("MessageCode : " + resCode); log.info("responseMessage : " + accountLockMsg); ResponseBuilder rb = Response.ok().type(MediaType.TEXT_HTML); - return rb.entity(this.createForm(clientId, redirectUriStr, accountLockMsg, state, dcTarget, dcOwner)) + return rb.entity(this.createForm(clientId, redirectUriStr, accountLockMsg, state, pTarget, pOwner)) .header("Content-Type", "text/html; charset=UTF-8").build(); } @@ -444,14 +444,14 @@ private Response handleImplicitFlowPassWord(final String dcTarget, // memcachedにロックを作成 AuthResourceUtils.registAccountLock(accountId); String resCode = "PS-AU-0004"; - String missIdPassMsg = DcCoreMessageUtils.getMessage(resCode); + String missIdPassMsg = PersoniumCoreMessageUtils.getMessage(resCode); log.info("MessageCode : " + resCode); log.info("responseMessage : " + missIdPassMsg); ResponseBuilder rb = Response.ok().type(MediaType.TEXT_HTML); - return rb.entity(this.createForm(clientId, redirectUriStr, missIdPassMsg, state, dcTarget, dcOwner)) + return rb.entity(this.createForm(clientId, redirectUriStr, missIdPassMsg, state, pTarget, pOwner)) .header("Content-Type", "text/html; charset=UTF-8").build(); } - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { return this.returnErrorRedirect(redirectUriStr, e.getMessage(), e.getMessage(), state, e.getCode()); } @@ -461,14 +461,14 @@ private Response handleImplicitFlowPassWord(final String dcTarget, AbstractOAuth2Token localToken = null; - if (Key.TRUE_STR.equals(dcOwner)) { + if (Key.TRUE_STR.equals(pOwner)) { // ユニット昇格権限設定のチェック if (!this.davRsCmp.checkOwnerRepresentativeAccounts(username)) { - return returnErrorMessage(clientId, redirectUriStr, passFormMsg, state, dcTarget, dcOwner); + return returnErrorMessage(clientId, redirectUriStr, passFormMsg, state, pTarget, pOwner); } // セルのオーナーが未設定のセルに対しては昇格させない。 if (cell.getOwner() == null) { - return returnErrorMessage(clientId, redirectUriStr, passFormMsg, state, dcTarget, dcOwner); + return returnErrorMessage(clientId, redirectUriStr, passFormMsg, state, pTarget, pOwner); } // uluut発行処理 @@ -491,7 +491,7 @@ private Response handleImplicitFlowPassWord(final String dcTarget, null, null, state); } else { // レスポンスをつくる。 - if (dcTarget == null || "".equals(dcTarget)) { + if (pTarget == null || "".equals(pTarget)) { // セルローカルトークンの返却 AccountAccessToken aToken = new AccountAccessToken(issuedAt, AccountAccessToken.ACCESS_TOKEN_EXPIRES_HOUR * MILLISECS_IN_AN_HOUR, cell.getUrl(), @@ -502,13 +502,13 @@ private Response handleImplicitFlowPassWord(final String dcTarget, // トランスセルトークンの返却 List roleList = cell.getRoleListForAccount(username); TransCellAccessToken tcToken = new TransCellAccessToken(cell.getUrl(), - cell.getUrl() + "#" + username, dcTarget, roleList, schema); + cell.getUrl() + "#" + username, pTarget, roleList, schema); return returnSuccessRedirect(redirectUriStr, tcToken.toTokenString(), tcToken.expiresIn(), rToken.toTokenString(), keepLogin, state); } } } catch (MalformedURLException e) { - return returnErrorMessage(clientId, redirectUriStr, passFormMsg, state, dcTarget, dcOwner); + return returnErrorMessage(clientId, redirectUriStr, passFormMsg, state, pTarget, pOwner); } } @@ -517,14 +517,14 @@ private Response handleImplicitFlowPassWord(final String dcTarget, * @param redirectUriStr * @param clientId * @param cookieRefreshToken - * @param dcTarget + * @param pTarget * @param keepLogin * @return */ private Response handleImplicitFlowTcToken(final String redirectUriStr, final String clientId, final String assertion, - final String dcTarget, + final String pTarget, final String keepLogin, final String schema, final String state) { @@ -535,17 +535,17 @@ private Response handleImplicitFlowTcToken(final String redirectUriStr, tcToken = TransCellAccessToken.parse(assertion); } catch (TokenParseException e) { // パース失敗時 - DcCoreLog.Auth.TOKEN_PARSE_ERROR.params(e.getMessage()).writeLog(); + PersoniumCoreLog.Auth.TOKEN_PARSE_ERROR.params(e.getMessage()).writeLog(); return this.returnErrorRedirect(redirectUriStr, OAuth2Helper.Error.ACCESS_DENIED, OAuth2Helper.Error.ACCESS_DENIED, state, "PR401-AZ-0002"); } catch (TokenDsigException e) { // 署名検証でエラー - DcCoreLog.Auth.TOKEN_DISG_ERROR.params(e.getMessage()).writeLog(); + PersoniumCoreLog.Auth.TOKEN_DISG_ERROR.params(e.getMessage()).writeLog(); return this.returnErrorRedirect(redirectUriStr, OAuth2Helper.Error.ACCESS_DENIED, OAuth2Helper.Error.ACCESS_DENIED, state, "PR401-AZ-0002"); } catch (TokenRootCrtException e) { // ルートCA証明書の設定エラー - DcCoreLog.Auth.ROOT_CA_CRT_SETTING_ERROR.params(e.getMessage()).writeLog(); + PersoniumCoreLog.Auth.ROOT_CA_CRT_SETTING_ERROR.params(e.getMessage()).writeLog(); return this.returnErrorRedirect(redirectUriStr, OAuth2Helper.Error.ACCESS_DENIED, OAuth2Helper.Error.ACCESS_DENIED, state, "PR401-AZ-0002"); } @@ -581,11 +581,11 @@ private Response handleImplicitFlowTcToken(final String redirectUriStr, // 認証トークン発行処理 // ターゲットは自由に決めてよい。 IAccessToken aToken = null; - if (dcTarget == null || "".equals(dcTarget)) { + if (pTarget == null || "".equals(pTarget)) { aToken = new CellLocalAccessToken(issuedAt, cell.getUrl(), tcToken.getSubject(), rolesHere, schemaVerified); } else { aToken = new TransCellAccessToken(UUID.randomUUID().toString(), issuedAt, cell.getUrl(), - tcToken.getSubject(), dcTarget, rolesHere, schemaVerified); + tcToken.getSubject(), pTarget, rolesHere, schemaVerified); } // トランスセルトークンでの認証成功 // 302でレスポンスし、Locationヘッダを返却 @@ -593,7 +593,7 @@ private Response handleImplicitFlowTcToken(final String redirectUriStr, return returnSuccessRedirect(redirectUriStr, aToken.toTokenString(), aToken.expiresIn(), null, keepLogin, state); } catch (MalformedURLException e) { - return returnErrorMessage(clientId, redirectUriStr, passFormMsg, state, dcTarget, ""); + return returnErrorMessage(clientId, redirectUriStr, passFormMsg, state, pTarget, ""); } } @@ -603,7 +603,7 @@ private Response handleImplicitFlowTcToken(final String redirectUriStr, * @param clientId * @param host * @param cookieRefreshToken - * @param dcTarget + * @param pTarget * @param keepLogin * @return */ @@ -611,37 +611,37 @@ private Response handleImplicitFlowcookie(final String redirectUriStr, final String clientId, final String host, final String cookieRefreshToken, - final String dcTarget, + final String pTarget, final String keepLogin, final String state, - final String dcOwner) { + final String pOwner) { IRefreshToken rToken = null; IAccessToken aToken = null; try { AbstractOAuth2Token token = AbstractOAuth2Token.parse(cookieRefreshToken, cell.getUrl(), host); if (!(token instanceof IRefreshToken)) { - return returnErrorMessage(clientId, redirectUriStr, missCookieMsg, state, dcTarget, dcOwner); + return returnErrorMessage(clientId, redirectUriStr, missCookieMsg, state, pTarget, pOwner); } // リフレッシュトークンの有効期限チェック if (token.isRefreshExpired()) { - return returnErrorMessage(clientId, redirectUriStr, missCookieMsg, state, dcTarget, dcOwner); + return returnErrorMessage(clientId, redirectUriStr, missCookieMsg, state, pTarget, pOwner); } long issuedAt = new Date().getTime(); - if (Key.TRUE_STR.equals(dcOwner)) { + if (Key.TRUE_STR.equals(pOwner)) { // 自分セルリフレッシュの場合のみ昇格できる。 if (token.getClass() != CellLocalRefreshToken.class) { - return returnErrorMessage(clientId, redirectUriStr, missCookieMsg, state, dcTarget, dcOwner); + return returnErrorMessage(clientId, redirectUriStr, missCookieMsg, state, pTarget, pOwner); } // ユニット昇格権限設定のチェック if (!this.davRsCmp.checkOwnerRepresentativeAccounts(token.getSubject())) { - return returnErrorMessage(clientId, redirectUriStr, missCookieMsg, state, dcTarget, dcOwner); + return returnErrorMessage(clientId, redirectUriStr, missCookieMsg, state, pTarget, pOwner); } // セルのオーナーが未設定のセルに対しては昇格させない。 if (cell.getOwner() == null) { - return returnErrorMessage(clientId, redirectUriStr, missCookieMsg, state, dcTarget, dcOwner); + return returnErrorMessage(clientId, redirectUriStr, missCookieMsg, state, pTarget, pOwner); } // uluut発行処理 @@ -654,7 +654,7 @@ private Response handleImplicitFlowcookie(final String redirectUriStr, return returnSuccessRedirect(redirectUriStr, uluut.toTokenString(), uluut.expiresIn(), null, keepLogin, state); } catch (MalformedURLException e) { - return returnErrorMessage(clientId, redirectUriStr, missCookieMsg, state, dcTarget, dcOwner); + return returnErrorMessage(clientId, redirectUriStr, missCookieMsg, state, pTarget, pOwner); } } else { // 受け取ったRefresh Tokenから AccessTokenとRefreshTokenを再生成 @@ -664,26 +664,26 @@ private Response handleImplicitFlowcookie(final String redirectUriStr, if (rToken instanceof CellLocalRefreshToken) { String subject = rToken.getSubject(); List roleList = cell.getRoleListForAccount(subject); - aToken = rToken.refreshAccessToken(issuedAt, dcTarget, cell.getUrl(), roleList); + aToken = rToken.refreshAccessToken(issuedAt, pTarget, cell.getUrl(), roleList); } else { // CELLに依頼してトークン発行元のロールから自分のところのロールを決定する。 List rolesHere = cell.getRoleListHere((IExtRoleContainingToken) rToken); - aToken = rToken.refreshAccessToken(issuedAt, dcTarget, cell.getUrl(), rolesHere); + aToken = rToken.refreshAccessToken(issuedAt, pTarget, cell.getUrl(), rolesHere); } } } catch (TokenParseException e) { // パースに失敗したので - DcCoreLog.Auth.TOKEN_PARSE_ERROR.params(e.getMessage()).writeLog(); - return returnErrorMessage(clientId, redirectUriStr, missCookieMsg, state, dcTarget, dcOwner); + PersoniumCoreLog.Auth.TOKEN_PARSE_ERROR.params(e.getMessage()).writeLog(); + return returnErrorMessage(clientId, redirectUriStr, missCookieMsg, state, pTarget, pOwner); } catch (TokenDsigException e) { // 証明書検証に失敗したので - DcCoreLog.Auth.TOKEN_DISG_ERROR.params(e.getMessage()).writeLog(); - return returnErrorMessage(clientId, redirectUriStr, missCookieMsg, state, dcTarget, dcOwner); + PersoniumCoreLog.Auth.TOKEN_DISG_ERROR.params(e.getMessage()).writeLog(); + return returnErrorMessage(clientId, redirectUriStr, missCookieMsg, state, pTarget, pOwner); } catch (TokenRootCrtException e) { // ルートCA証明書の設定エラー - DcCoreLog.Auth.ROOT_CA_CRT_SETTING_ERROR.params(e.getMessage()).writeLog(); - return returnErrorMessage(clientId, redirectUriStr, missCookieMsg, state, dcTarget, dcOwner); + PersoniumCoreLog.Auth.ROOT_CA_CRT_SETTING_ERROR.params(e.getMessage()).writeLog(); + return returnErrorMessage(clientId, redirectUriStr, missCookieMsg, state, pTarget, pOwner); } // Cookieでの認証成功 // 302でレスポンスし、Locationヘッダを返却 @@ -691,7 +691,7 @@ private Response handleImplicitFlowcookie(final String redirectUriStr, return returnSuccessRedirect(redirectUriStr, aToken.toTokenString(), aToken.expiresIn(), rToken.toTokenString(), keepLogin, state); } catch (MalformedURLException e) { - return returnErrorMessage(clientId, redirectUriStr, missCookieMsg, state, dcTarget, dcOwner); + return returnErrorMessage(clientId, redirectUriStr, missCookieMsg, state, pTarget, pOwner); } } @@ -703,11 +703,11 @@ private Response handleImplicitFlowcookie(final String redirectUriStr, * @param username * @param password * @param cookieRefreshToken - * @param dcTarget + * @param pTarget * @param keepLogin * @param assertion * @param state - * @param dcOwner TODO + * @param pOwner TODO * @return */ private Response handleImplicitFlow( @@ -717,17 +717,17 @@ private Response handleImplicitFlow( final String username, final String password, final String cookieRefreshToken, - final String dcTarget, + final String pTarget, final String keepLogin, final String assertion, final String schema, final String state, - final String dcOwner) { + final String pOwner) { - // dc_target がURLでない場合はヘッダInjectionの脆弱性を産んでしまう。(改行コードが入っているなど) + // p_target がURLでない場合はヘッダInjectionの脆弱性を産んでしまう。(改行コードが入っているなど) try { - this.checkDcTarget(dcTarget); - } catch (DcCoreAuthnException e) { + this.checkPTarget(pTarget); + } catch (PersoniumCoreAuthnException e) { return this.returnErrorRedirect(redirectUriStr, OAuth2Helper.Error.INVALID_REQUEST, e.getMessage(), state, "code"); } @@ -737,13 +737,13 @@ private Response handleImplicitFlow( // パスワード認証・トランスセルトークン認証・cookie認証の切り分け if (username != null || password != null) { // ユーザID・パスワードのどちらかに設定がある場合 - Response response = this.handleImplicitFlowPassWord(dcTarget, redirectUriStr, clientId, - username, password, keepLogin, state, dcOwner, host); + Response response = this.handleImplicitFlowPassWord(pTarget, redirectUriStr, clientId, + username, password, keepLogin, state, pOwner, host); - if (DcCoreConfig.getAccountLastAuthenticatedEnable() + if (PersoniumUnitConfig.getAccountLastAuthenticatedEnable() && isSuccessAuthorization(response)) { // Accountのスキーマ情報を取得する - DcODataProducer producer = ModelFactory.ODataCtl.cellCtl(cell); + PersoniumODataProducer producer = ModelFactory.ODataCtl.cellCtl(cell); EdmEntitySet esetAccount = producer.getMetadata().getEdmEntitySet(Account.EDM_TYPE_NAME); OEntityKey originalKey = OEntityKey.parse("('" + username + "')"); // 最終ログイン時刻の変更をProducerに依頼(このメソッド内でロックを取得・解放) @@ -752,17 +752,17 @@ && isSuccessAuthorization(response)) { return response; } else if (assertion != null && !"".equals(assertion)) { // assertionの指定がある場合 - return this.handleImplicitFlowTcToken(redirectUriStr, clientId, assertion, dcTarget, keepLogin, schema, + return this.handleImplicitFlowTcToken(redirectUriStr, clientId, assertion, pTarget, keepLogin, schema, state); } else if (cookieRefreshToken != null) { // cookieの指定がある場合 // cookie認証の場合、keepLoginは常にtrueとして動作する return this.handleImplicitFlowcookie(redirectUriStr, clientId, host, - cookieRefreshToken, dcTarget, OAuth2Helper.Key.TRUE_STR, state, dcOwner); + cookieRefreshToken, pTarget, OAuth2Helper.Key.TRUE_STR, state, pOwner); } else { // ユーザID・パスワード・assertion・cookieが未指定の場合、フォーム送信 ResponseBuilder rb = Response.ok().type(MediaType.TEXT_HTML); - return rb.entity(this.createForm(clientId, redirectUriStr, passFormMsg, state, dcTarget, dcOwner)) + return rb.entity(this.createForm(clientId, redirectUriStr, passFormMsg, state, pTarget, pOwner)) .header("Content-Type", "text/html; charset=UTF-8").build(); } } @@ -833,13 +833,13 @@ private Response returnSuccessRedirect(String redirectUriStr, String localTokenS // 実行環境がhttpsの場合のみ、secureフラグを立てる if (OAuth2Helper.Key.TRUE_STR.equals(keepLogin)) { // Cookieの有効期限を24時間に設定 - cookies = new NewCookie(cookie, "", COOKIE_MAX_AGE, DcCoreConfig.isHttps()); + cookies = new NewCookie(cookie, "", COOKIE_MAX_AGE, PersoniumUnitConfig.isHttps()); } else { // Cookieの有効期限を設定しない - cookies = new NewCookie(cookie, "", -1, DcCoreConfig.isHttps()); + cookies = new NewCookie(cookie, "", -1, PersoniumUnitConfig.isHttps()); } } else { - cookies = new NewCookie(cookie, "", 0, DcCoreConfig.isHttps()); + cookies = new NewCookie(cookie, "", 0, PersoniumUnitConfig.isHttps()); } return rb.entity("").cookie(cookies).build(); } @@ -899,9 +899,9 @@ private Response returnErrorRedirect(String redirectUri, String error, * @return */ private Response returnErrorMessage(String clientId, String redirectUriStr, String massage, - String state, String dcTarget, String dcOwner) { + String state, String pTarget, String pOwner) { ResponseBuilder rb = Response.ok().type(MediaType.TEXT_HTML); - return rb.entity(this.createForm(clientId, redirectUriStr, massage, state, dcTarget, dcOwner)) + return rb.entity(this.createForm(clientId, redirectUriStr, massage, state, pTarget, pOwner)) .header("Content-Type", "text/html; charset=UTF-8").build(); } @@ -959,7 +959,7 @@ private boolean checkAuthorization(final String clientId) { private void checkImplicitParam(String clientId, String redirectUri, URI baseUri) { if (redirectUri == null || clientId == null) { // TODO 一方がnullの場合はエラー。メッセージ変更の必要あり - throw DcCoreAuthnException.INVALID_TARGET; + throw PersoniumCoreAuthnException.INVALID_TARGET; } URL objClientId = null; @@ -967,19 +967,19 @@ private void checkImplicitParam(String clientId, String redirectUri, URI baseUri try { objClientId = new URL(clientId); } catch (MalformedURLException e) { - throw DcCoreException.Auth.REQUEST_PARAM_CLIENTID_INVALID; + throw PersoniumCoreException.Auth.REQUEST_PARAM_CLIENTID_INVALID; } try { objRedirectUri = new URL(redirectUri); } catch (MalformedURLException e) { - throw DcCoreException.Auth.REQUEST_PARAM_REDIRECT_INVALID; + throw PersoniumCoreException.Auth.REQUEST_PARAM_REDIRECT_INVALID; } if ((redirectUri.contains("\n") || redirectUri.contains("\r"))) { - throw DcCoreException.Auth.REQUEST_PARAM_REDIRECT_INVALID; + throw PersoniumCoreException.Auth.REQUEST_PARAM_REDIRECT_INVALID; } if ((clientId.contains("\n") || clientId.contains("\r"))) { - throw DcCoreException.Auth.REQUEST_PARAM_CLIENTID_INVALID; + throw PersoniumCoreException.Auth.REQUEST_PARAM_CLIENTID_INVALID; } // baseurlのパスを取得する @@ -997,12 +997,12 @@ private void checkImplicitParam(String clientId, String redirectUri, URI baseUri // セルのURLまでの比較 if (!objClientId.getAuthority().equals(objRedirectUri.getAuthority()) || !cPaths[0].equals(rPaths[0])) { - throw DcCoreException.Auth.REQUEST_PARAM_REDIRECT_INVALID; + throw PersoniumCoreException.Auth.REQUEST_PARAM_REDIRECT_INVALID; } // client_idとリクエストされたCellの名前を比較し、セルが同じ場合はエラー if (cPaths[0].equals(this.cell.getName())) { - throw DcCoreException.Auth.REQUEST_PARAM_CLIENTID_INVALID; + throw PersoniumCoreException.Auth.REQUEST_PARAM_CLIENTID_INVALID; } } @@ -1013,6 +1013,6 @@ private void checkImplicitParam(String clientId, String redirectUri, URI baseUri */ @OPTIONS public Response options() { - return DcCoreUtils.responseBuilderForOptions(HttpMethod.POST, HttpMethod.GET).build(); + return PersoniumCoreUtils.responseBuilderForOptions(HttpMethod.POST, HttpMethod.GET).build(); } } diff --git a/src/main/java/com/fujitsu/dc/core/rs/cell/BoxUrlResource.java b/src/main/java/io/personium/core/rs/cell/BoxUrlResource.java similarity index 65% rename from src/main/java/com/fujitsu/dc/core/rs/cell/BoxUrlResource.java rename to src/main/java/io/personium/core/rs/cell/BoxUrlResource.java index a25a9e397..0012c9564 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/cell/BoxUrlResource.java +++ b/src/main/java/io/personium/core/rs/cell/BoxUrlResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.cell; +package io.personium.core.rs.cell; import javax.ws.rs.GET; import javax.ws.rs.QueryParam; @@ -23,17 +23,17 @@ import org.apache.http.HttpStatus; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.auth.BoxPrivilege; -import com.fujitsu.dc.core.auth.OAuth2Helper; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.BoxUrlRsCmp; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.DavCmp; -import com.fujitsu.dc.core.model.DavRsCmp; -import com.fujitsu.dc.core.model.ModelFactory; -import com.fujitsu.dc.core.utils.ODataUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.auth.AccessContext; +import io.personium.core.auth.BoxPrivilege; +import io.personium.core.auth.OAuth2Helper; +import io.personium.core.model.Box; +import io.personium.core.model.BoxUrlRsCmp; +import io.personium.core.model.CellRsCmp; +import io.personium.core.model.DavCmp; +import io.personium.core.model.DavRsCmp; +import io.personium.core.model.ModelFactory; +import io.personium.core.utils.ODataUtils; /** * BoxURL取得用JAX-RS Resource. @@ -41,18 +41,15 @@ public class BoxUrlResource { private AccessContext accessContext = null; - private Cell cell = null; - private DavRsCmp davRsCmp; + private CellRsCmp cellRsCmp; /** * constructor. - * @param cell Cell - * @param davRsCmp DavRsCmp + * @param cellRsCmp DavRsCmp */ - public BoxUrlResource(final Cell cell, final DavRsCmp davRsCmp) { - this.davRsCmp = davRsCmp; - this.accessContext = this.davRsCmp.getAccessContext(); - this.cell = cell; + public BoxUrlResource(final CellRsCmp cellRsCmp) { + this.cellRsCmp = cellRsCmp; + this.accessContext = this.cellRsCmp.getAccessContext(); } /** @@ -75,26 +72,31 @@ public final Response boxUrl(@QueryParam("schema") final String querySchema) { } else { // クエリ指定がある場合は、schemaのチェックをおこなう if (!ODataUtils.isValidSchemaUri(querySchema)) { - throw DcCoreException.OData.QUERY_INVALID_ERROR.params("schema", querySchema); + throw PersoniumCoreException.OData.QUERY_INVALID_ERROR.params("schema", querySchema); } } - // スキーマ情報からBoxを取得する - Box box = this.cell.getBoxForSchema(schema); + Box box = null; + if (schema == null || schema.length() == 0) { + box = this.cellRsCmp.getBox(); + } else { + // スキーマ情報からBoxを取得する + box = this.cellRsCmp.getCell().getBoxForSchema(schema); + } // Boxが存在しない場合も権限エラーを返却する if (box == null) { // Basic認証が許可されているかのチェック this.accessContext.updateBasicAuthenticationStateForResource(null); if (AccessContext.TYPE_INVALID.equals(accessContext.getType())) { - accessContext.throwInvalidTokenException(this.davRsCmp.getAcceptableAuthScheme()); + accessContext.throwInvalidTokenException(this.cellRsCmp.getAcceptableAuthScheme()); } - throw DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + throw PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; } // 認証トークンの有効性チェック(有効期限の切れているトークンなど) DavCmp davCmp = ModelFactory.boxCmp(box); - DavRsCmp boxUrlRsCmp = new BoxUrlRsCmp(davCmp, this.cell, this.accessContext, box); + DavRsCmp boxUrlRsCmp = new BoxUrlRsCmp(this.cellRsCmp, davCmp, this.accessContext, box); boxUrlRsCmp.checkAccessContext(this.accessContext, BoxPrivilege.READ); // レスポンスを返却する diff --git a/src/main/java/com/fujitsu/dc/core/rs/cell/CellCtlResource.java b/src/main/java/io/personium/core/rs/cell/CellCtlResource.java similarity index 81% rename from src/main/java/com/fujitsu/dc/core/rs/cell/CellCtlResource.java rename to src/main/java/io/personium/core/rs/cell/CellCtlResource.java index db2c45a8d..96e25cbaa 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/cell/CellCtlResource.java +++ b/src/main/java/io/personium/core/rs/cell/CellCtlResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.cell; +package io.personium.core.rs.cell; import javax.ws.rs.GET; import javax.ws.rs.OPTIONS; @@ -24,42 +24,42 @@ import org.apache.commons.lang.NotImplementedException; import org.odata4j.core.OEntityKey; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.auth.AuthUtils; -import com.fujitsu.dc.core.auth.CellPrivilege; -import com.fujitsu.dc.core.auth.OAuth2Helper.AcceptableAuthScheme; -import com.fujitsu.dc.core.auth.Privilege; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.DavRsCmp; -import com.fujitsu.dc.core.model.ModelFactory; -import com.fujitsu.dc.core.model.ctl.Account; -import com.fujitsu.dc.core.model.ctl.ExtCell; -import com.fujitsu.dc.core.model.ctl.ExtRole; -import com.fujitsu.dc.core.model.ctl.ReceivedMessage; -import com.fujitsu.dc.core.model.ctl.Relation; -import com.fujitsu.dc.core.model.ctl.Role; -import com.fujitsu.dc.core.model.ctl.SentMessage; -import com.fujitsu.dc.core.odata.OEntityWrapper; -import com.fujitsu.dc.core.rs.odata.ODataResource; +import io.personium.core.auth.AccessContext; +import io.personium.core.auth.AuthUtils; +import io.personium.core.auth.CellPrivilege; +import io.personium.core.auth.OAuth2Helper.AcceptableAuthScheme; +import io.personium.core.auth.Privilege; +import io.personium.core.model.Box; +import io.personium.core.model.DavRsCmp; +import io.personium.core.model.ModelFactory; +import io.personium.core.model.ctl.Account; +import io.personium.core.model.ctl.ExtCell; +import io.personium.core.model.ctl.ExtRole; +import io.personium.core.model.ctl.ReceivedMessage; +import io.personium.core.model.ctl.Relation; +import io.personium.core.model.ctl.Role; +import io.personium.core.model.ctl.SentMessage; +import io.personium.core.odata.OEntityWrapper; +import io.personium.core.rs.odata.ODataResource; /** * JAX-RS Resource handling DC Cell Level Api. */ public final class CellCtlResource extends ODataResource { - String dcCredHeader; + String pCredHeader; DavRsCmp davRsCmp; /** * constructor. * @param accessContext AccessContext - * @param dcCredHeader X-Dc-Credentialヘッダ + * @param pCredHeader X-Personium-Credentialヘッダ * @param davRsCmp davRsCmp */ - public CellCtlResource(final AccessContext accessContext, final String dcCredHeader, DavRsCmp davRsCmp) { + public CellCtlResource(final AccessContext accessContext, final String pCredHeader, DavRsCmp davRsCmp) { super(accessContext, accessContext.getCell().getUrl() + "__ctl/", ModelFactory.ODataCtl.cellCtl(accessContext .getCell())); - this.dcCredHeader = dcCredHeader; + this.pCredHeader = pCredHeader; this.davRsCmp = davRsCmp; } @@ -89,7 +89,7 @@ public void checkSchemaAuth(AccessContext ac) { @Override public void beforeCreate(final OEntityWrapper oEntityWrapper) { String entitySetName = oEntityWrapper.getEntitySet().getName(); - String hPassStr = AuthUtils.checkValidatePassword(dcCredHeader, entitySetName); + String hPassStr = AuthUtils.checkValidatePassword(pCredHeader, entitySetName); if (hPassStr != null) { oEntityWrapper.put("HashedCredential", hPassStr); } @@ -98,7 +98,7 @@ public void beforeCreate(final OEntityWrapper oEntityWrapper) { @Override public void beforeUpdate(final OEntityWrapper oEntityWrapper, final OEntityKey oEntityKey) { String entitySetName = oEntityWrapper.getEntitySet().getName(); - String hPassStr = AuthUtils.checkValidatePassword(dcCredHeader, entitySetName); + String hPassStr = AuthUtils.checkValidatePassword(pCredHeader, entitySetName); if (hPassStr != null) { oEntityWrapper.put("HashedCredential", hPassStr); } diff --git a/src/main/java/com/fujitsu/dc/core/rs/cell/CellResource.java b/src/main/java/io/personium/core/rs/cell/CellResource.java similarity index 76% rename from src/main/java/com/fujitsu/dc/core/rs/cell/CellResource.java rename to src/main/java/io/personium/core/rs/cell/CellResource.java index c0b3c77c0..baf271ebe 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/cell/CellResource.java +++ b/src/main/java/io/personium/core/rs/cell/CellResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.cell; +package io.personium.core.rs.cell; import java.io.IOException; import java.io.Reader; @@ -41,23 +41,23 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.es.util.IndexNameEncoder; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreAuthzException; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.annotations.ACL; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.auth.CellPrivilege; -import com.fujitsu.dc.core.event.DcEvent; -import com.fujitsu.dc.core.event.EventBus; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.CellCmp; -import com.fujitsu.dc.core.model.CellRsCmp; -import com.fujitsu.dc.core.model.ModelFactory; -import com.fujitsu.dc.core.model.lock.UnitUserLockManager; -import com.fujitsu.dc.core.rs.box.BoxResource; +import io.personium.common.es.util.IndexNameEncoder; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumCoreAuthzException; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.annotations.ACL; +import io.personium.core.auth.AccessContext; +import io.personium.core.auth.CellPrivilege; +import io.personium.core.event.PersoniumEvent; +import io.personium.core.event.EventBus; +import io.personium.core.model.Box; +import io.personium.core.model.Cell; +import io.personium.core.model.CellCmp; +import io.personium.core.model.CellRsCmp; +import io.personium.core.model.ModelFactory; +import io.personium.core.model.lock.UnitUserLockManager; +import io.personium.core.rs.box.BoxResource; /** * JAX-RS Resource handling Cell Level Api. @@ -81,12 +81,12 @@ public CellResource( this.accessContext = accessContext; this.cell = this.accessContext.getCell(); if (this.cell == null) { - throw DcCoreException.Dav.CELL_NOT_FOUND; + throw PersoniumCoreException.Dav.CELL_NOT_FOUND; } this.cellCmp = ModelFactory.cellCmp(this.cell); if (!this.cellCmp.exists()) { // クリティカルなタイミングでCellが削除された場合 - throw DcCoreException.Dav.CELL_NOT_FOUND; + throw PersoniumCoreException.Dav.CELL_NOT_FOUND; } this.cellRsCmp = new CellRsCmp(this.cellCmp, this.cell, this.accessContext); @@ -95,7 +95,7 @@ public CellResource( private void checkReferenceMode() { Cell cellObj = accessContext.getCell(); - String unitPrefix = DcCoreConfig.getEsUnitPrefix(); + String unitPrefix = PersoniumUnitConfig.getEsUnitPrefix(); String owner = cellObj.getOwner(); if (owner == null) { @@ -104,7 +104,7 @@ private void checkReferenceMode() { owner = IndexNameEncoder.encodeEsIndexName(owner); } if (UnitUserLockManager.hasLockObject(unitPrefix + "_" + owner)) { - throw DcCoreException.Server.SERVICE_MENTENANCE_RESTORE; + throw PersoniumCoreException.Server.SERVICE_MENTENANCE_RESTORE; } } @@ -122,7 +122,7 @@ private void checkReferenceMode() { public Response getSvcDoc() { StringBuffer sb = new StringBuffer(); sb.append(""); - sb.append(""); + sb.append(""); sb.append("" + this.cell.getId() + ""); sb.append("" + this.cell.getUrl() + "__ctl/" + ""); sb.append(""); @@ -132,15 +132,15 @@ public Response getSvcDoc() { /** * handler for DELETE Method. * ie, Recursive Cell Deletion. - * @param recursiveHeader X-Dc-Recursive Header + * @param recursiveHeader X-Personium-Recursive Header * @return JAX-RS Response Object */ @DELETE public Response cellBulkDeletion( - @HeaderParam(DcCoreUtils.HttpHeaders.X_DC_RECURSIVE) final String recursiveHeader) { - // X-Dc-Recursiveヘッダの指定が"true"でない場合はエラーとする + @HeaderParam(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_RECURSIVE) final String recursiveHeader) { + // X-Personium-Recursiveヘッダの指定が"true"でない場合はエラーとする if (!"true".equals(recursiveHeader)) { - throw DcCoreException.Misc.PRECONDITION_FAILED.params(DcCoreUtils.HttpHeaders.X_DC_RECURSIVE); + throw PersoniumCoreException.Misc.PRECONDITION_FAILED.params(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_RECURSIVE); } // アクセス権限の確認を実施する // ユニットマスター、ユニットユーザ、ユニットローカルユニットユーザ以外は権限エラーとする @@ -171,46 +171,46 @@ private void checkAccessContextForCellBulkDeletion(String cellOwner) { if (AccessContext.TYPE_INVALID.equals(accessType)) { this.accessContext.throwInvalidTokenException(this.cellRsCmp.getAcceptableAuthScheme()); } else if (AccessContext.TYPE_ANONYMOUS.equals(accessType)) { - throw DcCoreAuthzException.AUTHORIZATION_REQUIRED.realm(accessContext.getRealm(), + throw PersoniumCoreAuthzException.AUTHORIZATION_REQUIRED.realm(accessContext.getRealm(), this.cellRsCmp.getAcceptableAuthScheme()); } else if (!AccessContext.TYPE_UNIT_MASTER.equals(accessType) && !AccessContext.TYPE_UNIT_USER.equals(accessType) && !AccessContext.TYPE_UNIT_LOCAL.equals(accessType)) { - throw DcCoreException.Auth.UNITUSER_ACCESS_REQUIRED; + throw PersoniumCoreException.Auth.UNITUSER_ACCESS_REQUIRED; } else if (AccessContext.TYPE_UNIT_USER.equals(accessType) || AccessContext.TYPE_UNIT_LOCAL.equals(accessType)) { // ユニットユーザ、ユニットローカルユニットユーザの場合はセルオーナとアクセス主体が一致するかチェック String subject = this.accessContext.getSubject(); if (cellOwner == null || !cellOwner.equals(subject)) { - throw DcCoreException.Auth.NOT_YOURS; + throw PersoniumCoreException.Auth.NOT_YOURS; } } } /** - * @param dcCredHeader dcCredHeader X-Dc-Credentialヘッダ + * @param pCredHeader pCredHeader X-Personium-Credentialヘッダ * @return CellCtlResource */ @Path("__ctl") - public CellCtlResource ctl(@HeaderParam(DcCoreUtils.HttpHeaders.X_DC_CREDENTIAL) final String dcCredHeader) { - return new CellCtlResource(this.accessContext, dcCredHeader, this.cellRsCmp); + public CellCtlResource ctl(@HeaderParam(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_CREDENTIAL) final String pCredHeader) { + return new CellCtlResource(this.accessContext, pCredHeader, this.cellRsCmp); } /** * パスワード変更APIのエンドポイント. - * @param dcCredHeader dcCredHeader + * @param pCredHeader pCredHeader * @return Response */ @Path("__mypassword") public PasswordResource mypassword( - @HeaderParam(DcCoreUtils.HttpHeaders.X_DC_CREDENTIAL) final String dcCredHeader) { - return new PasswordResource(this.accessContext, dcCredHeader, this.cell, this.cellRsCmp); + @HeaderParam(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_CREDENTIAL) final String pCredHeader) { + return new PasswordResource(this.accessContext, pCredHeader, this.cell, this.cellRsCmp); } /** * 認証のエンドポイント . *
    - *
  • dc_targetにURLが書いてあれば、そのCELLをTARGETのCELLとしてtransCellTokenを発行する。
  • + *
  • p_targetにURLが書いてあれば、そのCELLをTARGETのCELLとしてtransCellTokenを発行する。
  • *
  • scopeがなければCellLocalを発行する。
  • *
* @return TokenEndPointResourceオブジェクト @@ -223,7 +223,7 @@ public TokenEndPointResource auth() { /** * ImplicitFlow認証のエンドポイント . *
    - *
  • dc_targetにURLが書いてあれば、そのCELLをTARGETのCELLとしてtransCellTokenを発行する。
  • + *
  • p_targetにURLが書いてあれば、そのCELLをTARGETのCELLとしてtransCellTokenを発行する。
  • *
* @return AuthzEndPointResourceオブジェクト */ @@ -256,7 +256,7 @@ public RoleResource role() { */ @Path("__box") public BoxUrlResource boxUrl() { - return new BoxUrlResource(this.cell, this.cellRsCmp); + return new BoxUrlResource(this.cellRsCmp); } /** @@ -280,7 +280,7 @@ public Response postEvent( if (box != null) { schema = box.getSchema(); } - // Bodyを解釈してDcEventオブジェクトをつくる。 + // Bodyを解釈してPersoniumEventオブジェクトをつくる。 JSONParser parser = new JSONParser(); try { JSONObject evJson = (JSONObject) parser.parse(reader); @@ -288,22 +288,22 @@ public Response postEvent( String action = (String) evJson.get("action"); String object = (String) evJson.get("object"); String result = (String) evJson.get("result"); - int level = DcEvent.Level.INFO; + int level = PersoniumEvent.Level.INFO; if ("warn".equalsIgnoreCase(levelStr)) { - level = DcEvent.Level.WARN; + level = PersoniumEvent.Level.WARN; } else if ("error".equalsIgnoreCase(levelStr)) { - level = DcEvent.Level.ERROR; + level = PersoniumEvent.Level.ERROR; } - DcEvent ev = new DcEvent("client", schema, level, subject, action, object, result); + PersoniumEvent ev = new PersoniumEvent("client", schema, level, subject, action, object, result); - // DcEventオブジェクトをEventBusオブジェクトに流す. + // PersoniumEventオブジェクトをEventBusオブジェクトに流す. EventBus eventBus = this.cell.getEventBus(); eventBus.post(ev); return Response.ok().build(); } catch (IOException e) { - throw DcCoreException.Server.UNKNOWN_ERROR.reason(e); + throw PersoniumCoreException.Server.UNKNOWN_ERROR.reason(e); } catch (ParseException e) { - throw DcCoreException.Event.JSON_PARSE_ERROR.reason(e); + throw PersoniumCoreException.Event.JSON_PARSE_ERROR.reason(e); } } @@ -374,7 +374,7 @@ public BoxResource box( */ @WebDAVMethod.PROPFIND public Response propfind(final Reader requestBodyXml, - @DefaultValue("0") @HeaderParam(DcCoreUtils.HttpHeaders.DEPTH) final String depth, + @DefaultValue("0") @HeaderParam(PersoniumCoreUtils.HttpHeaders.DEPTH) final String depth, @HeaderParam(HttpHeaders.CONTENT_LENGTH) final Long contentLength, @HeaderParam("Transfer-Encoding") final String transferEncoding) { @@ -396,13 +396,13 @@ public Response proppatch(final Reader requestBodyXml) { if (AccessContext.TYPE_INVALID.equals(ac.getType())) { ac.throwInvalidTokenException(this.cellRsCmp.getAcceptableAuthScheme()); } else if (AccessContext.TYPE_ANONYMOUS.equals(ac.getType())) { - throw DcCoreAuthzException.AUTHORIZATION_REQUIRED.realm(ac.getRealm(), + throw PersoniumCoreAuthzException.AUTHORIZATION_REQUIRED.realm(ac.getRealm(), this.cellRsCmp.getAcceptableAuthScheme()); } // アクセス制御 CellレベルPROPPATCHはユニットユーザのみ可能とする if (!ac.isUnitUserToken()) { - throw DcCoreException.Auth.UNITUSER_ACCESS_REQUIRED; + throw PersoniumCoreException.Auth.UNITUSER_ACCESS_REQUIRED; } return this.cellRsCmp.doProppatch(requestBodyXml); } @@ -427,9 +427,9 @@ public Response acl(final Reader reader) { public Response options() { // アクセス制御 this.cellRsCmp.checkAccessContext(this.cellRsCmp.getAccessContext(), CellPrivilege.SOCIAL_READ); - return DcCoreUtils.responseBuilderForOptions( + return PersoniumCoreUtils.responseBuilderForOptions( HttpMethod.POST, - DcCoreUtils.HttpMethod.PROPFIND + PersoniumCoreUtils.HttpMethod.PROPFIND ).build(); } diff --git a/src/main/java/com/fujitsu/dc/core/rs/cell/ErrorHtmlResource.java b/src/main/java/io/personium/core/rs/cell/ErrorHtmlResource.java similarity index 79% rename from src/main/java/com/fujitsu/dc/core/rs/cell/ErrorHtmlResource.java rename to src/main/java/io/personium/core/rs/cell/ErrorHtmlResource.java index 2f9e1a712..8f1c14722 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/cell/ErrorHtmlResource.java +++ b/src/main/java/io/personium/core/rs/cell/ErrorHtmlResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.cell; +package io.personium.core.rs.cell; import java.text.MessageFormat; @@ -32,9 +32,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreMessageUtils; -import com.fujitsu.dc.core.auth.OAuth2Helper.Key; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumCoreMessageUtils; +import io.personium.core.auth.OAuth2Helper.Key; /** * JAX-RS resource for HTML error response. @@ -66,16 +66,16 @@ public final Response implicitError(@HeaderParam(HttpHeaders.HOST) final String * @return HTML string */ private String htmlForCode(String code) { - String title = DcCoreMessageUtils.getMessage("PS-ER-0001"); + String title = PersoniumCoreMessageUtils.getMessage("PS-ER-0001"); String msg = null; try { - msg = DcCoreMessageUtils.getMessage(code); + msg = PersoniumCoreMessageUtils.getMessage(code); } catch (Exception e) { log.info(e.getMessage()); - msg = DcCoreMessageUtils.getMessage("PS-ER-0002"); + msg = PersoniumCoreMessageUtils.getMessage("PS-ER-0002"); } - String html = DcCoreUtils.readStringResource("html/error.html", CharEncoding.UTF_8); + String html = PersoniumCoreUtils.readStringResource("html/error.html", CharEncoding.UTF_8); html = MessageFormat.format(html, title, msg); return html; } diff --git a/src/main/java/com/fujitsu/dc/core/rs/cell/EventResource.java b/src/main/java/io/personium/core/rs/cell/EventResource.java similarity index 73% rename from src/main/java/com/fujitsu/dc/core/rs/cell/EventResource.java rename to src/main/java/io/personium/core/rs/cell/EventResource.java index 3d4d23d9c..6e06be280 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/cell/EventResource.java +++ b/src/main/java/io/personium/core/rs/cell/EventResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.cell; +package io.personium.core.rs.cell; import java.io.IOException; import java.io.Reader; @@ -33,15 +33,15 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.auth.CellPrivilege; -import com.fujitsu.dc.core.eventbus.DcEventBus; -import com.fujitsu.dc.core.eventbus.JSONEvent; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.DavRsCmp; -import com.fujitsu.dc.core.model.ctl.Event; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.auth.AccessContext; +import io.personium.core.auth.CellPrivilege; +import io.personium.core.eventbus.PersoniumEventBus; +import io.personium.core.eventbus.JSONEvent; +import io.personium.core.model.Cell; +import io.personium.core.model.DavRsCmp; +import io.personium.core.model.ctl.Event; /** * イベントバス用JAX-RS Resource. @@ -73,14 +73,14 @@ public EventResource(final Cell cell, final AccessContext accessContext, final D /** * イベントの受付. * @param reader リクエストボディ - * @param version X-Dc-Versionヘッダー値 - * @param requestKey X-Dc-RequestKeyヘッダー値 + * @param version X-Personium-Versionヘッダー値 + * @param requestKey X-Personium-RequestKeyヘッダー値 * @return JAXRS Response */ @POST public final Response receiveEvent(final Reader reader, - @HeaderParam(DcCoreUtils.HttpHeaders.X_DC_VERSION) final String version, - @HeaderParam(DcCoreUtils.HttpHeaders.X_DC_REQUESTKEY) String requestKey) { + @HeaderParam(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_VERSION) final String version, + @HeaderParam(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_REQUESTKEY) String requestKey) { // TODO findBugs対策↓ log.debug(this.cell.getName()); @@ -90,8 +90,8 @@ public final Response receiveEvent(final Reader reader, // アクセス制御 this.davRsCmp.checkAccessContext(this.davRsCmp.getAccessContext(), CellPrivilege.EVENT); - // X-Dc-RequestKeyの解析(指定なしの場合にデフォルト値を補充) - requestKey = validateXDcRequestKey(requestKey); + // X-Personium-RequestKeyの解析(指定なしの場合にデフォルト値を補充) + requestKey = validateXPersoniumRequestKey(requestKey); // TODO findBugs対策↓ log.debug(requestKey); @@ -105,7 +105,7 @@ public final Response receiveEvent(final Reader reader, // TODO ログ出力用のデフォルト設定情報を取得 // ログファイル出力 - DcEventBus eventBus = new DcEventBus(this.cell); + PersoniumEventBus eventBus = new PersoniumEventBus(this.cell); Event event = createEvent(reqBody, requestKey); eventBus.outputEventLog(event); @@ -121,7 +121,7 @@ public final Response receiveEvent(final Reader reader, public final Response updateLogSettings() { // TODO アクセス制御 // this.davRsCmp.checkAccessContext(this.davRsCmp.getAccessContext(), CellPrivilege.LOG); - throw DcCoreException.Misc.METHOD_NOT_IMPLEMENTED; + throw PersoniumCoreException.Misc.METHOD_NOT_IMPLEMENTED; } /** @@ -132,25 +132,25 @@ public final Response updateLogSettings() { public final Response getLogSettings() { // TODO アクセス制御 // this.davRsCmp.checkAccessContext(this.davRsCmp.getAccessContext(), CellPrivilege.LOG_READ); - throw DcCoreException.Misc.METHOD_NOT_IMPLEMENTED; + throw PersoniumCoreException.Misc.METHOD_NOT_IMPLEMENTED; } /** - * リクエストヘッダの X-Dc-RequestKey の正当性チェックを行う.
+ * リクエストヘッダの X-Personium-RequestKey の正当性チェックを行う.
* 不正な場合には例外を発する.
* 未指定時には、デフォルト値を補充する. * @param requestKey リクエストヘッダ - * @return 正当性チェック通過後の X-Dc-RequetKeyの値 + * @return 正当性チェック通過後の X-Personium-RequetKeyの値 */ - public static String validateXDcRequestKey(String requestKey) { + public static String validateXPersoniumRequestKey(String requestKey) { if (null == requestKey) { requestKey = String.format(REQEUST_KEY_DEFAULT_FORMAT, System.currentTimeMillis()); } if (MAXREQUEST_KEY_LENGTH < requestKey.length()) { - throw DcCoreException.Event.X_DC_REQUESTKEY_INVALID; + throw PersoniumCoreException.Event.X_PERSONIUM_REQUESTKEY_INVALID; } if (!REQUEST_KEY_PATTERN.matcher(requestKey).matches()) { - throw DcCoreException.Event.X_DC_REQUESTKEY_INVALID; + throw PersoniumCoreException.Event.X_PERSONIUM_REQUESTKEY_INVALID; } return requestKey; } @@ -171,10 +171,10 @@ protected JSONEvent getRequestBody(final Reader reader) { if (token == JsonToken.START_OBJECT) { event = mapper.readValue(jp, JSONEvent.class); } else { - throw DcCoreException.Event.JSON_PARSE_ERROR; + throw PersoniumCoreException.Event.JSON_PARSE_ERROR; } } catch (IOException e) { - throw DcCoreException.Event.JSON_PARSE_ERROR; + throw PersoniumCoreException.Event.JSON_PARSE_ERROR; } return event; } @@ -186,27 +186,27 @@ protected JSONEvent getRequestBody(final Reader reader) { protected void validateEventProperties(final JSONEvent event) { Event.LEVEL level = event.getLevel(); if (level == null) { - throw DcCoreException.Event.INPUT_REQUIRED_FIELD_MISSING.params("level"); + throw PersoniumCoreException.Event.INPUT_REQUIRED_FIELD_MISSING.params("level"); } else if (!JSONEvent.validateLevel(level)) { - throw DcCoreException.Event.REQUEST_FIELD_FORMAT_ERROR.params("level"); + throw PersoniumCoreException.Event.REQUEST_FIELD_FORMAT_ERROR.params("level"); } String action = event.getAction(); if (action == null) { - throw DcCoreException.Event.INPUT_REQUIRED_FIELD_MISSING.params("action"); + throw PersoniumCoreException.Event.INPUT_REQUIRED_FIELD_MISSING.params("action"); } else if (!JSONEvent.validateAction(action)) { - throw DcCoreException.Event.REQUEST_FIELD_FORMAT_ERROR.params("action"); + throw PersoniumCoreException.Event.REQUEST_FIELD_FORMAT_ERROR.params("action"); } String object = event.getObject(); if (object == null) { - throw DcCoreException.Event.INPUT_REQUIRED_FIELD_MISSING.params("object"); + throw PersoniumCoreException.Event.INPUT_REQUIRED_FIELD_MISSING.params("object"); } else if (!JSONEvent.validateObject(object)) { - throw DcCoreException.Event.REQUEST_FIELD_FORMAT_ERROR.params("object"); + throw PersoniumCoreException.Event.REQUEST_FIELD_FORMAT_ERROR.params("object"); } String result = event.getResult(); if (result == null) { - throw DcCoreException.Event.INPUT_REQUIRED_FIELD_MISSING.params("result"); + throw PersoniumCoreException.Event.INPUT_REQUIRED_FIELD_MISSING.params("result"); } else if (!JSONEvent.validateResult(result)) { - throw DcCoreException.Event.REQUEST_FIELD_FORMAT_ERROR.params("result"); + throw PersoniumCoreException.Event.REQUEST_FIELD_FORMAT_ERROR.params("result"); } } diff --git a/src/main/java/com/fujitsu/dc/core/rs/cell/LogResource.java b/src/main/java/io/personium/core/rs/cell/LogResource.java similarity index 88% rename from src/main/java/com/fujitsu/dc/core/rs/cell/LogResource.java rename to src/main/java/io/personium/core/rs/cell/LogResource.java index 4b19c88eb..1777cbde1 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/cell/LogResource.java +++ b/src/main/java/io/personium/core/rs/cell/LogResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.cell; +package io.personium.core.rs.cell; import java.io.BufferedInputStream; import java.io.BufferedReader; @@ -58,16 +58,16 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.auth.CellPrivilege; -import com.fujitsu.dc.core.event.EventUtils; -import com.fujitsu.dc.core.eventlog.ArchiveLogCollection; -import com.fujitsu.dc.core.eventlog.ArchiveLogFile; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.DavRsCmp; -import com.fujitsu.dc.core.utils.ResourceUtils; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.auth.AccessContext; +import io.personium.core.auth.CellPrivilege; +import io.personium.core.event.EventUtils; +import io.personium.core.eventlog.ArchiveLogCollection; +import io.personium.core.eventlog.ArchiveLogFile; +import io.personium.core.model.Cell; +import io.personium.core.model.DavRsCmp; +import io.personium.core.utils.ResourceUtils; /** * イベントログ用JAX-RS Resource. @@ -107,7 +107,7 @@ public LogResource(final Cell cell, final AccessContext accessContext, final Dav @PROPFIND public final Response currentPropfind() { // 現状はカレントログの一覧取得は未実装のため、501を返却する - throw DcCoreException.Misc.METHOD_NOT_IMPLEMENTED; + throw PersoniumCoreException.Misc.METHOD_NOT_IMPLEMENTED; } /** @@ -125,7 +125,7 @@ public final Response archivePropfind(final Reader requestBodyXml, @Context UriInfo uriInfo, @HeaderParam(HttpHeaders.CONTENT_LENGTH) final Long contentLength, @HeaderParam("Transfer-Encoding") final String transferEncoding, - @HeaderParam(DcCoreUtils.HttpHeaders.DEPTH) final String depth + @HeaderParam(PersoniumCoreUtils.HttpHeaders.DEPTH) final String depth ) { // アクセス制御 @@ -134,11 +134,11 @@ public final Response archivePropfind(final Reader requestBodyXml, // Depthヘッダの有効な値は 0, 1 // infinityの場合はサポートしないので403で返す if ("infinity".equals(depth)) { - throw DcCoreException.Dav.PROPFIND_FINITE_DEPTH; + throw PersoniumCoreException.Dav.PROPFIND_FINITE_DEPTH; } else if (depth == null) { - throw DcCoreException.Dav.INVALID_DEPTH_HEADER.params("null"); + throw PersoniumCoreException.Dav.INVALID_DEPTH_HEADER.params("null"); } else if (!("0".equals(depth) || "1".equals(depth))) { - throw DcCoreException.Dav.INVALID_DEPTH_HEADER.params(depth); + throw PersoniumCoreException.Dav.INVALID_DEPTH_HEADER.params(depth); } // リクエストボディをパースして pfオブジェクトを作成する @@ -150,11 +150,11 @@ public final Response archivePropfind(final Reader requestBodyXml, br = new BufferedReader(requestBodyXml); propfind = Propfind.unmarshal(br); } catch (Exception e) { - throw DcCoreException.Dav.XML_ERROR.reason(e); + throw PersoniumCoreException.Dav.XML_ERROR.reason(e); } } if (null != propfind && !propfind.isAllprop()) { - throw DcCoreException.Dav.XML_CONTENT_ERROR; + throw PersoniumCoreException.Dav.XML_CONTENT_ERROR; } // archiveコレクションと配下のファイルの情報を収集する @@ -266,12 +266,12 @@ public final Response getLogFile(@HeaderParam(HttpHeaders.IF_NONE_MATCH) final S // イベントログのCollection名のチェック if (!isValidLogCollection(logCollection)) { - throw DcCoreException.Dav.RESOURCE_NOT_FOUND; + throw PersoniumCoreException.Dav.RESOURCE_NOT_FOUND; } // ファイル名がdefault.log以外の場合は404を返却 if (!isValidLogFile(logCollection, fileName)) { - throw DcCoreException.Dav.RESOURCE_NOT_FOUND; + throw PersoniumCoreException.Dav.RESOURCE_NOT_FOUND; } String cellId = davRsCmp.getCell().getId(); @@ -296,7 +296,7 @@ private Response getLog(final String logCollection, String logFileName) { final InputStream isInvariable = new FileInputStream(logFile); return createResponse(isInvariable); } catch (FileNotFoundException e) { - throw DcCoreException.Dav.RESOURCE_NOT_FOUND; + throw PersoniumCoreException.Dav.RESOURCE_NOT_FOUND; } } else { ZipArchiveInputStream zipArchiveInputStream = null; @@ -314,15 +314,15 @@ private Response getLog(final String logCollection, String logFileName) { ZipArchiveEntry nextZipEntry = zipArchiveInputStream.getNextZipEntry(); if (nextZipEntry == null) { IOUtils.closeQuietly(bis); - throw DcCoreException.Event.ARCHIVE_FILE_CANNOT_OPEN; + throw PersoniumCoreException.Event.ARCHIVE_FILE_CANNOT_OPEN; } return createResponse(bis); } catch (FileNotFoundException e1) { // 圧縮ファイルが存在しない場合は404エラーを返却 - throw DcCoreException.Dav.RESOURCE_NOT_FOUND; + throw PersoniumCoreException.Dav.RESOURCE_NOT_FOUND; } catch (IOException e) { log.info("Failed to read archive entry : " + e.getMessage()); - throw DcCoreException.Event.ARCHIVE_FILE_CANNOT_OPEN; + throw PersoniumCoreException.Event.ARCHIVE_FILE_CANNOT_OPEN; } } } @@ -356,7 +356,7 @@ private Response getEmptyResponse() { @Path("{logCollection}/{filename}") @DELETE public final Response deleteLogFile() { - throw DcCoreException.Misc.METHOD_NOT_IMPLEMENTED; + throw PersoniumCoreException.Misc.METHOD_NOT_IMPLEMENTED; } /** diff --git a/src/main/java/com/fujitsu/dc/core/rs/cell/MessageODataResource.java b/src/main/java/io/personium/core/rs/cell/MessageODataResource.java similarity index 87% rename from src/main/java/com/fujitsu/dc/core/rs/cell/MessageODataResource.java rename to src/main/java/io/personium/core/rs/cell/MessageODataResource.java index 861efbd03..83e8edf07 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/cell/MessageODataResource.java +++ b/src/main/java/io/personium/core/rs/cell/MessageODataResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.cell; +package io.personium.core.rs.cell; import java.io.BufferedReader; import java.io.IOException; @@ -65,27 +65,27 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.auth.token.Role; -import com.fujitsu.dc.common.auth.token.TransCellAccessToken; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.auth.OAuth2Helper; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.model.ctl.CtlSchema; -import com.fujitsu.dc.core.model.ctl.ExtCell; -import com.fujitsu.dc.core.model.ctl.ReceivedMessage; -import com.fujitsu.dc.core.model.ctl.ReceivedMessagePort; -import com.fujitsu.dc.core.model.ctl.Relation; -import com.fujitsu.dc.core.model.ctl.SentMessage; -import com.fujitsu.dc.core.model.ctl.SentMessagePort; -import com.fujitsu.dc.core.model.impl.es.odata.CellCtlODataProducer; -import com.fujitsu.dc.core.odata.DcODataProducer; -import com.fujitsu.dc.core.odata.OEntityWrapper; -import com.fujitsu.dc.core.rs.odata.AbstractODataResource; -import com.fujitsu.dc.core.rs.odata.ODataResource; -import com.fujitsu.dc.core.utils.HttpClientFactory; -import com.fujitsu.dc.core.utils.ODataUtils; -import com.fujitsu.dc.core.utils.ResourceUtils; +import io.personium.common.auth.token.Role; +import io.personium.common.auth.token.TransCellAccessToken; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.auth.OAuth2Helper; +import io.personium.core.model.ctl.Common; +import io.personium.core.model.ctl.CtlSchema; +import io.personium.core.model.ctl.ExtCell; +import io.personium.core.model.ctl.ReceivedMessage; +import io.personium.core.model.ctl.ReceivedMessagePort; +import io.personium.core.model.ctl.Relation; +import io.personium.core.model.ctl.SentMessage; +import io.personium.core.model.ctl.SentMessagePort; +import io.personium.core.model.impl.es.odata.CellCtlODataProducer; +import io.personium.core.odata.PersoniumODataProducer; +import io.personium.core.odata.OEntityWrapper; +import io.personium.core.rs.odata.AbstractODataResource; +import io.personium.core.rs.odata.ODataResource; +import io.personium.core.utils.HttpClientFactory; +import io.personium.core.utils.ODataUtils; +import io.personium.core.utils.ResourceUtils; /** * __messageのOData操作クラス. @@ -107,7 +107,7 @@ public final class MessageODataResource extends AbstractODataResource { * @param producer ODataプロデューサ * @param entityTypeName エンティティタイプ名 */ - public MessageODataResource(MessageResource odataResource, DcODataProducer producer, String entityTypeName) { + public MessageODataResource(MessageResource odataResource, PersoniumODataProducer producer, String entityTypeName) { this.odataResource = odataResource; setOdataProducer(producer); setEntitySetName(entityTypeName); @@ -131,7 +131,7 @@ protected Response createMessage(UriInfo uriInfo, Reader reader) { // response用URLに__ctlを追加する - UriInfo resUriInfo = DcCoreUtils.createUriInfo(uriInfo, 2, "__ctl"); + UriInfo resUriInfo = PersoniumCoreUtils.createUriInfo(uriInfo, 2, "__ctl"); // Entityの作成を Producerに依頼 OEntityWrapper oew = getOEntityWrapper(reader, odataResource, CtlSchema.getEdmDataServicesForMessage().build()); @@ -164,9 +164,9 @@ protected Response changeMessageStatus(Reader reader, String key) { try { body = ResourceUtils.parseBodyAsJSON(reader); } catch (IOException e1) { - throw DcCoreException.OData.JSON_PARSE_ERROR.reason(e1); + throw PersoniumCoreException.OData.JSON_PARSE_ERROR.reason(e1); } catch (ParseException e1) { - throw DcCoreException.OData.JSON_PARSE_ERROR.reason(e1); + throw PersoniumCoreException.OData.JSON_PARSE_ERROR.reason(e1); } String status = (String) body.get(ReceivedMessage.MESSAGE_COMMAND); @@ -175,7 +175,7 @@ protected Response changeMessageStatus(Reader reader, String key) { && !ReceivedMessage.STATUS_READ.equals(status) && !ReceivedMessage.STATUS_APPROVED.equals(status) && !ReceivedMessage.STATUS_REJECTED.equals(status)) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(ReceivedMessage.MESSAGE_COMMAND); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(ReceivedMessage.MESSAGE_COMMAND); } // EdmEntitySetの取得 @@ -187,7 +187,7 @@ protected Response changeMessageStatus(Reader reader, String key) { try { oEntityKey = OEntityKey.parse("('" + key + "')"); } catch (IllegalArgumentException e) { - throw DcCoreException.OData.ENTITY_KEY_PARSE_ERROR.reason(e); + throw PersoniumCoreException.OData.ENTITY_KEY_PARSE_ERROR.reason(e); } // ステータス更新、及び関係登録/削除をProducerに依頼 @@ -354,10 +354,10 @@ protected List getExtCellListFromToRelation(String toRelation) { oEntityKey, "_" + ExtCell.EDM_TYPE_NAME, query); - } catch (DcCoreException e) { - if (DcCoreException.OData.NO_SUCH_ENTITY.getCode().equals(e.getCode())) { + } catch (PersoniumCoreException e) { + if (PersoniumCoreException.OData.NO_SUCH_ENTITY.getCode().equals(e.getCode())) { // ToRelationで指定されたRelationが存在しない場合は400エラーを返却 - throw DcCoreException.SentMessage.TO_RELATION_NOT_FOUND_ERROR.params(toRelation); + throw PersoniumCoreException.SentMessage.TO_RELATION_NOT_FOUND_ERROR.params(toRelation); } else { throw e; } @@ -370,7 +370,7 @@ protected List getExtCellListFromToRelation(String toRelation) { } if (extCellUrlList.isEmpty()) { // ToRelationで指定されたRelationに紐付くExtCellが存在しない場合は400エラーを返却 - throw DcCoreException.SentMessage.RELATED_EXTCELL_NOT_FOUND_ERROR.params(toRelation); + throw PersoniumCoreException.SentMessage.RELATED_EXTCELL_NOT_FOUND_ERROR.params(toRelation); } return extCellUrlList; } @@ -381,7 +381,7 @@ protected List getExtCellListFromToRelation(String toRelation) { */ public void checkMaxDestinationsSize(int destinationsSize) { if (destinationsSize > MAX_SENT_NUM) { - throw DcCoreException.SentMessage.OVER_MAX_SENT_NUM; + throw PersoniumCoreException.SentMessage.OVER_MAX_SENT_NUM; } } @@ -477,11 +477,11 @@ private List> requestHttpReceivedMessage( try { body = new StringEntity(jsonBody.toJSONString(), "UTF-8"); } catch (UnsupportedEncodingException e) { - throw DcCoreException.SentMessage.SM_BODY_PARSE_ERROR.reason(e); + throw PersoniumCoreException.SentMessage.SM_BODY_PARSE_ERROR.reason(e); } req.setEntity(body); - req.addHeader(DcCoreUtils.HttpHeaders.X_DC_VERSION, this.version); + req.addHeader(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_VERSION, this.version); req.addHeader(HttpHeaders.AUTHORIZATION, OAuth2Helper.Scheme.BEARER_CREDENTIALS_PREFIX + token.toTokenString()); req.addHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON); req.addHeader(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); @@ -491,7 +491,7 @@ private List> requestHttpReceivedMessage( try { objResponse = client.execute(req); } catch (Exception ioe) { - throw DcCoreException.SentMessage.SM_CONNECTION_ERROR.reason(ioe); + throw PersoniumCoreException.SentMessage.SM_CONNECTION_ERROR.reason(ioe); } // リクエスト結果の作成 @@ -648,16 +648,16 @@ public static void validateUriCsv(String propKey, String propValue) { for (String uri : uriList) { if (uri.length() != 0) { if (!ODataUtils.isValidUri(uri)) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propKey); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propKey); } } else { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propKey); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propKey); } } } else { // CSV形式で複数指定されていた場合 if (!ODataUtils.isValidUri(propValue)) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propValue); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propValue); } } } @@ -685,11 +685,11 @@ public static void validateToValue(String toValue, String baseUrl) { checkBaseUrl += "/"; } catch (URISyntaxException e) { log.info(e.getMessage()); - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(SentMessage.P_TO.getName()); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(SentMessage.P_TO.getName()); } if (checkBaseUrl == null || !checkBaseUrl.equals(baseUrl)) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(SentMessage.P_TO.getName()); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(SentMessage.P_TO.getName()); } } @@ -702,7 +702,7 @@ public static void validateToValue(String toValue, String baseUrl) { */ public static void validateBody(String value, int maxLength) { if (value.getBytes().length > maxLength) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(ReceivedMessage.P_BODY.getName()); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(ReceivedMessage.P_BODY.getName()); } } @@ -718,7 +718,7 @@ public static void validateStatus(String type, String status) { && !((ReceivedMessage.TYPE_REQ_RELATION_BUILD.equals(type) || ReceivedMessage.TYPE_REQ_RELATION_BREAK.equals(type)) && ReceivedMessage.STATUS_NONE.equals(status))) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(ReceivedMessage.P_STATUS.getName()); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(ReceivedMessage.P_STATUS.getName()); } } @@ -734,7 +734,7 @@ public static void validateReqRelation(String type, String requestRelation, Stri && (requestRelation == null || requestRelationTarget == null)) { String detail = ReceivedMessage.P_REQUEST_RELATION.getName() + "," + ReceivedMessage.P_REQUEST_RELATION_TARGET.getName(); - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(detail); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(detail); } } @@ -746,7 +746,7 @@ public static void validateReqRelation(String type, String requestRelation, Stri public static void validateToAndToRelation(String to, String toRelation) { if (to == null && toRelation == null) { String detail = SentMessage.P_TO.getName() + "," + SentMessage.P_TO_RELATION.getName(); - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(detail); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(detail); } } } diff --git a/src/main/java/com/fujitsu/dc/core/rs/cell/MessageResource.java b/src/main/java/io/personium/core/rs/cell/MessageResource.java similarity index 78% rename from src/main/java/com/fujitsu/dc/core/rs/cell/MessageResource.java rename to src/main/java/io/personium/core/rs/cell/MessageResource.java index 3f4ec3cde..ef9f22358 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/cell/MessageResource.java +++ b/src/main/java/io/personium/core/rs/cell/MessageResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.cell; +package io.personium.core.rs.cell; import java.io.Reader; @@ -29,15 +29,15 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.auth.CellPrivilege; -import com.fujitsu.dc.core.model.DavRsCmp; -import com.fujitsu.dc.core.model.ModelFactory; -import com.fujitsu.dc.core.model.ctl.ReceivedMessagePort; -import com.fujitsu.dc.core.model.ctl.SentMessagePort; -import com.fujitsu.dc.core.odata.DcODataProducer; -import com.fujitsu.dc.core.rs.odata.ODataCtlResource; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.auth.AccessContext; +import io.personium.core.auth.CellPrivilege; +import io.personium.core.model.DavRsCmp; +import io.personium.core.model.ModelFactory; +import io.personium.core.model.ctl.ReceivedMessagePort; +import io.personium.core.model.ctl.SentMessagePort; +import io.personium.core.odata.PersoniumODataProducer; +import io.personium.core.rs.odata.ODataCtlResource; /** * JAX-RS Resource handling DC Message Level Api. /__messageというパスにきたときの処理. @@ -75,14 +75,14 @@ public AccessContext getAccessContext() { @POST @Path("send") public Response messages( - @HeaderParam(DcCoreUtils.HttpHeaders.X_DC_VERSION) final String version, + @HeaderParam(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_VERSION) final String version, @Context final UriInfo uriInfo, final Reader reader) { // アクセス制御 this.davRsCmp.checkAccessContext(this.accessContext, CellPrivilege.MESSAGE); // データ登録 - DcODataProducer producer = ModelFactory.ODataCtl.cellCtl(this.accessContext.getCell()); + PersoniumODataProducer producer = ModelFactory.ODataCtl.cellCtl(this.accessContext.getCell()); MessageODataResource moResource = new MessageODataResource(this, producer, SentMessagePort.EDM_TYPE_NAME); moResource.setVersion(version); Response respose = moResource.createMessage(uriInfo, reader); @@ -104,7 +104,7 @@ public Response messagesPort( this.accessContext.checkCellIssueToken(this.davRsCmp.getAcceptableAuthScheme()); // 受信メッセージの登録 - DcODataProducer producer = ModelFactory.ODataCtl.cellCtl(this.accessContext.getCell()); + PersoniumODataProducer producer = ModelFactory.ODataCtl.cellCtl(this.accessContext.getCell()); MessageODataResource moResource = new MessageODataResource(this, producer, ReceivedMessagePort.EDM_TYPE_NAME); Response respose = moResource.createMessage(uriInfo, reader); return respose; @@ -124,7 +124,7 @@ public Response messagesApprove(@PathParam("key") final String key, this.davRsCmp.checkAccessContext(this.accessContext, CellPrivilege.MESSAGE); // 受信メッセージの承認 - DcODataProducer producer = ModelFactory.ODataCtl.cellCtl(this.accessContext.getCell()); + PersoniumODataProducer producer = ModelFactory.ODataCtl.cellCtl(this.accessContext.getCell()); MessageODataResource moResource = new MessageODataResource(this, producer, ReceivedMessagePort.EDM_TYPE_NAME); Response respose = moResource.changeMessageStatus(reader, key); return respose; diff --git a/src/main/java/com/fujitsu/dc/core/rs/cell/PasswordResource.java b/src/main/java/io/personium/core/rs/cell/PasswordResource.java similarity index 77% rename from src/main/java/com/fujitsu/dc/core/rs/cell/PasswordResource.java rename to src/main/java/io/personium/core/rs/cell/PasswordResource.java index 45aadf36b..eb3d35457 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/cell/PasswordResource.java +++ b/src/main/java/io/personium/core/rs/cell/PasswordResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.cell; +package io.personium.core.rs.cell; import javax.ws.rs.PUT; import javax.ws.rs.core.Response; @@ -26,20 +26,20 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.DavRsCmp; -import com.fujitsu.dc.core.model.ModelFactory; -import com.fujitsu.dc.core.model.ctl.Account; -import com.fujitsu.dc.core.odata.DcODataProducer; +import io.personium.core.PersoniumCoreException; +import io.personium.core.auth.AccessContext; +import io.personium.core.model.Cell; +import io.personium.core.model.DavRsCmp; +import io.personium.core.model.ModelFactory; +import io.personium.core.model.ctl.Account; +import io.personium.core.odata.PersoniumODataProducer; /** * リソースクラスでパスワード変更処理を司るJAX-RSリソース. */ public class PasswordResource { - String dcCredHeader; + String pCredHeader; AccessContext accessContext; Cell cell; @@ -53,15 +53,15 @@ public class PasswordResource { /** * constructor. * @param accessContext accessContext - * @param dcCredHeader dcCredHeader + * @param pCredHeader pCredHeader * @param cell cell * @param davRsCmp DavRsCmp */ public PasswordResource(final AccessContext accessContext, - final String dcCredHeader, + final String pCredHeader, Cell cell, DavRsCmp davRsCmp) { this.accessContext = accessContext; - this.dcCredHeader = dcCredHeader; + this.pCredHeader = pCredHeader; this.cell = cell; this.davRsCmp = davRsCmp; } @@ -83,15 +83,15 @@ public Response mypass() { try { this.oEntityKey = OEntityKey.parse(this.keyString); } catch (IllegalArgumentException e) { - throw DcCoreException.OData.ENTITY_KEY_PARSE_ERROR.reason(e); + throw PersoniumCoreException.OData.ENTITY_KEY_PARSE_ERROR.reason(e); } // Accountのスキーマ情報を取得する - DcODataProducer producer = ModelFactory.ODataCtl.cellCtl(accessContext.getCell()); + PersoniumODataProducer producer = ModelFactory.ODataCtl.cellCtl(accessContext.getCell()); EdmEntitySet esetAccount = producer.getMetadata().getEdmEntitySet(Account.EDM_TYPE_NAME); // パスワードの変更をProducerに依頼 - producer.updatePassword(esetAccount, this.oEntityKey, this.dcCredHeader); + producer.updatePassword(esetAccount, this.oEntityKey, this.pCredHeader); // レスポンス返却 return Response.noContent() diff --git a/src/main/java/com/fujitsu/dc/core/rs/cell/RoleResource.java b/src/main/java/io/personium/core/rs/cell/RoleResource.java similarity index 87% rename from src/main/java/com/fujitsu/dc/core/rs/cell/RoleResource.java rename to src/main/java/io/personium/core/rs/cell/RoleResource.java index b06afb8cf..480887630 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/cell/RoleResource.java +++ b/src/main/java/io/personium/core/rs/cell/RoleResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.cell; +package io.personium.core.rs.cell; import java.util.ArrayList; import java.util.List; @@ -31,12 +31,12 @@ import org.odata4j.producer.EntitiesResponse; import org.odata4j.producer.ODataProducer; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.auth.CellPrivilege; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.DavRsCmp; -import com.fujitsu.dc.core.model.ModelFactory; +import io.personium.core.PersoniumCoreException; +import io.personium.core.auth.CellPrivilege; +import io.personium.core.model.Box; +import io.personium.core.model.Cell; +import io.personium.core.model.DavRsCmp; +import io.personium.core.model.ModelFactory; /** * ロールエンドポイント用JAX-RS Resource. @@ -63,7 +63,7 @@ public RoleResource(final Cell cell, final DavRsCmp davRsCmp) { * @param authzHeader Authorization ヘッダ * @return JAX-RS Response Object */ - @Path("") +// @Path("") @GET public final Response list( @HeaderParam(HttpHeaders.AUTHORIZATION) final String authzHeader) { @@ -111,11 +111,11 @@ public final Response cellRole( // "_role", null); // TODO Bodyの生成 return Response.ok().entity(boxName).build(); - } catch (DcCoreException dce) { - if (DcCoreException.OData.NO_SUCH_ENTITY == dce) { - throw DcCoreException.Dav.BOX_NOT_FOUND; + } catch (PersoniumCoreException pce) { + if (PersoniumCoreException.OData.NO_SUCH_ENTITY == pce) { + throw PersoniumCoreException.Dav.BOX_NOT_FOUND; } - throw dce; + throw pce; } } /** diff --git a/src/main/java/com/fujitsu/dc/core/rs/cell/TokenEndPointResource.java b/src/main/java/io/personium/core/rs/cell/TokenEndPointResource.java similarity index 66% rename from src/main/java/com/fujitsu/dc/core/rs/cell/TokenEndPointResource.java rename to src/main/java/io/personium/core/rs/cell/TokenEndPointResource.java index 345ba1502..b71e12dfb 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/cell/TokenEndPointResource.java +++ b/src/main/java/io/personium/core/rs/cell/TokenEndPointResource.java @@ -14,9 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.cell; +package io.personium.core.rs.cell; -import static com.fujitsu.dc.common.auth.token.AbstractOAuth2Token.MILLISECS_IN_AN_HOUR; +import static io.personium.common.auth.token.AbstractOAuth2Token.MILLISECS_IN_AN_HOUR; import java.net.MalformedURLException; import java.net.URL; @@ -44,40 +44,40 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token.TokenDsigException; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token.TokenParseException; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token.TokenRootCrtException; -import com.fujitsu.dc.common.auth.token.AccountAccessToken; -import com.fujitsu.dc.common.auth.token.CellLocalAccessToken; -import com.fujitsu.dc.common.auth.token.CellLocalRefreshToken; -import com.fujitsu.dc.common.auth.token.IAccessToken; -import com.fujitsu.dc.common.auth.token.IExtRoleContainingToken; -import com.fujitsu.dc.common.auth.token.IRefreshToken; -import com.fujitsu.dc.common.auth.token.LocalToken; -import com.fujitsu.dc.common.auth.token.Role; -import com.fujitsu.dc.common.auth.token.TransCellAccessToken; -import com.fujitsu.dc.common.auth.token.TransCellRefreshToken; -import com.fujitsu.dc.common.auth.token.UnitLocalUnitUserToken; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreAuthnException; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreConfig.OIDC; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.DcCoreLog; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.auth.AuthUtils; -import com.fujitsu.dc.core.auth.IdToken; -import com.fujitsu.dc.core.auth.OAuth2Helper; -import com.fujitsu.dc.core.auth.OAuth2Helper.Key; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.DavRsCmp; -import com.fujitsu.dc.core.model.ModelFactory; -import com.fujitsu.dc.core.model.ctl.Account; -import com.fujitsu.dc.core.odata.DcODataProducer; -import com.fujitsu.dc.core.odata.OEntityWrapper; -import com.fujitsu.dc.core.utils.UriUtils; +import io.personium.common.auth.token.AbstractOAuth2Token; +import io.personium.common.auth.token.AbstractOAuth2Token.TokenDsigException; +import io.personium.common.auth.token.AbstractOAuth2Token.TokenParseException; +import io.personium.common.auth.token.AbstractOAuth2Token.TokenRootCrtException; +import io.personium.common.auth.token.AccountAccessToken; +import io.personium.common.auth.token.CellLocalAccessToken; +import io.personium.common.auth.token.CellLocalRefreshToken; +import io.personium.common.auth.token.IAccessToken; +import io.personium.common.auth.token.IExtRoleContainingToken; +import io.personium.common.auth.token.IRefreshToken; +import io.personium.common.auth.token.LocalToken; +import io.personium.common.auth.token.Role; +import io.personium.common.auth.token.TransCellAccessToken; +import io.personium.common.auth.token.TransCellRefreshToken; +import io.personium.common.auth.token.UnitLocalUnitUserToken; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumCoreAuthnException; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumUnitConfig.OIDC; +import io.personium.core.PersoniumCoreException; +import io.personium.core.PersoniumCoreLog; +import io.personium.core.auth.AccessContext; +import io.personium.core.auth.AuthUtils; +import io.personium.core.auth.IdToken; +import io.personium.core.auth.OAuth2Helper; +import io.personium.core.auth.OAuth2Helper.Key; +import io.personium.core.model.Box; +import io.personium.core.model.Cell; +import io.personium.core.model.DavRsCmp; +import io.personium.core.model.ModelFactory; +import io.personium.core.model.ctl.Account; +import io.personium.core.odata.PersoniumODataProducer; +import io.personium.core.odata.OEntityWrapper; +import io.personium.core.utils.UriUtils; /** * 認証処理を司るJAX-RSリソース. @@ -106,7 +106,7 @@ public TokenEndPointResource(final Cell cell, final DavRsCmp davRsCmp) { /** * 認証のエンドポイント.

トークンの発行しわけ

*
    - *
  • dc_targetにURLが書いてあれば、そのCELLをTARGETのCELLとしてtransCellTokenを発行する。
  • + *
  • p_targetにURLが書いてあれば、そのCELLをTARGETのCELLとしてtransCellTokenを発行する。
  • *
  • scopeがなければCellLocalを発行する。
  • *
* @param uriInfo URI情報 @@ -114,13 +114,13 @@ public TokenEndPointResource(final Cell cell, final DavRsCmp davRsCmp) { * @param grantType クエリパラメタ * @param username クエリパラメタ * @param password クエリパラメタ - * @param dcTarget クエリパラメタ - * @param dcOwner クエリパラメタ + * @param pTarget クエリパラメタ + * @param pOwner クエリパラメタ * @param assertion クエリパラメタ * @param refreshToken クエリパラメタ * @param clientId クエリパラメタ * @param clientSecret クエリパラメタ - * @param dcCookie クエリパラメタ + * @param pCookie クエリパラメタ * @param idToken IDトークン * @param host Hostヘッダ * @return JAX-RS Response Object @@ -131,25 +131,25 @@ public final Response auth(@Context final UriInfo uriInfo, @FormParam(Key.GRANT_TYPE) final String grantType, @FormParam(Key.USERNAME) final String username, @FormParam(Key.PASSWORD) final String password, - @FormParam(Key.TARGET) final String dcTarget, - @FormParam(Key.OWNER) final String dcOwner, + @FormParam(Key.TARGET) final String pTarget, + @FormParam(Key.OWNER) final String pOwner, @FormParam(Key.ASSERTION) final String assertion, @FormParam(Key.REFRESH_TOKEN) final String refreshToken, @FormParam(Key.CLIENT_ID) final String clientId, @FormParam(Key.CLIENT_SECRET) final String clientSecret, - @FormParam("dc_cookie") final String dcCookie, + @FormParam("p_cookie") final String pCookie, @FormParam(Key.ID_TOKEN) final String idToken, @HeaderParam(HttpHeaders.HOST) final String host) { // Accept unit local scheme url. - String target = UriUtils.convertSchemeFromLocalUnitToHttp(cell.getUnitUrl(), dcTarget); - // dc_target がURLでない場合はヘッダInjectionの脆弱性を産んでしまう。(改行コードが入っているなど) - target = this.checkDcTarget(target); + String target = UriUtils.convertSchemeFromLocalUnitToHttp(cell.getUnitUrl(), pTarget); + // p_target がURLでない場合はヘッダInjectionの脆弱性を産んでしまう。(改行コードが入っているなど) + target = this.checkPTarget(target); - if (null != dcTarget) { + if (null != pTarget) { issueCookie = false; } else { - issueCookie = Boolean.parseBoolean(dcCookie); + issueCookie = Boolean.parseBoolean(pCookie); requestURIInfo = uriInfo; } @@ -162,13 +162,13 @@ public final Response auth(@Context final UriInfo uriInfo, if (OAuth2Helper.GrantType.PASSWORD.equals(grantType)) { // 通常のパスワード認証 - Response response = this.handlePassword(target, dcOwner, host, schema, username, password); + Response response = this.handlePassword(target, pOwner, host, schema, username, password); // パスワード認証が成功した場合はアカウントの最終ログイン時刻を更新する // パスワード認証が成功した場合のみ、ここを通る(handlePassword内でエラーが発生すると、例外がthrowされる) - if (DcCoreConfig.getAccountLastAuthenticatedEnable()) { + if (PersoniumUnitConfig.getAccountLastAuthenticatedEnable()) { // Accountのスキーマ情報を取得する - DcODataProducer producer = ModelFactory.ODataCtl.cellCtl(cell); + PersoniumODataProducer producer = ModelFactory.ODataCtl.cellCtl(cell); EdmEntitySet esetAccount = producer.getMetadata().getEdmEntitySet(Account.EDM_TYPE_NAME); OEntityKey originalKey = OEntityKey.parse("('" + username + "')"); // 最終ログイン時刻の変更をProducerに依頼(このメソッド内でロックを取得・解放) @@ -176,18 +176,18 @@ public final Response auth(@Context final UriInfo uriInfo, } return response; } else if (OAuth2Helper.GrantType.SAML2_BEARER.equals(grantType)) { - return this.receiveSaml2(target, dcOwner, schema, assertion); + return this.receiveSaml2(target, pOwner, schema, assertion); } else if (OAuth2Helper.GrantType.REFRESH_TOKEN.equals(grantType)) { - return this.receiveRefresh(target, dcOwner, host, refreshToken); - } else if (OAuth2Helper.GrantType.DC1_OIDC_GOOGLE.equals(grantType)) { - return this.receiveIdTokenGoogle(target, dcOwner, schema, username, idToken, host); + return this.receiveRefresh(target, pOwner, host, refreshToken); + } else if (OAuth2Helper.GrantType.URN_OIDC_GOOGLE.equals(grantType)) { + return this.receiveIdTokenGoogle(target, pOwner, schema, username, idToken, host); } else { - throw DcCoreAuthnException.UNSUPPORTED_GRANT_TYPE.realm(this.cell.getUrl()); + throw PersoniumCoreAuthnException.UNSUPPORTED_GRANT_TYPE.realm(this.cell.getUrl()); } } - private String checkDcTarget(final String dcTarget) { - String target = dcTarget; + private String checkPTarget(final String pTarget) { + String target = pTarget; if (target != null) { try { new URL(target); @@ -195,12 +195,12 @@ private String checkDcTarget(final String dcTarget) { target = target + "/"; } if (target.contains("\n") || target.contains("\r")) { - // dc_targetがURLでない場合はエラー - throw DcCoreAuthnException.INVALID_TARGET.realm(this.cell.getUrl()); + // p_targetがURLでない場合はエラー + throw PersoniumCoreAuthnException.INVALID_TARGET.realm(this.cell.getUrl()); } } catch (MalformedURLException e) { - // dc_targetがURLでない場合はエラー - throw DcCoreAuthnException.INVALID_TARGET.realm(this.cell.getUrl()); + // p_targetがURLでない場合はエラー + throw PersoniumCoreAuthnException.INVALID_TARGET.realm(this.cell.getUrl()); } } return target; @@ -223,13 +223,13 @@ private String clientAuth(final String clientId, final String clientSecret, fina // authzHeaderのパース if (authzHeader != null) { - String[] idpw = DcCoreUtils.parseBasicAuthzHeader(authzHeader); + String[] idpw = PersoniumCoreUtils.parseBasicAuthzHeader(authzHeader); if (idpw != null) { // authzHeaderの指定を優先 id = idpw[0]; pw = idpw[1]; } else { - throw DcCoreAuthnException.AUTH_HEADER_IS_INVALID.realm(cell.getUrl()); + throw PersoniumCoreAuthnException.AUTH_HEADER_IS_INVALID.realm(cell.getUrl()); } } @@ -240,31 +240,31 @@ private String clientAuth(final String clientId, final String clientSecret, fina tcToken = TransCellAccessToken.parse(pw); } catch (TokenParseException e) { // パースの失敗 - DcCoreLog.Auth.TOKEN_PARSE_ERROR.params(e.getMessage()).writeLog(); - throw DcCoreAuthnException.CLIENT_SERCRET_PARSE_ERROR.realm(cell.getUrl()).reason(e); + PersoniumCoreLog.Auth.TOKEN_PARSE_ERROR.params(e.getMessage()).writeLog(); + throw PersoniumCoreAuthnException.CLIENT_SECRET_PARSE_ERROR.realm(cell.getUrl()).reason(e); } catch (TokenDsigException e) { // 署名検証エラー - DcCoreLog.Auth.TOKEN_DISG_ERROR.params(e.getMessage()).writeLog(); - throw DcCoreAuthnException.TOKEN_DSIG_INVALID.realm(this.cell.getUrl()); + PersoniumCoreLog.Auth.TOKEN_DISG_ERROR.params(e.getMessage()).writeLog(); + throw PersoniumCoreAuthnException.TOKEN_DSIG_INVALID.realm(this.cell.getUrl()); } catch (TokenRootCrtException e) { // ルートCA証明書の設定エラー - DcCoreLog.Auth.ROOT_CA_CRT_SETTING_ERROR.params(e.getMessage()).writeLog(); - throw DcCoreException.Auth.ROOT_CA_CRT_SETTING_ERROR; + PersoniumCoreLog.Auth.ROOT_CA_CRT_SETTING_ERROR.params(e.getMessage()).writeLog(); + throw PersoniumCoreException.Auth.ROOT_CA_CRT_SETTING_ERROR; } // ・有効期限チェック if (tcToken.isExpired()) { - throw DcCoreAuthnException.CLIENT_SERCRET_EXPIRED.realm(cell.getUrl()); + throw PersoniumCoreAuthnException.CLIENT_SECRET_EXPIRED.realm(cell.getUrl()); } // ・IssuerがIDと等しいことを確認 if (!id.equals(tcToken.getIssuer())) { - throw DcCoreAuthnException.CLIENT_SERCRET_ISSUER_MISMATCH.realm(cell.getUrl()); + throw PersoniumCoreAuthnException.CLIENT_SECRET_ISSUER_MISMATCH.realm(cell.getUrl()); } // トークンのターゲットが自分でない場合はエラー応答 if (!tcToken.getTarget().equals(cell.getUrl())) { - throw DcCoreAuthnException.CLIENT_SERCRET_TARGET_WRONG.realm(cell.getUrl()); + throw PersoniumCoreAuthnException.CLIENT_SECRET_TARGET_WRONG.realm(cell.getUrl()); } // ロールが特殊(confidential)な値だったら#cを付与 @@ -284,13 +284,13 @@ private Response receiveSaml2(final String target, final String owner, final String schema, final String assertion) { if (Key.TRUE_STR.equals(owner)) { // トークン認証でのユニットユーザ昇格はさせない - throw DcCoreAuthnException.TC_ACCESS_REPRESENTING_OWNER.realm(this.cell.getUrl()); + throw PersoniumCoreAuthnException.TC_ACCESS_REPRESENTING_OWNER.realm(this.cell.getUrl()); } // assertionのnullチェック if (assertion == null) { // assertionが未設定の場合、パースエラーとみなす - throw DcCoreAuthnException.TOKEN_PARSE_ERROR.realm(this.cell.getUrl()); + throw PersoniumCoreAuthnException.TOKEN_PARSE_ERROR.realm(this.cell.getUrl()); } // まずはパースする @@ -299,31 +299,31 @@ private Response receiveSaml2(final String target, tcToken = TransCellAccessToken.parse(assertion); } catch (TokenParseException e) { // パース失敗時 - DcCoreLog.Auth.TOKEN_PARSE_ERROR.params(e.getMessage()).writeLog(); - throw DcCoreAuthnException.TOKEN_PARSE_ERROR.realm(this.cell.getUrl()); + PersoniumCoreLog.Auth.TOKEN_PARSE_ERROR.params(e.getMessage()).writeLog(); + throw PersoniumCoreAuthnException.TOKEN_PARSE_ERROR.realm(this.cell.getUrl()); } catch (TokenDsigException e) { // 署名検証でエラー - DcCoreLog.Auth.TOKEN_DISG_ERROR.params(e.getMessage()).writeLog(); - throw DcCoreAuthnException.TOKEN_DSIG_INVALID.realm(this.cell.getUrl()); + PersoniumCoreLog.Auth.TOKEN_DISG_ERROR.params(e.getMessage()).writeLog(); + throw PersoniumCoreAuthnException.TOKEN_DSIG_INVALID.realm(this.cell.getUrl()); } catch (TokenRootCrtException e) { // ルートCA証明書の設定エラー - DcCoreLog.Auth.ROOT_CA_CRT_SETTING_ERROR.params(e.getMessage()).writeLog(); - throw DcCoreException.Auth.ROOT_CA_CRT_SETTING_ERROR; + PersoniumCoreLog.Auth.ROOT_CA_CRT_SETTING_ERROR.params(e.getMessage()).writeLog(); + throw PersoniumCoreException.Auth.ROOT_CA_CRT_SETTING_ERROR; } // Tokenの検証 // 1.有効期限チェック if (tcToken.isExpired()) { - throw DcCoreAuthnException.TOKEN_EXPIRED.realm(this.cell.getUrl()); + throw PersoniumCoreAuthnException.TOKEN_EXPIRED.realm(this.cell.getUrl()); } // トークンのターゲットが自分でない場合はエラー応答 try { if (!(AuthResourceUtils.checkTargetUrl(this.cell, tcToken))) { - throw DcCoreAuthnException.TOKEN_TARGET_WRONG.realm(this.cell.getUrl()).params(tcToken.getTarget()); + throw PersoniumCoreAuthnException.TOKEN_TARGET_WRONG.realm(this.cell.getUrl()).params(tcToken.getTarget()); } } catch (MalformedURLException e) { - throw DcCoreAuthnException.TOKEN_TARGET_WRONG.realm(this.cell.getUrl()).params(tcToken.getTarget()); + throw PersoniumCoreAuthnException.TOKEN_TARGET_WRONG.realm(this.cell.getUrl()).params(tcToken.getTarget()); } // 認証は成功 ------------------------------- @@ -367,18 +367,18 @@ private Response receiveRefresh(final String target, String owner, final String // refreshTokenのnullチェック if (refreshToken == null) { // refreshTokenが未設定の場合、パースエラーとみなす - throw DcCoreAuthnException.TOKEN_PARSE_ERROR.realm(this.cell.getUrl()); + throw PersoniumCoreAuthnException.TOKEN_PARSE_ERROR.realm(this.cell.getUrl()); } AbstractOAuth2Token token = AbstractOAuth2Token.parse(refreshToken, cell.getUrl(), host); if (!(token instanceof IRefreshToken)) { - throw DcCoreAuthnException.NOT_REFRESH_TOKEN.realm(this.cell.getUrl()); + throw PersoniumCoreAuthnException.NOT_REFRESH_TOKEN.realm(this.cell.getUrl()); } // リフレッシュトークンの有効期限チェック if (token.isRefreshExpired()) { - throw DcCoreAuthnException.TOKEN_EXPIRED.realm(this.cell.getUrl()); + throw PersoniumCoreAuthnException.TOKEN_EXPIRED.realm(this.cell.getUrl()); } long issuedAt = new Date().getTime(); @@ -386,15 +386,15 @@ private Response receiveRefresh(final String target, String owner, final String if (Key.TRUE_STR.equals(owner)) { // 自分セルリフレッシュの場合のみ昇格できる。 if (token.getClass() != CellLocalRefreshToken.class) { - throw DcCoreAuthnException.TC_ACCESS_REPRESENTING_OWNER.realm(this.cell.getUrl()); + throw PersoniumCoreAuthnException.TC_ACCESS_REPRESENTING_OWNER.realm(this.cell.getUrl()); } // ユニット昇格権限設定のチェック if (!this.davRsCmp.checkOwnerRepresentativeAccounts(token.getSubject())) { - throw DcCoreAuthnException.NOT_ALLOWED_REPRESENT_OWNER.realm(this.cell.getUrl()); + throw PersoniumCoreAuthnException.NOT_ALLOWED_REPRESENT_OWNER.realm(this.cell.getUrl()); } // セルのオーナーが未設定のセルに対しては昇格させない。 if (cell.getOwner() == null) { - throw DcCoreAuthnException.NO_CELL_OWNER.realm(this.cell.getUrl()); + throw PersoniumCoreAuthnException.NO_CELL_OWNER.realm(this.cell.getUrl()); } // uluut発行処理 @@ -428,16 +428,16 @@ private Response receiveRefresh(final String target, String owner, final String return this.responseAuthSuccess(aToken, rToken); } catch (TokenParseException e) { // パースに失敗したので - DcCoreLog.Auth.TOKEN_PARSE_ERROR.params(e.getMessage()).writeLog(); - throw DcCoreAuthnException.TOKEN_PARSE_ERROR.realm(this.cell.getUrl()).reason(e); + PersoniumCoreLog.Auth.TOKEN_PARSE_ERROR.params(e.getMessage()).writeLog(); + throw PersoniumCoreAuthnException.TOKEN_PARSE_ERROR.realm(this.cell.getUrl()).reason(e); } catch (TokenDsigException e) { // 証明書検証に失敗したので - DcCoreLog.Auth.TOKEN_DISG_ERROR.params(e.getMessage()).writeLog(); - throw DcCoreAuthnException.TOKEN_DSIG_INVALID.realm(this.cell.getUrl()); + PersoniumCoreLog.Auth.TOKEN_DISG_ERROR.params(e.getMessage()).writeLog(); + throw PersoniumCoreAuthnException.TOKEN_DSIG_INVALID.realm(this.cell.getUrl()); } catch (TokenRootCrtException e) { // ルートCA証明書の設定エラー - DcCoreLog.Auth.ROOT_CA_CRT_SETTING_ERROR.params(e.getMessage()).writeLog(); - throw DcCoreException.Auth.ROOT_CA_CRT_SETTING_ERROR; + PersoniumCoreLog.Auth.ROOT_CA_CRT_SETTING_ERROR.params(e.getMessage()).writeLog(); + throw PersoniumCoreException.Auth.ROOT_CA_CRT_SETTING_ERROR; } } @@ -459,10 +459,10 @@ private Response responseAuthSuccess(final IAccessToken accessToken, final IRefr if (issueCookie) { String tokenString = accessToken.toTokenString(); - // dc_cookie_peerとして、ランダムなUUIDを設定する - String dcCookiePeer = UUID.randomUUID().toString(); - String cookieValue = dcCookiePeer + "\t" + tokenString; - // ヘッダに返却するdc_cookie値は、暗号化する + // p_cookie_peerとして、ランダムなUUIDを設定する + String pCookiePeer = UUID.randomUUID().toString(); + String cookieValue = pCookiePeer + "\t" + tokenString; + // ヘッダに返却するp_cookie値は、暗号化する String encodedCookieValue = LocalToken.encode(cookieValue, UnitLocalUnitUserToken.getIvBytes(AccessContext.getCookieCryptKey(requestURIInfo.getBaseUri()))); // Cookieのバージョン(0)を指定 @@ -470,11 +470,11 @@ private Response responseAuthSuccess(final IAccessToken accessToken, final IRefr String path = getCookiePath(); // Cookieを作成し、レスポンスヘッダに返却する - Cookie cookie = new Cookie("dc_cookie", encodedCookieValue, path, requestURIInfo.getBaseUri().getHost(), + Cookie cookie = new Cookie("p_cookie", encodedCookieValue, path, requestURIInfo.getBaseUri().getHost(), version); - rb.cookie(new NewCookie(cookie, "", -1, DcCoreConfig.isHttps())); - // レスポンスボディの"dc_cookie_peer"を返却する - resp.put("dc_cookie_peer", dcCookiePeer); + rb.cookie(new NewCookie(cookie, "", -1, PersoniumUnitConfig.isHttps())); + // レスポンスボディの"p_cookie_peer"を返却する + resp.put("p_cookie_peer", pCookiePeer); } return rb.entity(resp.toJSONString()).build(); } @@ -489,7 +489,7 @@ private String getCookiePath() { URL url = new URL(cellUrl); return url.getPath(); } catch (MalformedURLException e) { - throw DcCoreAuthnException.AUTHN_FAILED.realm(this.cell.getUrl()); + throw PersoniumCoreAuthnException.AUTHN_FAILED.realm(this.cell.getUrl()); } } @@ -502,21 +502,21 @@ private Response handlePassword(final String target, // パスワードのCheck処理 if (username == null) { - throw DcCoreAuthnException.REQUIRED_PARAM_MISSING.realm(this.cell.getUrl()).params(Key.USERNAME); + throw PersoniumCoreAuthnException.REQUIRED_PARAM_MISSING.realm(this.cell.getUrl()).params(Key.USERNAME); } else if (password == null) { - throw DcCoreAuthnException.REQUIRED_PARAM_MISSING.realm(this.cell.getUrl()).params(Key.PASSWORD); + throw PersoniumCoreAuthnException.REQUIRED_PARAM_MISSING.realm(this.cell.getUrl()).params(Key.PASSWORD); } OEntityWrapper oew = cell.getAccount(username); if (oew == null) { - throw DcCoreAuthnException.AUTHN_FAILED.realm(this.cell.getUrl()); + throw PersoniumCoreAuthnException.AUTHN_FAILED.realm(this.cell.getUrl()); } // Typeの値確認 if (!AuthUtils.isAccountTypeBasic(oew)) { //アカウントの存在確認に悪用されないように、失敗の旨のみのエラー応答 - DcCoreLog.Auth.UNSUPPORTED_ACCOUNT_GRANT_TYPE.params(Account.TYPE_VALUE_BASIC, username).writeLog(); - throw DcCoreAuthnException.AUTHN_FAILED.realm(this.cell.getUrl()); + PersoniumCoreLog.Auth.UNSUPPORTED_ACCOUNT_GRANT_TYPE.params(Account.TYPE_VALUE_BASIC, username).writeLog(); + throw PersoniumCoreAuthnException.AUTHN_FAILED.realm(this.cell.getUrl()); } // 最終ログイン時刻を更新するために、UUIDをクラス変数にひかえておく @@ -527,7 +527,7 @@ private Response handlePassword(final String target, if (isLock) { // memcachedのロック時間を更新 AuthResourceUtils.registAccountLock(accountId); - throw DcCoreAuthnException.ACCOUNT_LOCK_ERROR.realm(this.cell.getUrl()); + throw PersoniumCoreAuthnException.ACCOUNT_LOCK_ERROR.realm(this.cell.getUrl()); } boolean authSuccess = cell.authenticateAccount(oew, password); @@ -535,7 +535,7 @@ private Response handlePassword(final String target, if (!authSuccess) { // memcachedにロックを作成 AuthResourceUtils.registAccountLock(accountId); - throw DcCoreAuthnException.AUTHN_FAILED.realm(this.cell.getUrl()); + throw PersoniumCoreAuthnException.AUTHN_FAILED.realm(this.cell.getUrl()); } return issueToken(target, owner, host, schema, username); @@ -548,11 +548,11 @@ private Response issueToken(final String target, final String owner, if (Key.TRUE_STR.equals(owner)) { // ユニット昇格権限設定のチェック if (!this.davRsCmp.checkOwnerRepresentativeAccounts(username)) { - throw DcCoreAuthnException.NOT_ALLOWED_REPRESENT_OWNER.realm(this.cell.getUrl()); + throw PersoniumCoreAuthnException.NOT_ALLOWED_REPRESENT_OWNER.realm(this.cell.getUrl()); } // セルのオーナーが未設定のセルに対しては昇格させない。 if (cell.getOwner() == null) { - throw DcCoreAuthnException.NO_CELL_OWNER.realm(this.cell.getUrl()); + throw PersoniumCoreAuthnException.NO_CELL_OWNER.realm(this.cell.getUrl()); } // uluut発行処理 @@ -590,13 +590,13 @@ private Response issueToken(final String target, final String owner, */ @OPTIONS public Response options() { - return DcCoreUtils.responseBuilderForOptions(HttpMethod.POST).build(); + return PersoniumCoreUtils.responseBuilderForOptions(HttpMethod.POST).build(); } /** * Google認証連携処理. * @param target - * @param dcOwner + * @param pOwner * @param schema * @param username * @param idToken @@ -604,17 +604,17 @@ public Response options() { * @return */ - private Response receiveIdTokenGoogle(String target, String dcOwner, + private Response receiveIdTokenGoogle(String target, String pOwner, String schema, String username, String idToken, String host) { // usernameのCheck処理 // 暫定的にインターフェースとして(username)を無視する仕様とした /*if (username == null) { - throw DcCoreAuthnException.REQUIRED_PARAM_MISSING.realm(this.cell.getUrl()).params(Key.USERNAME); + throw PersoniumCoreAuthnException.REQUIRED_PARAM_MISSING.realm(this.cell.getUrl()).params(Key.USERNAME); }*/ // id_tokenのCheck処理 if (idToken == null) { - throw DcCoreAuthnException.REQUIRED_PARAM_MISSING.realm(this.cell.getUrl()).params(Key.ID_TOKEN); + throw PersoniumCoreAuthnException.REQUIRED_PARAM_MISSING.realm(this.cell.getUrl()).params(Key.ID_TOKEN); } // id_tokenをパースする @@ -622,10 +622,10 @@ private Response receiveIdTokenGoogle(String target, String dcOwner, // Tokenに有効期限(exp)があるかnullチェック if (idt.getExp() == null) { - throw DcCoreAuthnException.OIDC_INVALID_ID_TOKEN.params("ID Token expiration time null."); + throw PersoniumCoreAuthnException.OIDC_INVALID_ID_TOKEN.params("ID Token expiration time null."); } - // Tokenの検証。検証失敗したらDcCoreAuthnExceptionが投げられる + // Tokenの検証。検証失敗したらPersoniumCoreAuthnExceptionが投げられる idt.verify(); // Token検証成功時 @@ -635,14 +635,14 @@ private Response receiveIdTokenGoogle(String target, String dcOwner, // issuerがGoogleが認めたものであるかどうか if (!issuer.equals("accounts.google.com") && !issuer.equals("https://accounts.google.com")) { - DcCoreLog.OIDC.INVALID_ISSUER.params(issuer).writeLog(); - throw DcCoreAuthnException.OIDC_AUTHN_FAILED; + PersoniumCoreLog.OIDC.INVALID_ISSUER.params(issuer).writeLog(); + throw PersoniumCoreAuthnException.OIDC_AUTHN_FAILED; } // Googleに登録したサービス/アプリのClientIDかを確認 - // DcConfigPropatiesに登録したClientIdに一致していればOK + // UnitConfigPropatiesに登録したClientIdに一致していればOK if (!OIDC.isGoogleClientIdTrusted(aud)) { - throw DcCoreAuthnException.OIDC_WRONG_AUDIENCE.params(aud); + throw PersoniumCoreAuthnException.OIDC_WRONG_AUDIENCE.params(aud); } // このユーザー名がアカウント登録されているかを確認 @@ -650,20 +650,20 @@ private Response receiveIdTokenGoogle(String target, String dcOwner, OEntityWrapper idTokenUserOew = this.cell.getAccount(mail); if (idTokenUserOew == null) { //アカウントの存在確認に悪用されないように、失敗の旨のみのエラー応答 - DcCoreLog.OIDC.NO_SUCH_ACCOUNT.params(mail).writeLog(); - throw DcCoreAuthnException.OIDC_AUTHN_FAILED; + PersoniumCoreLog.OIDC.NO_SUCH_ACCOUNT.params(mail).writeLog(); + throw PersoniumCoreAuthnException.OIDC_AUTHN_FAILED; } // アカウントタイプがoidc:googleになっているかを確認。 // Account があるけどTypeにOidCが含まれていない if (!AuthUtils.isAccountTypeOidcGoogle(idTokenUserOew)) { //アカウントの存在確認に悪用されないように、失敗の旨のみのエラー応答 - DcCoreLog.OIDC.UNSUPPORTED_ACCOUNT_GRANT_TYPE.params(Account.TYPE_VALUE_OIDC_GOOGLE, mail).writeLog(); - throw DcCoreAuthnException.OIDC_AUTHN_FAILED; + PersoniumCoreLog.OIDC.UNSUPPORTED_ACCOUNT_GRANT_TYPE.params(Account.TYPE_VALUE_OIDC_GOOGLE, mail).writeLog(); + throw PersoniumCoreAuthnException.OIDC_AUTHN_FAILED; } // トークンを発行 - return this.issueToken(target, dcOwner, host, schema, mail); + return this.issueToken(target, pOwner, host, schema, mail); } } diff --git a/src/main/java/com/fujitsu/dc/core/rs/cell/package-info.java b/src/main/java/io/personium/core/rs/cell/package-info.java similarity index 91% rename from src/main/java/com/fujitsu/dc/core/rs/cell/package-info.java rename to src/main/java/io/personium/core/rs/cell/package-info.java index 271517ff5..ee1c604f3 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/cell/package-info.java +++ b/src/main/java/io/personium/core/rs/cell/package-info.java @@ -17,5 +17,5 @@ /** * Cell-level JAX-RS Resource classes. */ -package com.fujitsu.dc.core.rs.cell; +package io.personium.core.rs.cell; diff --git a/src/main/java/com/fujitsu/dc/core/rs/odata/AbstractODataResource.java b/src/main/java/io/personium/core/rs/odata/AbstractODataResource.java similarity index 87% rename from src/main/java/com/fujitsu/dc/core/rs/odata/AbstractODataResource.java rename to src/main/java/io/personium/core/rs/odata/AbstractODataResource.java index 04b3fbfe1..c2e060c8e 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/odata/AbstractODataResource.java +++ b/src/main/java/io/personium/core/rs/odata/AbstractODataResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.odata; +package io.personium.core.rs.odata; import java.io.Reader; import java.io.StringWriter; @@ -68,19 +68,19 @@ import org.odata4j.format.Settings; import org.odata4j.producer.EntityResponse; -import com.fujitsu.dc.common.es.util.DcUUID; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.core.model.impl.es.odata.PropertyLimitChecker; -import com.fujitsu.dc.core.model.impl.es.odata.PropertyLimitChecker.CheckError; -import com.fujitsu.dc.core.odata.DcFormatParserFactory; -import com.fujitsu.dc.core.odata.DcFormatWriterFactory; -import com.fujitsu.dc.core.odata.DcODataProducer; -import com.fujitsu.dc.core.odata.OEntityWrapper; -import com.fujitsu.dc.core.utils.EscapeControlCode; -import com.fujitsu.dc.core.utils.ODataUtils; +import io.personium.common.es.util.PersoniumUUID; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.Common; +import io.personium.core.model.ctl.Property; +import io.personium.core.model.impl.es.odata.PropertyLimitChecker; +import io.personium.core.model.impl.es.odata.PropertyLimitChecker.CheckError; +import io.personium.core.odata.PersoniumFormatParserFactory; +import io.personium.core.odata.PersoniumFormatWriterFactory; +import io.personium.core.odata.PersoniumODataProducer; +import io.personium.core.odata.OEntityWrapper; +import io.personium.core.utils.EscapeControlCode; +import io.personium.core.utils.ODataUtils; /** * ODataのリソースを扱う抽象クラス. @@ -100,14 +100,14 @@ public abstract class AbstractODataResource { /** * ODataProducer. */ - private DcODataProducer odataProducer; + private PersoniumODataProducer odataProducer; /** $formatのJSON. */ public static final String FORMAT_JSON = "json"; /** $formatのatom. */ public static final String FORMAT_ATOM = "atom"; - /** データ格納時の時刻(リクエストボディに"SYSUTCDATETIME()"が指定された場合はDcJsonFromatParserクラスで設定). */ + /** データ格納時の時刻(リクエストボディに"SYSUTCDATETIME()"が指定された場合はPersoniumJsonFromatParserクラスで設定). */ private long currentTimeMillis = System.currentTimeMillis(); /** @@ -122,7 +122,7 @@ public void setEntitySetName(String entitySetName) { * odataProducerのゲッター. * @return odataProducer */ - public DcODataProducer getOdataProducer() { + public PersoniumODataProducer getOdataProducer() { return this.odataProducer; } @@ -130,7 +130,7 @@ public DcODataProducer getOdataProducer() { * odataProducerのセッター. * @param odataProducer odataProducer */ - public void setOdataProducer(DcODataProducer odataProducer) { + public void setOdataProducer(PersoniumODataProducer odataProducer) { this.odataProducer = odataProducer; } @@ -176,7 +176,7 @@ private MediaType decideOutputFormatFromQueryValue(String format) { } else if (format.equals(FORMAT_JSON)) { mediaType = MediaType.APPLICATION_JSON_TYPE; } else { - throw DcCoreException.OData.FORMAT_INVALID_ERROR.params(format); + throw PersoniumCoreException.OData.FORMAT_INVALID_ERROR.params(format); } return mediaType; @@ -199,7 +199,7 @@ private MediaType decideOutputFormatFromHeaderValues(String acceptHeaderValue) { mediaType = MediaType.APPLICATION_JSON_TYPE; } } else { - throw DcCoreException.OData.UNSUPPORTED_MEDIA_TYPE.params(acceptHeaderValue); + throw PersoniumCoreException.OData.UNSUPPORTED_MEDIA_TYPE.params(acceptHeaderValue); } } return mediaType; @@ -262,7 +262,7 @@ public OEntityWrapper getOEntityWrapper(final Reader reader, } // ラッパにくるむ. POSTでIf-Match等 ETagを受け取ることはないのでetagはnull。 - String uuid = DcUUID.randomUUID(); + String uuid = PersoniumUUID.randomUUID(); OEntityWrapper oew = new OEntityWrapper(uuid, newEnt, null); // 必要ならばメタ情報をつける処理 odataResource.beforeCreate(oew); @@ -342,7 +342,7 @@ protected OEntity createRequestEntity(final Reader reader, // リクエストボディに__published、__updatedが指定されていた場合400エラーを返却する if (op != null && (propName.equals(Common.P_PUBLISHED.getName()) || propName.equals(Common.P_UPDATED.getName()))) { - throw DcCoreException.OData.FIELED_INVALID_ERROR + throw PersoniumCoreException.OData.FIELED_INVALID_ERROR .params(propName + " is management information name. Cannot request."); } @@ -353,7 +353,7 @@ protected OEntity createRequestEntity(final Reader reader, // Complex型の場合 op = getComplexProperty(ep, propName, op, metadata); } - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { throw e; } catch (Exception e) { op = setDefaultValue(ep, propName, op, metadata); @@ -375,7 +375,7 @@ protected OEntity createRequestEntity(final Reader reader, String req = property.getName(); if (req.equals("__metadata")) { // リクエストボディに__metadataが指定されていた場合400エラーを返却する - throw DcCoreException.OData.FIELED_INVALID_ERROR.params(req + throw PersoniumCoreException.OData.FIELED_INVALID_ERROR.params(req + " is management information name. Cannot request."); } // EntityTypeに存在しないdynamicPropertyが出現した場合は、スキーマを追加登録するため、プロパティ数へカウントする。 @@ -404,7 +404,7 @@ protected OEntity createRequestEntity(final Reader reader, PropertyLimitChecker checker = new PropertyLimitChecker(metadata, entitySetNameParam, dynamicPropCount); List errors = checker.checkPropertyLimits(entitySetNameParam); if (errors.size() > 0) { - throw DcCoreException.OData.ENTITYTYPE_STRUCTUAL_LIMITATION_EXCEEDED; + throw PersoniumCoreException.OData.ENTITYTYPE_STRUCTUAL_LIMITATION_EXCEEDED; } } @@ -422,7 +422,7 @@ protected OEntity createRequestEntity(final Reader reader, Object value = keyProp.getValue(); if (value == null) { // 単一主キーがnullの場合、400エラー - throw DcCoreException.OData.NULL_SINGLE_KEY; + throw PersoniumCoreException.OData.NULL_SINGLE_KEY; } key = OEntityKey.create(keyProp.getValue()); } else { @@ -460,7 +460,7 @@ protected OEntity createRequestEntity(final Reader reader, protected boolean isRegisteredDynamicProperty(EdmEntityType edmEntityType, String propertyName) { boolean isRegisteredDynamicProperty = false; EdmProperty prop = edmEntityType.findDeclaredProperty(propertyName); - NamespacedAnnotation isDeclared = prop.findAnnotation(Common.DC_NAMESPACE.getUri(), + NamespacedAnnotation isDeclared = prop.findAnnotation(Common.P_NAMESPACE.getUri(), Property.P_IS_DECLARED.getName()); // Property/ComplexTypeProperty以外では、IsDeclaredは定義されていないため、除外する。 if (isDeclared != null && isDeclared.getValue().equals("false")) { @@ -481,7 +481,7 @@ protected void validatePrimaryKey(OEntityKey oEntityKey, EdmEntityType edmEntity // 単一主キーの場合 if (!(oEntityKey.asSingleValue().getClass().equals( EdmSimpleType.getSimple(keyEdmType.getFullyQualifiedTypeName()).getCanonicalJavaType()))) { - throw DcCoreException.OData.ENTITY_KEY_PARSE_ERROR; + throw PersoniumCoreException.OData.ENTITY_KEY_PARSE_ERROR; } } else { // 複合主キーの場合 @@ -490,7 +490,7 @@ protected void validatePrimaryKey(OEntityKey oEntityKey, EdmEntityType edmEntity if (nv.getName().equals(key) && !(nv.getValue().getClass().equals( EdmSimpleType.getSimple(keyEdmType.getFullyQualifiedTypeName()) .getCanonicalJavaType()))) { - throw DcCoreException.OData.ENTITY_KEY_PARSE_ERROR; + throw PersoniumCoreException.OData.ENTITY_KEY_PARSE_ERROR; } } } @@ -558,7 +558,7 @@ protected OProperty getComplexProperty(EdmProperty ep, String propName, OProp // ComplexTypeの配列要素をOCollectionプロパティとして設定する newProp = OProperties.collection(ep.getName(), collectionType, builder.build()); } else { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propName); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propName); } } else { // ComplexTypeが配列でない場合は、ComplexTypeプロパティとして設定する @@ -649,7 +649,7 @@ protected OProperty setDefaultValue(EdmProperty ep, String propName, OPropert // スキーマ上定義されているのに入力の存在しない Property // デフォルト値が定義されていればそれをいれる。 // ComplexTypeそのものの項目、または配列の項目であればデフォルト値は設定しない - NamespacedAnnotation annotation = ep.findAnnotation(Common.DC_NAMESPACE.getUri(), + NamespacedAnnotation annotation = ep.findAnnotation(Common.P_NAMESPACE.getUri(), Property.P_IS_DECLARED.getName()); if (annotation != null && !(Boolean.valueOf(annotation.getValue().toString()))) { return null; @@ -663,7 +663,7 @@ protected OProperty setDefaultValue(EdmProperty ep, String propName, OPropert op = OProperties.null_(propName, ep.getType().getFullyQualifiedTypeName()); } else { // nullableがfalseであれば。エラーとする - throw DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params(propName); + throw PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params(propName); } return op; } @@ -676,26 +676,26 @@ protected OProperty setDefaultValue(EdmProperty ep, String propName, OPropert */ protected void validateProperty(EdmProperty ep, String propName, OProperty op) { for (NamespacedAnnotation annotation : ep.getAnnotations()) { - if (annotation.getName().equals(Common.DC_FORMAT)) { - String dcFormat = annotation.getValue().toString(); + if (annotation.getName().equals(Common.P_FORMAT)) { + String pFormat = annotation.getValue().toString(); // 正規表現チェックの場合 - if (dcFormat.startsWith(Common.DC_FORMAT_PATTERN_REGEX)) { - validatePropertyRegEx(propName, op, dcFormat); - } else if (dcFormat.equals(Common.DC_FORMAT_PATTERN_URI)) { + if (pFormat.startsWith(Common.P_FORMAT_PATTERN_REGEX)) { + validatePropertyRegEx(propName, op, pFormat); + } else if (pFormat.equals(Common.P_FORMAT_PATTERN_URI)) { validatePropertyUri(propName, op); - } else if (dcFormat.startsWith(Common.DC_FORMAT_PATTERN_SCHEMA_URI)) { + } else if (pFormat.startsWith(Common.P_FORMAT_PATTERN_SCHEMA_URI)) { validatePropertySchemaUri(propName, op); - } else if (dcFormat.startsWith(Common.DC_FORMAT_PATTERN_CELL_URL)) { + } else if (pFormat.startsWith(Common.P_FORMAT_PATTERN_CELL_URL)) { validatePropertyCellUrl(propName, op); - } else if (dcFormat.startsWith(Common.DC_FORMAT_PATTERN_USUSST)) { - validatePropertyUsusst(propName, op, dcFormat); + } else if (pFormat.startsWith(Common.P_FORMAT_PATTERN_USUSST)) { + validatePropertyUsusst(propName, op, pFormat); } } } } /** - * dc:Format以外のチェック処理. + * p:Format以外のチェック処理. * @param props プロパティ一覧 * @param */ @@ -720,7 +720,7 @@ private void validateDynamicProperty(OProperty property) { Pattern pattern = Pattern.compile(Common.PATTERN_USERDATA_KEY); Matcher matcher = pattern.matcher(key); if (!matcher.matches()) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(key); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(key); } // 動的プロパティなのでnullは許容する @@ -733,7 +733,7 @@ private void validateDynamicProperty(OProperty property) { if (EdmSimpleType.STRING.equals(type)) { String value = property.getValue().toString(); if (!ODataUtils.validateString(value)) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(key); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(key); } } @@ -741,7 +741,7 @@ private void validateDynamicProperty(OProperty property) { if (EdmSimpleType.DOUBLE.equals(type)) { double value = (Double) property.getValue(); if (!ODataUtils.validateDouble(value)) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(key); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(key); } } } @@ -750,20 +750,20 @@ private void validateDynamicProperty(OProperty property) { * プロパティ項目の値を正規表現でチェックする. * @param propName プロパティ名 * @param op OProperty - * @param dcFormat dcFormatの値 + * @param pFormat pFormatの値 */ - protected void validatePropertyRegEx(String propName, OProperty op, String dcFormat) { + protected void validatePropertyRegEx(String propName, OProperty op, String pFormat) { // regEx('正規表現')から正規表現を抜き出す - Pattern formatPattern = Pattern.compile(Common.DC_FORMAT_PATTERN_REGEX + "\\('(.+)'\\)"); - Matcher formatMatcher = formatPattern.matcher(dcFormat); + Pattern formatPattern = Pattern.compile(Common.P_FORMAT_PATTERN_REGEX + "\\('(.+)'\\)"); + Matcher formatMatcher = formatPattern.matcher(pFormat); formatMatcher.matches(); - dcFormat = formatMatcher.group(1); + pFormat = formatMatcher.group(1); // フォーマットのチェックを行う - Pattern pattern = Pattern.compile(dcFormat); + Pattern pattern = Pattern.compile(pFormat); Matcher matcher = pattern.matcher(op.getValue().toString()); if (!matcher.matches()) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propName); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propName); } } @@ -774,7 +774,7 @@ protected void validatePropertyRegEx(String propName, OProperty op, String dc */ protected void validatePropertyUri(String propName, OProperty op) { if (!ODataUtils.isValidUri(op.getValue().toString())) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propName); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propName); } } @@ -785,7 +785,7 @@ protected void validatePropertyUri(String propName, OProperty op) { */ protected void validatePropertySchemaUri(String propName, OProperty op) { if (!ODataUtils.isValidSchemaUri(op.getValue().toString())) { - throw DcCoreException.OData.SCHEMA_URI_FORMAT_ERROR.params(propName); + throw PersoniumCoreException.OData.SCHEMA_URI_FORMAT_ERROR.params(propName); } } @@ -796,7 +796,7 @@ protected void validatePropertySchemaUri(String propName, OProperty op) { */ protected void validatePropertyCellUrl(String propName, OProperty op) { if (!ODataUtils.isValidCellUrl(op.getValue().toString())) { - throw DcCoreException.OData.CELL_URL_FORMAT_ERROR.params(propName); + throw PersoniumCoreException.OData.CELL_URL_FORMAT_ERROR.params(propName); } } @@ -804,16 +804,16 @@ protected void validatePropertyCellUrl(String propName, OProperty op) { * プロパティ項目の値を、1つ以上のスペース区切り文字列にマッチするかチェックする. * @param propName プロパティ名 * @param op OProperty - * @param dcFormat dcFormatの値 + * @param pFormat pFormatの値 */ - protected void validatePropertyUsusst(String propName, OProperty op, String dcFormat) { - // dcFormatから候補をリストとして抽出. - Pattern formatPattern = Pattern.compile(Common.DC_FORMAT_PATTERN_USUSST + "\\((.+)\\)"); - Matcher formatMatcher = formatPattern.matcher(dcFormat); + protected void validatePropertyUsusst(String propName, OProperty op, String pFormat) { + // pFormatから候補をリストとして抽出. + Pattern formatPattern = Pattern.compile(Common.P_FORMAT_PATTERN_USUSST + "\\((.+)\\)"); + Matcher formatMatcher = formatPattern.matcher(pFormat); formatMatcher.matches(); - dcFormat = formatMatcher.group(1); + pFormat = formatMatcher.group(1); - String[] allowedTokens = dcFormat.split(", "); + String[] allowedTokens = pFormat.split(", "); for (int i = 0; i < allowedTokens.length; i++) { //remove single quotations. allowedTokens[i] = allowedTokens[i].replaceAll("\'(.+)\'", "$1"); @@ -823,7 +823,7 @@ protected void validatePropertyUsusst(String propName, OProperty op, String d // 検証される文字列を配列にする String value = op.getValue().toString(); if (value.indexOf(" ") > -1) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propName); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propName); } String[] tokens = value.split(" "); Set overlapChk = new HashSet<>(); @@ -832,11 +832,11 @@ protected void validatePropertyUsusst(String propName, OProperty op, String d // 1回でもマッチしないものがあったら、例外を投げる for (String token : tokens) { if (!allowedTokenList.contains(token)) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propName); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propName); } //重複チェック if (overlapChk.contains(token)) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propName); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(propName); } else { overlapChk.add(token); } @@ -975,12 +975,12 @@ protected String renderEntityResponse( final List acceptableMediaTypes) { StringWriter w = new StringWriter(); try { - FormatWriter fw = DcFormatWriterFactory.getFormatWriter(EntityResponse.class, + FormatWriter fw = PersoniumFormatWriterFactory.getFormatWriter(EntityResponse.class, acceptableMediaTypes, format, null); - // UriInfo uriInfo2 = DcCoreUtils.createUriInfo(uriInfo, 1); + // UriInfo uriInfo2 = PersoniumCoreUtils.createUriInfo(uriInfo, 1); fw.write(uriInfo, w, resp); } catch (UnsupportedOperationException e) { - throw DcCoreException.OData.FORMAT_INVALID_ERROR.params(format); + throw PersoniumCoreException.OData.FORMAT_INVALID_ERROR.params(format); } String responseStr = w.toString(); @@ -1006,7 +1006,7 @@ private OProperty generateDefautlProperty(EdmProperty ep) { if (EdmSimpleType.STRING.equals(edmType)) { // Typeが文字列でDefault値がCELLID()のとき。 if (defaultValue.equals("CELLID()")) { - String newCellid = DcCoreConfig.getCouchDbCellCreationTarget() + "_" + String newCellid = PersoniumUnitConfig.getCouchDbCellCreationTarget() + "_" + UUID.randomUUID().toString().replaceAll("-", ""); op = OProperties.string(propName, newCellid); // etag = newCellid; @@ -1060,15 +1060,15 @@ private static OEntity convertFromString(final Reader body, final EdmDataServices metadata, final String entitySetName, final OEntityKey entityKey) { - FormatParser parser = DcFormatParserFactory.getParser(Entry.class, type, new Settings(version, metadata, + FormatParser parser = PersoniumFormatParserFactory.getParser(Entry.class, type, new Settings(version, metadata, entitySetName, entityKey, null, false)); Entry entry = null; try { entry = parser.parse(body); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { throw e; } catch (Exception e) { - throw DcCoreException.OData.JSON_PARSE_ERROR.reason(e); + throw PersoniumCoreException.OData.JSON_PARSE_ERROR.reason(e); } return entry.getEntity(); } @@ -1150,7 +1150,7 @@ private long getTimeMillis(String timeStr) { timeMillis = Long.parseLong(date); } } catch (NumberFormatException e) { - throw DcCoreException.OData.JSON_PARSE_ERROR.reason(e); + throw PersoniumCoreException.OData.JSON_PARSE_ERROR.reason(e); } } return timeMillis; diff --git a/src/main/java/com/fujitsu/dc/core/rs/odata/BatchBodyParser.java b/src/main/java/io/personium/core/rs/odata/BatchBodyParser.java similarity index 89% rename from src/main/java/com/fujitsu/dc/core/rs/odata/BatchBodyParser.java rename to src/main/java/io/personium/core/rs/odata/BatchBodyParser.java index 87091dce5..38bff5d01 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/odata/BatchBodyParser.java +++ b/src/main/java/io/personium/core/rs/odata/BatchBodyParser.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.odata; +package io.personium.core.rs.odata; import java.io.BufferedReader; import java.io.IOException; @@ -30,8 +30,8 @@ import javax.ws.rs.HttpMethod; import javax.ws.rs.core.HttpHeaders; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; import com.sun.jersey.api.uri.UriComponent; /** @@ -63,16 +63,16 @@ public List parse(String boundary, Reader reader, String requestU body = getBatchBody(br); } catch (IOException e) { // IOExceptionは重大障害 - throw DcCoreException.Server.UNKNOWN_ERROR.reason(e); + throw PersoniumCoreException.Server.UNKNOWN_ERROR.reason(e); } if (!body.toString().startsWith("--" + boundary + "\n")) { // リクエストボディの先頭が「--バウンダリー文字列」で始まっていなければエラーとする - throw DcCoreException.OData.BATCH_BODY_PARSE_ERROR; + throw PersoniumCoreException.OData.BATCH_BODY_PARSE_ERROR; } if (!body.toString().trim().endsWith("--" + boundary + "--")) { // リクエストボディの最後が「--バウンダリー文字列--」で終わっていなければエラーとする - throw DcCoreException.OData.BATCH_BODY_PARSE_ERROR; + throw PersoniumCoreException.OData.BATCH_BODY_PARSE_ERROR; } // 個々のリクエストを取得する @@ -156,7 +156,7 @@ List parse(String boundaryBody) { String type = getContentType(bodyLines); if (type == null) { // Content-Typeの指定がない - throw DcCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.params(HttpHeaders.CONTENT_TYPE); + throw PersoniumCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.params(HttpHeaders.CONTENT_TYPE); } // ボディを取得 @@ -170,7 +170,7 @@ List parse(String boundaryBody) { // changesetのネスト指定 if (this.parent != null) { - throw DcCoreException.OData.BATCH_BODY_FORMAT_CHANGESET_NEST_ERROR; + throw PersoniumCoreException.OData.BATCH_BODY_FORMAT_CHANGESET_NEST_ERROR; } // changesetのバウンダリ文字列を取得 @@ -194,7 +194,7 @@ List parse(String boundaryBody) { requests.addAll(changesetRequests); } else { // Content-Typeが不正 - throw DcCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.params(HttpHeaders.CONTENT_TYPE); + throw PersoniumCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.params(HttpHeaders.CONTENT_TYPE); } return requests; @@ -237,7 +237,7 @@ private BatchBodyPart getRequest(String bodyPart) { // $links、NP経由系のリクエストはクエリが未サポートのため指定があった場合はエラーとする // TODO 取得のリクエストの制限が解除された場合はクエリを許可すること if (!requestQuery.equals("")) { - throw DcCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.params(requestLine); + throw PersoniumCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.params(requestLine); } Pattern linkPathPattern = Pattern .compile("^([^\\(]*)\\('([^']*)'\\)\\/\\$links\\/([^\\(]*)(\\('([^')]*)'\\))?$"); @@ -260,7 +260,7 @@ private BatchBodyPart getRequest(String bodyPart) { batchBodyPart.setTargetEntitySetName(npMatcher.replaceAll("$3")); batchBodyPart.setUri(collectionUri + "/" + targetNvProName); } else { - throw DcCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.params(requestLine); + throw PersoniumCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.params(requestLine); } } else { Pattern reqPattern = Pattern.compile("^([^\\(]*)(\\('([^']*)'\\))?$"); @@ -271,16 +271,16 @@ private BatchBodyPart getRequest(String bodyPart) { if (HttpMethod.POST.equals(method)) { // POSTの場合_ターゲットのIDが指定されていればエラーとする if (null != targetID && !"".equals(targetID)) { - throw DcCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.params(requestLine); + throw PersoniumCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.params(requestLine); } } else if (!HttpMethod.GET.equals(method) && (null == targetID || "".equals(targetID))) { // POST,GET以外の場合_ターゲットのIDが指定されていなければエラーとする - throw DcCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.params(requestLine); + throw PersoniumCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.params(requestLine); } // GETの場合_一件取得・一覧取得の両方があるため、ターゲットのIDの有無はチェックしない } else { - throw DcCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.params(requestLine); + throw PersoniumCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.params(requestLine); } batchBodyPart.setUri(collectionUri + "/" + requestPath); } @@ -295,7 +295,7 @@ private BatchBodyPart getRequest(String bodyPart) { // 各クエリの値のエラーはリクエスト送信時にチェックするため、ここでは例外は無視している try { top = QueryParser.parseTopQuery(UriComponent.decodeQuery(requestQuery, true).getFirst("$top")); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { top = null; } if (top != null) { @@ -361,7 +361,7 @@ private String getMethod(String line) { // 受付可能なメソッドかどうかチェックする if (!HttpMethod.POST.equals(method) && !HttpMethod.GET.equals(method) && !HttpMethod.PUT.equals(method) && !HttpMethod.DELETE.equals(method)) { - throw DcCoreException.OData.BATCH_BODY_FORMAT_METHOD_ERROR.params(method); + throw PersoniumCoreException.OData.BATCH_BODY_FORMAT_METHOD_ERROR.params(method); } return method; } @@ -431,7 +431,7 @@ private String getBoundaryStr(String contentType) { Matcher m = pattern.matcher(contentType); // バウンダリの指定が無い if (!m.matches()) { - throw DcCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.params(HttpHeaders.CONTENT_TYPE); + throw PersoniumCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.params(HttpHeaders.CONTENT_TYPE); } boundary = m.replaceAll("$1"); @@ -445,8 +445,8 @@ private String getBoundaryStr(String contentType) { */ private void checkTopCount(int query) { bulkTopCount += query; - if (bulkTopCount > DcCoreConfig.getTopQueryMaxSize()) { - throw DcCoreException.OData.BATCH_TOTAL_TOP_COUNT_LIMITATION_EXCEEDED; + if (bulkTopCount > PersoniumUnitConfig.getTopQueryMaxSize()) { + throw PersoniumCoreException.OData.BATCH_TOTAL_TOP_COUNT_LIMITATION_EXCEEDED; } } diff --git a/src/main/java/com/fujitsu/dc/core/rs/odata/BatchBodyPart.java b/src/main/java/io/personium/core/rs/odata/BatchBodyPart.java similarity index 96% rename from src/main/java/com/fujitsu/dc/core/rs/odata/BatchBodyPart.java rename to src/main/java/io/personium/core/rs/odata/BatchBodyPart.java index 6d2eaa695..384b92f20 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/odata/BatchBodyPart.java +++ b/src/main/java/io/personium/core/rs/odata/BatchBodyPart.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.odata; +package io.personium.core.rs.odata; import java.util.Map; diff --git a/src/main/java/com/fujitsu/dc/core/rs/odata/BatchElapsedTimer.java b/src/main/java/io/personium/core/rs/odata/BatchElapsedTimer.java similarity index 85% rename from src/main/java/com/fujitsu/dc/core/rs/odata/BatchElapsedTimer.java rename to src/main/java/io/personium/core/rs/odata/BatchElapsedTimer.java index b581f5729..54f30d60b 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/odata/BatchElapsedTimer.java +++ b/src/main/java/io/personium/core/rs/odata/BatchElapsedTimer.java @@ -14,14 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.odata; +package io.personium.core.rs.odata; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.rs.odata.ODataBatchResource.BatchPriority; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.rs.odata.ODataBatchResource.BatchPriority; /** * Batchのタイムアウト制御用クラス. @@ -34,8 +34,8 @@ public class BatchElapsedTimer { private long lastSleepTimeStamp; private BatchPriority priority = BatchPriority.LOW; - private long sleep = DcCoreConfig.getOdataBatchSleepInMillis(); - private long sleepInterval = DcCoreConfig.getOdataBatchSleepIntervalInMillis(); + private long sleep = PersoniumUnitConfig.getOdataBatchSleepInMillis(); + private long sleepInterval = PersoniumUnitConfig.getOdataBatchSleepIntervalInMillis(); /** * Lockを他プロセスに譲るためにスリープするか否かを指定するための列挙型. @@ -74,7 +74,7 @@ public boolean shouldBreak(Lock mode) { Thread.sleep(sleep); } catch (InterruptedException e) { log.warn("Batch request interrupted.", e); - throw DcCoreException.Server.UNKNOWN_ERROR; + throw PersoniumCoreException.Server.UNKNOWN_ERROR; } current = System.currentTimeMillis(); lastSleepTimeStamp = current; diff --git a/src/main/java/com/fujitsu/dc/core/rs/odata/BatchRequestShutter.java b/src/main/java/io/personium/core/rs/odata/BatchRequestShutter.java similarity index 88% rename from src/main/java/com/fujitsu/dc/core/rs/odata/BatchRequestShutter.java rename to src/main/java/io/personium/core/rs/odata/BatchRequestShutter.java index 9b619707a..e701a304c 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/odata/BatchRequestShutter.java +++ b/src/main/java/io/personium/core/rs/odata/BatchRequestShutter.java @@ -14,11 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.odata; +package io.personium.core.rs.odata; import javax.ws.rs.HttpMethod; -import com.fujitsu.dc.core.DcCoreException; +import io.personium.core.PersoniumCoreException; /** * Batchリクエスト中にToo Many Concurrentが発生後の実行/スキップを制御するクラス. @@ -40,7 +40,7 @@ public boolean isShuttered() { * @param e 発生した例外 */ public void updateStatus(Exception e) { - if (DcCoreException.Misc.TOO_MANY_CONCURRENT_REQUESTS.equals(e)) { + if (PersoniumCoreException.Misc.TOO_MANY_CONCURRENT_REQUESTS.equals(e)) { shuttered = true; } } diff --git a/src/main/java/com/fujitsu/dc/core/rs/odata/BulkRequest.java b/src/main/java/io/personium/core/rs/odata/BulkRequest.java similarity index 91% rename from src/main/java/com/fujitsu/dc/core/rs/odata/BulkRequest.java rename to src/main/java/io/personium/core/rs/odata/BulkRequest.java index 2a3efd265..26555b82f 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/odata/BulkRequest.java +++ b/src/main/java/io/personium/core/rs/odata/BulkRequest.java @@ -14,12 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.odata; +package io.personium.core.rs.odata; import java.util.Map; -import com.fujitsu.dc.common.es.EsBulkRequest; -import com.fujitsu.dc.core.model.impl.es.doc.EntitySetDocHandler; +import io.personium.common.es.EsBulkRequest; +import io.personium.core.model.impl.es.doc.EntitySetDocHandler; /** * BatchCreateRequestクラス. diff --git a/src/main/java/com/fujitsu/dc/core/rs/odata/ODataBatchResource.java b/src/main/java/io/personium/core/rs/odata/ODataBatchResource.java similarity index 89% rename from src/main/java/com/fujitsu/dc/core/rs/odata/ODataBatchResource.java rename to src/main/java/io/personium/core/rs/odata/ODataBatchResource.java index 5f43aec74..ac3d30990 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/odata/ODataBatchResource.java +++ b/src/main/java/io/personium/core/rs/odata/ODataBatchResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.odata; +package io.personium.core.rs.odata; import java.io.Reader; import java.io.StringReader; @@ -55,28 +55,28 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.es.util.DcUUID; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreAuthzException; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.DcReadDeleteModeManager; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.auth.Privilege; -import com.fujitsu.dc.core.exceptions.ODataErrorMessage; -import com.fujitsu.dc.core.model.impl.es.doc.EntitySetDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.LinkDocHandler; -import com.fujitsu.dc.core.model.impl.es.odata.UserDataODataProducer; -import com.fujitsu.dc.core.odata.DcFormatWriterFactory; -import com.fujitsu.dc.core.odata.OEntityWrapper; -import com.fujitsu.dc.core.rs.DcCoreExceptionMapper; +import io.personium.common.es.util.PersoniumUUID; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumCoreAuthzException; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.PersoniumReadDeleteModeManager; +import io.personium.core.auth.AccessContext; +import io.personium.core.auth.Privilege; +import io.personium.core.exceptions.ODataErrorMessage; +import io.personium.core.model.impl.es.doc.EntitySetDocHandler; +import io.personium.core.model.impl.es.doc.LinkDocHandler; +import io.personium.core.model.impl.es.odata.UserDataODataProducer; +import io.personium.core.odata.PersoniumFormatWriterFactory; +import io.personium.core.odata.OEntityWrapper; +import io.personium.core.rs.PersoniumCoreExceptionMapper; /** * ODataBatchResourceクラス. */ public class ODataBatchResource extends AbstractODataResource { - private static final String X_DC_PRIORITY = "X-Dc-Priority"; + private static final String X_PERSONIUM_PRIORITY = "X-Personium-Priority"; /** * Lockを他プロセスに譲るためにスリープするか否か. @@ -147,12 +147,12 @@ public Response batchRequest( Reader reader) { long startTime = System.currentTimeMillis(); - // タイムアウト時間 (dc_config.properties com.fujitsu.dc.core.odata.batch.timeoutInSecで設定. 単位は秒) - long batchTimeoutInSec = DcCoreConfig.getOdataBatchRequestTimeoutInMillis(); + // タイムアウト時間 (personium-unit-config.properties io.personium.core.odata.batch.timeoutInSecで設定. 単位は秒) + long batchTimeoutInSec = PersoniumUnitConfig.getOdataBatchRequestTimeoutInMillis(); // Lockを他プロセスに譲るためにスリープするか否かの拡張ヘッダの値を取得する BatchPriority priority = BatchPriority.LOW; - List priorityHeaders = headers.getRequestHeader(X_DC_PRIORITY); + List priorityHeaders = headers.getRequestHeader(X_PERSONIUM_PRIORITY); if (priorityHeaders != null) { priority = BatchPriority.fromString(priorityHeaders.get(0)); } @@ -169,11 +169,11 @@ public Response batchRequest( List bodyParts = parser.parse(boundary, reader, uriInfo.getRequestUri().toString()); if (bodyParts == null || bodyParts.size() == 0) { // パース処理失敗 - throw DcCoreException.OData.BATCH_BODY_PARSE_ERROR; + throw PersoniumCoreException.OData.BATCH_BODY_PARSE_ERROR; } - if (bodyParts.size() > Integer.parseInt(DcCoreConfig.getOdataBatchBulkRequestMaxSize())) { + if (bodyParts.size() > Integer.parseInt(PersoniumUnitConfig.getOdataBatchBulkRequestMaxSize())) { // $Batchで指定されたリクエスト数が不正 - throw DcCoreException.OData.TOO_MANY_REQUESTS.params(bodyParts.size()); + throw PersoniumCoreException.OData.TOO_MANY_REQUESTS.params(bodyParts.size()); } UserDataODataProducer producer = (UserDataODataProducer) this.odataResource.getODataProducer(); @@ -224,7 +224,7 @@ private void setTimeoutResponse(StringBuilder builder, String boundary) { */ private BatchResponse getTimeoutResponse() { BatchResponse res = new BatchResponse(); - res.setErrorResponse(DcCoreException.Misc.SERVER_REQUEST_TIMEOUT); + res.setErrorResponse(PersoniumCoreException.Misc.SERVER_REQUEST_TIMEOUT); return res; } @@ -253,9 +253,9 @@ private void executePartRequest(StringBuilder responseBody, UriInfo uriInfo, List npBulkContexts, BatchBodyPart bodyPart) { // ReadDeleteOnlyMode中はGETとDELETEメソッド以外は許可しないため、エラーレスポンスを設定する - if (!DcReadDeleteModeManager.isAllowedMethod(bodyPart.getHttpMethod())) { + if (!PersoniumReadDeleteModeManager.isAllowedMethod(bodyPart.getHttpMethod())) { BatchResponse res = new BatchResponse(); - res.setErrorResponse(DcCoreException.Server.READ_DELETE_ONLY); + res.setErrorResponse(PersoniumCoreException.Server.READ_DELETE_ONLY); responseBody.append(getChangesetResponseBody(boundary, bodyPart, res)); return; } @@ -267,7 +267,7 @@ private void executePartRequest(StringBuilder responseBody, UriInfo uriInfo, if (!isValidNavigationProperty(bodyPart)) { checkAndExecBulk(responseBody, uriInfo, boundary, npBulkContexts); BatchResponse res = new BatchResponse(); - res.setErrorResponse(DcCoreException.OData.KEY_FOR_NAVPROP_SHOULD_NOT_BE_SPECIFIED); + res.setErrorResponse(PersoniumCoreException.OData.KEY_FOR_NAVPROP_SHOULD_NOT_BE_SPECIFIED); if (HttpMethod.GET.equals(bodyPart.getHttpMethod())) { responseBody.append(getRetrieveResponseBody(boundary, res)); } else { @@ -290,10 +290,10 @@ private void executePartRequest(StringBuilder responseBody, UriInfo uriInfo, setChangesetTimeoutResponse(responseBody, boundary, bodyPart); } } else if (bodyPart.getHttpMethod().equals(HttpMethod.GET)) { - res.setErrorResponse(DcCoreException.Misc.METHOD_NOT_IMPLEMENTED); + res.setErrorResponse(PersoniumCoreException.Misc.METHOD_NOT_IMPLEMENTED); responseBody.append(getRetrieveResponseBody(boundary, res)); } else { - res.setErrorResponse(DcCoreException.Misc.METHOD_NOT_IMPLEMENTED); + res.setErrorResponse(PersoniumCoreException.Misc.METHOD_NOT_IMPLEMENTED); responseBody.append(getChangesetResponseBody(boundary, bodyPart, res)); } } else if (bodyPart.getHttpMethod().equals(HttpMethod.POST)) { @@ -306,7 +306,7 @@ private void executePartRequest(StringBuilder responseBody, UriInfo uriInfo, for (Entry request : bulkRequests.entrySet()) { setChangesetTimeoutResponse(responseBody, boundary, request.getValue().getBodyPart()); BatchResponse res = new BatchResponse(); - Exception exception = DcCoreException.Misc.SERVER_REQUEST_TIMEOUT; + Exception exception = PersoniumCoreException.Misc.SERVER_REQUEST_TIMEOUT; res.setErrorResponse(exception); responseBody.append( getChangesetResponseBody(boundary, request.getValue().getBodyPart(), res)); @@ -340,9 +340,9 @@ private void executePartRequest(StringBuilder responseBody, UriInfo uriInfo, npBulkContexts); } else { for (NavigationPropertyBulkContext npBulkContext : npBulkContexts) { - npBulkContext.setException(DcCoreException.Misc.SERVER_REQUEST_TIMEOUT); + npBulkContext.setException(PersoniumCoreException.Misc.SERVER_REQUEST_TIMEOUT); npBulkContext.getBatchResponse().setErrorResponse( - DcCoreException.Misc.SERVER_REQUEST_TIMEOUT); + PersoniumCoreException.Misc.SERVER_REQUEST_TIMEOUT); responseBody.append(getChangesetResponseBody(boundary, npBulkContext.getBodyPart(), npBulkContext.getBatchResponse())); } @@ -397,7 +397,7 @@ private void executePartRequest(StringBuilder responseBody, UriInfo uriInfo, } } else { BatchResponse res = new BatchResponse(); - res.setErrorResponse(DcCoreException.Misc.METHOD_NOT_ALLOWED); + res.setErrorResponse(PersoniumCoreException.Misc.METHOD_NOT_ALLOWED); responseBody.append(getChangesetResponseBody(boundary, bodyPart, res)); } } @@ -407,7 +407,7 @@ private void setChangesetTooManyConcurrentResponse(StringBuilder responseBody, BatchBodyPart bodyPart) { // 直前のPOSTリクエストがTooManyConcurrentだったため、エラーレスポンスを作成する BatchResponse res = new BatchResponse(); - res.setErrorResponse(DcCoreException.Misc.TOO_MANY_CONCURRENT_REQUESTS); + res.setErrorResponse(PersoniumCoreException.Misc.TOO_MANY_CONCURRENT_REQUESTS); responseBody.append(getChangesetResponseBody(boundary, bodyPart, res)); } @@ -422,7 +422,7 @@ private void execBulkRequestForNavigationProperty(List contentTypes = new ArrayList(); contentTypes.add(outputFormat); - UriInfo resUriInfo = DcCoreUtils.createUriInfo(uriInfo, 1); + UriInfo resUriInfo = PersoniumCoreUtils.createUriInfo(uriInfo, 1); String key = AbstractODataResource.replaceDummyKeyToNull(ent.getEntityKey().toKeyString()); String responseStr = renderEntityResponse(resUriInfo, npBulkContext.getEntityResponse(), "json", contentTypes); @@ -681,7 +681,7 @@ private NavigationPropertyBulkContext createNavigationPropertyBulkContext(BatchB // 存在しないエンティティセットを指定されたときは404例外を発生する EdmEntitySet eSet = this.odataResource.metadata.findEdmEntitySet(bodyPart.getEntitySetName()); if (eSet == null) { - throw DcCoreException.OData.NO_SUCH_ENTITY_SET; + throw PersoniumCoreException.OData.NO_SUCH_ENTITY_SET; } // Navigationプロパティのスキーマ上の存在確認 @@ -690,7 +690,7 @@ private NavigationPropertyBulkContext createNavigationPropertyBulkContext(BatchB OEntityId oEntityId = entityResource.getOEntityId(); EdmNavigationProperty enp = eSet.getType().findNavigationProperty(bodyPart.getTargetNavigationProperty()); if (enp == null) { - throw DcCoreException.OData.NOT_SUCH_NAVPROP; + throw PersoniumCoreException.OData.NOT_SUCH_NAVPROP; } // リクエスト情報作成 @@ -724,7 +724,7 @@ OEntityWrapper createEntityFromInputStream( OEntity newEnt = createRequestEntity(reader, null, metadata, targetEntitySetName); // ラッパにくるむ. POSTでIf-Match等 ETagを受け取ることはないのでetagはnull。 - String uuid = DcUUID.randomUUID(); + String uuid = PersoniumUUID.randomUUID(); OEntityWrapper oew = new OEntityWrapper(uuid, newEnt, null); return oew; } @@ -1015,8 +1015,8 @@ private void checkAndExecBulk( } } else { for (NavigationPropertyBulkContext npBulkContext : navigationPropertyBulkContexts) { - npBulkContext.setException(DcCoreException.Misc.SERVER_REQUEST_TIMEOUT); - npBulkContext.getBatchResponse().setErrorResponse(DcCoreException.Misc.SERVER_REQUEST_TIMEOUT); + npBulkContext.setException(PersoniumCoreException.Misc.SERVER_REQUEST_TIMEOUT); + npBulkContext.getBatchResponse().setErrorResponse(PersoniumCoreException.Misc.SERVER_REQUEST_TIMEOUT); BatchBodyPart bodyPart = npBulkContext.getBodyPart(); responseBody.append(getChangesetResponseBody(boundary, bodyPart, npBulkContext.getBatchResponse())); @@ -1036,7 +1036,7 @@ private void checkAndExecBulk( } else { for (Entry request : bulkRequests.entrySet()) { BatchResponse res = new BatchResponse(); - Exception exception = DcCoreException.Misc.SERVER_REQUEST_TIMEOUT; + Exception exception = PersoniumCoreException.Misc.SERVER_REQUEST_TIMEOUT; res.setErrorResponse(exception); // レスポンスボディ作成 responseBody.append(getChangesetResponseBody(boundary, request.getValue().getBodyPart(), res)); @@ -1062,7 +1062,7 @@ private void execBulk(StringBuilder responseBody, UriInfo uriInfo, String bounda try { resultList = this.odataResource.getODataProducer().bulkCreateEntity( this.odataResource.metadata, bulkRequests, cellId); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { // 503が発生した後の処理を継続させるため、shutterにステータスを設定。 shutter.updateStatus(e); if (shutter.isShuttered()) { @@ -1100,7 +1100,7 @@ private void execBulk(StringBuilder responseBody, UriInfo uriInfo, String bounda } // ボディ情報 - UriInfo resUriInfo = DcCoreUtils.createUriInfo(uriInfo, 1); + UriInfo resUriInfo = PersoniumCoreUtils.createUriInfo(uriInfo, 1); String format = AbstractODataResource.FORMAT_JSON; List contentTypes = new ArrayList(); contentTypes.add(MediaType.APPLICATION_JSON_TYPE); @@ -1122,7 +1122,7 @@ private void execBulk(StringBuilder responseBody, UriInfo uriInfo, String bounda private void createTooManyConcurrentResponse(StringBuilder responseBody, String boundary) { for (Entry request : bulkRequests.entrySet()) { BatchResponse res = new BatchResponse(); - res.setErrorResponse(DcCoreException.Misc.TOO_MANY_CONCURRENT_REQUESTS); + res.setErrorResponse(PersoniumCoreException.Misc.TOO_MANY_CONCURRENT_REQUESTS); // レスポンスボディ作成 responseBody.append(getChangesetResponseBody(boundary, request.getValue().getBodyPart(), res)); } @@ -1135,7 +1135,7 @@ private void createTooManyConcurrentResponse(StringBuilder responseBody, String */ private void createTooManyConcurrentResponse(List npBulkContexts) { for (NavigationPropertyBulkContext npBulkContext : npBulkContexts) { - npBulkContext.setException(DcCoreException.Misc.TOO_MANY_CONCURRENT_REQUESTS); + npBulkContext.setException(PersoniumCoreException.Misc.TOO_MANY_CONCURRENT_REQUESTS); } } @@ -1153,7 +1153,7 @@ private BatchResponse list(UriInfo uriInfo, BatchBodyPart bodyPart) { checkReadAccessContext(bodyPart); // NavigationProperty経由の一覧取得は 501 if (bodyPart.hasNavigationProperty()) { - throw DcCoreException.Misc.METHOD_NOT_IMPLEMENTED; + throw PersoniumCoreException.Misc.METHOD_NOT_IMPLEMENTED; } ODataEntitiesResource entitiesResource = new ODataEntitiesResource(this.odataResource, bodyPart.getEntitySetName()); @@ -1169,15 +1169,15 @@ private BatchResponse list(UriInfo uriInfo, BatchBodyPart bodyPart) { res.setHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON); res.setHeader(ODataConstants.Headers.DATA_SERVICE_VERSION, "2.0"); // レスポンスボディ - UriInfo resUriInfo = DcCoreUtils.createUriInfo(uriInfo, 1); + UriInfo resUriInfo = PersoniumCoreUtils.createUriInfo(uriInfo, 1); StringWriter sw = new StringWriter(); // TODO 制限事項でAcceptは無視してJSONで返却するため固定でJSONを指定する. List acceptableMediaTypes = new ArrayList(); acceptableMediaTypes.add(MediaType.APPLICATION_JSON_TYPE); // TODO 制限事項でQueryは無視するため固定でnullを指定する. - FormatWriter fw = DcFormatWriterFactory.getFormatWriter(EntitiesResponse.class, + FormatWriter fw = PersoniumFormatWriterFactory.getFormatWriter(EntitiesResponse.class, acceptableMediaTypes, null, null); - UriInfo uriInfo2 = DcCoreUtils.createUriInfo(resUriInfo, 1); + UriInfo uriInfo2 = PersoniumCoreUtils.createUriInfo(resUriInfo, 1); fw.write(uriInfo2, sw, entitiesResp); String entity = sw.toString(); @@ -1217,7 +1217,7 @@ private BatchResponse retrieve(UriInfo uriInfo, BatchBodyPart bodyPart) { res.setHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON); res.setHeader(ODataConstants.Headers.DATA_SERVICE_VERSION, "2.0"); // レスポンスボディ - UriInfo resUriInfo = DcCoreUtils.createUriInfo(uriInfo, 1); + UriInfo resUriInfo = PersoniumCoreUtils.createUriInfo(uriInfo, 1); // TODO 現状は、ContentTypeはJSON固定 String format = AbstractODataResource.FORMAT_JSON; List contentTypes = new ArrayList(); @@ -1306,7 +1306,7 @@ private BatchResponse createLinks(UriInfo uriInfo, BatchBodyPart bodyPart) { // 存在しないエンティティセットを指定されたときは即刻エラー EdmEntitySet eSet = this.odataResource.metadata.findEdmEntitySet(bodyPart.getEntitySetName()); if (eSet == null) { - throw DcCoreException.OData.NO_SUCH_ENTITY_SET; + throw PersoniumCoreException.OData.NO_SUCH_ENTITY_SET; } // アクセス制御 @@ -1314,14 +1314,14 @@ private BatchResponse createLinks(UriInfo uriInfo, BatchBodyPart bodyPart) { // $links の POSTでNav Propのキー指定があってはいけない。 if (bodyPart.getTargetEntityKey().length() > 0) { - throw DcCoreException.OData.KEY_FOR_NAVPROP_SHOULD_NOT_BE_SPECIFIED; + throw PersoniumCoreException.OData.KEY_FOR_NAVPROP_SHOULD_NOT_BE_SPECIFIED; } OEntityKey oeKey = OEntityKey.parse(bodyPart.getEntityKeyWithParences()); OEntityId sourceEntityId = OEntityIds.create(bodyPart.getEntitySetName(), oeKey); StringReader requestReader = new StringReader(bodyPart.getEntity()); - OEntityId targetEntityId = ODataLinksResource.parseRequestUri(DcCoreUtils.createUriInfo(uriInfo, 1), + OEntityId targetEntityId = ODataLinksResource.parseRequestUri(PersoniumCoreUtils.createUriInfo(uriInfo, 1), requestReader, bodyPart.getEntitySetName(), this.odataResource.metadata); this.odataResource.getODataProducer().createLink(sourceEntityId, bodyPart.getTargetEntitySetName(), @@ -1362,11 +1362,11 @@ private void checkAccessContext(AccessContext ac) { if (AccessContext.TYPE_INVALID.equals(ac.getType())) { ac.throwInvalidTokenException(this.odataResource.getAcceptableAuthScheme()); } else if (AccessContext.TYPE_ANONYMOUS.equals(ac.getType())) { - throw DcCoreAuthzException.AUTHORIZATION_REQUIRED.realm(ac.getRealm(), + throw PersoniumCoreAuthzException.AUTHORIZATION_REQUIRED.realm(ac.getRealm(), this.odataResource.getAcceptableAuthScheme()); } // $batchとして許可しないprivilegeが指定された場合はここに到達するため403エラーとする - throw DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + throw PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; } } @@ -1383,7 +1383,7 @@ private void checkAccessContextForMimePart(AccessContext ac, Privilege privilege if (!this.odataResource.hasPrivilege(ac, privilege)) { // $batchのリクエストに対し、すでに認証処理は実施済みのため、ここでは認可の判定のみ行う - throw DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + throw PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; } } @@ -1404,7 +1404,7 @@ private void checkWriteAccessContext(BatchBodyPart bodyPart) { writeAccess.put(priv, batchAccess); try { this.checkAccessContextForMimePart(this.odataResource.getAccessContext(), priv); - } catch (DcCoreException ex) { + } catch (PersoniumCoreException ex) { batchAccess.setAccessContext(ex); } } @@ -1428,7 +1428,7 @@ private void checkReadAccessContext(BatchBodyPart bodyPart) { readAccess.put(priv, batchAccess); try { this.checkAccessContextForMimePart(this.odataResource.getAccessContext(), priv); - } catch (DcCoreException ex) { + } catch (PersoniumCoreException ex) { batchAccess.setAccessContext(ex); } } @@ -1453,7 +1453,7 @@ private boolean isValidNavigationProperty(BatchBodyPart bodyPart) { * Batchアクセス情報を管理するクラス. */ static class BatchAccess { - private DcCoreException exception = null; + private PersoniumCoreException exception = null; void checkAccessContext() { if (this.exception != null) { @@ -1461,7 +1461,7 @@ void checkAccessContext() { } } - void setAccessContext(DcCoreException ex) { + void setAccessContext(PersoniumCoreException ex) { this.exception = ex; } @@ -1556,32 +1556,32 @@ public void setBody(String body) { /** * エラー情報を設定. * @param res BatchResponse - * @param e DcCoreException + * @param e PersoniumCoreException */ void setErrorResponse(Exception e) { // ログ出力 - DcCoreExceptionMapper mapper = new DcCoreExceptionMapper(); + PersoniumCoreExceptionMapper mapper = new PersoniumCoreExceptionMapper(); mapper.toResponse(e); - if (e instanceof DcCoreException) { + if (e instanceof PersoniumCoreException) { // レスポンス作成 setHeader(org.apache.http.HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON); - setResponseCode(((DcCoreException) e).getStatus()); - setBody(createJsonBody((DcCoreException) e)); + setResponseCode(((PersoniumCoreException) e).getStatus()); + setBody(createJsonBody((PersoniumCoreException) e)); } else { // レスポンス作成 setHeader(org.apache.http.HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON); - setResponseCode(DcCoreException.Server.UNKNOWN_ERROR.getStatus()); - setBody(createJsonBody(DcCoreException.Server.UNKNOWN_ERROR)); + setResponseCode(PersoniumCoreException.Server.UNKNOWN_ERROR.getStatus()); + setBody(createJsonBody(PersoniumCoreException.Server.UNKNOWN_ERROR)); } } /** * Json形式のエラーメッセージを作成する. - * @param exception DcCoreException + * @param exception PersoniumCoreException * @return レスポンスボディ用Json形式エラーメッセージ */ - private String createJsonBody(DcCoreException exception) { + private String createJsonBody(PersoniumCoreException exception) { String code = exception.getCode(); String message = exception.getMessage(); LinkedHashMap json = new LinkedHashMap(); diff --git a/src/main/java/com/fujitsu/dc/core/rs/odata/ODataCtlResource.java b/src/main/java/io/personium/core/rs/odata/ODataCtlResource.java similarity index 89% rename from src/main/java/com/fujitsu/dc/core/rs/odata/ODataCtlResource.java rename to src/main/java/io/personium/core/rs/odata/ODataCtlResource.java index 88ddcc7c5..49fcd1cff 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/odata/ODataCtlResource.java +++ b/src/main/java/io/personium/core/rs/odata/ODataCtlResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.odata; +package io.personium.core.rs.odata; import java.util.List; @@ -22,10 +22,10 @@ import org.odata4j.core.OEntityKey; import org.odata4j.core.OProperty; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.ExtRole; -import com.fujitsu.dc.core.model.ctl.Relation; -import com.fujitsu.dc.core.odata.OEntityWrapper; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.ExtRole; +import io.personium.core.model.ctl.Relation; +import io.personium.core.odata.OEntityWrapper; /** * ODataResourceに対する事前処理や事後処理. @@ -100,7 +100,7 @@ public void beforeLinkDelete(OEntityId sourceEntity, String targetNavProp) { } /** - * dc:Format以外のチェック処理. + * p:Format以外のチェック処理. * @param props プロパティ一覧 */ public void validate(List> props) { @@ -112,7 +112,7 @@ private void checkNonSupportLinks(String sourceEntity, String targetNavProp) { } if ((sourceEntity.equals(ExtRole.EDM_TYPE_NAME) && targetNavProp.equals(Relation.EDM_TYPE_NAME)) || (sourceEntity.equals(Relation.EDM_TYPE_NAME) && targetNavProp.equals(ExtRole.EDM_TYPE_NAME))) { - throw DcCoreException.OData.NO_SUCH_ASSOCIATION; + throw PersoniumCoreException.OData.NO_SUCH_ASSOCIATION; } } } diff --git a/src/main/java/com/fujitsu/dc/core/rs/odata/ODataEntitiesResource.java b/src/main/java/io/personium/core/rs/odata/ODataEntitiesResource.java similarity index 87% rename from src/main/java/com/fujitsu/dc/core/rs/odata/ODataEntitiesResource.java rename to src/main/java/io/personium/core/rs/odata/ODataEntitiesResource.java index 50be0b36e..c87d3a119 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/odata/ODataEntitiesResource.java +++ b/src/main/java/io/personium/core/rs/odata/ODataEntitiesResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.odata; +package io.personium.core.rs.odata; import java.io.Reader; import java.io.StringWriter; @@ -51,14 +51,14 @@ import org.odata4j.producer.InlineCount; import org.odata4j.producer.QueryInfo; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.model.ctl.ReceivedMessage; -import com.fujitsu.dc.core.model.ctl.SentMessage; -import com.fujitsu.dc.core.odata.DcFormatWriterFactory; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.auth.AccessContext; +import io.personium.core.model.ctl.Common; +import io.personium.core.model.ctl.ReceivedMessage; +import io.personium.core.model.ctl.SentMessage; +import io.personium.core.odata.PersoniumFormatWriterFactory; /** * ODataのEntitiesリソース( id 指定がなくentitySetが指定されたURL)を扱うJAX-RSリソース. @@ -112,9 +112,9 @@ public Response listEntities( MediaType contentType = decideOutputFormat(accept, format); acceptableMediaTypes.add(contentType); - FormatWriter fw = DcFormatWriterFactory.getFormatWriter(EntitiesResponse.class, + FormatWriter fw = PersoniumFormatWriterFactory.getFormatWriter(EntitiesResponse.class, acceptableMediaTypes, null, callback); - UriInfo uriInfo2 = DcCoreUtils.createUriInfo(uriInfo, 1); + UriInfo uriInfo2 = PersoniumCoreUtils.createUriInfo(uriInfo, 1); fw.write(uriInfo2, sw, resp); String entity = null; @@ -177,7 +177,7 @@ public Response post( this.odataResource.checkAccessContext(this.accessContext, this.odataResource.getNecessaryWritePrivilege(getEntitySetName())); - UriInfo resUriInfo = DcCoreUtils.createUriInfo(uriInfo, 1); + UriInfo resUriInfo = PersoniumCoreUtils.createUriInfo(uriInfo, 1); // Entityの作成を Producerに依頼 EntityResponse res = this.createEntity(reader, this.odataResource); @@ -220,13 +220,13 @@ static QueryInfo queryInfo(UriInfo uriInfo, String fullTextSearchKeyword) { // 全文検索クエリqのバリデート if (fullTextSearchKeyword != null && (fullTextSearchKeyword.getBytes().length < 1 || fullTextSearchKeyword.getBytes().length > Q_MAX_LENGTH)) { - throw DcCoreException.OData.QUERY_INVALID_ERROR.params("q", fullTextSearchKeyword); + throw PersoniumCoreException.OData.QUERY_INVALID_ERROR.params("q", fullTextSearchKeyword); } // $expand指定時は$topの最大値が変わるためチェックする - if (expand != null && top != null && top > DcCoreConfig.getTopQueryMaxSizeWithExpand()) { + if (expand != null && top != null && top > PersoniumUnitConfig.getTopQueryMaxSizeWithExpand()) { // Integerでそのまま値を返却すると、カンマが付くため、文字列でエラーメッセージを返却する - throw DcCoreException.OData.QUERY_INVALID_ERROR.params("$top", top.toString()); + throw PersoniumCoreException.OData.QUERY_INVALID_ERROR.params("$top", top.toString()); } Map customOptions = new HashMap(); @@ -252,14 +252,14 @@ public Response options() { // アクセス制御 this.odataResource.checkAccessContext(this.accessContext, this.odataResource.getNecessaryReadPrivilege(getEntitySetName())); - return DcCoreUtils.responseBuilderForOptions( + return PersoniumCoreUtils.responseBuilderForOptions( HttpMethod.GET, HttpMethod.POST ).build(); } /** - * dc:Format以外のチェック処理. + * p:Format以外のチェック処理. * @param props プロパティ一覧 */ @Override @@ -276,7 +276,7 @@ private void checkNotAllowedMethod(UriInfo uriInfo) { String[] uriPath = uriInfo.getPath().split("/"); if (ReceivedMessage.EDM_TYPE_NAME.equals(uriPath[(uriPath.length - 1)]) || SentMessage.EDM_TYPE_NAME.equals(uriPath[(uriPath.length - 1)])) { - throw DcCoreException.Misc.METHOD_NOT_ALLOWED; + throw PersoniumCoreException.Misc.METHOD_NOT_ALLOWED; } } } diff --git a/src/main/java/com/fujitsu/dc/core/rs/odata/ODataEntityResource.java b/src/main/java/io/personium/core/rs/odata/ODataEntityResource.java similarity index 87% rename from src/main/java/com/fujitsu/dc/core/rs/odata/ODataEntityResource.java rename to src/main/java/io/personium/core/rs/odata/ODataEntityResource.java index 6b9969fdb..d5b2f1ea8 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/odata/ODataEntityResource.java +++ b/src/main/java/io/personium/core/rs/odata/ODataEntityResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.odata; +package io.personium.core.rs.odata; import java.io.Reader; import java.util.List; @@ -49,16 +49,16 @@ import org.odata4j.producer.EntityResponse; import org.odata4j.producer.resources.OptionsQueryParser; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.annotations.MERGE; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.model.ctl.ReceivedMessage; -import com.fujitsu.dc.core.model.ctl.SentMessage; -import com.fujitsu.dc.core.odata.DcODataProducer; -import com.fujitsu.dc.core.odata.DcOptionsQueryParser; -import com.fujitsu.dc.core.odata.OEntityWrapper; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.annotations.MERGE; +import io.personium.core.auth.AccessContext; +import io.personium.core.model.ctl.ReceivedMessage; +import io.personium.core.model.ctl.SentMessage; +import io.personium.core.odata.PersoniumODataProducer; +import io.personium.core.odata.PersoniumOptionsQueryParser; +import io.personium.core.odata.OEntityWrapper; /** * ODataのEntityリソース(id指定されたURL)を扱うJAX-RS リソース. @@ -131,13 +131,13 @@ public ODataEntityResource(final ODataResource odataResource, final String entit try { this.oEntityKey = OEntityKey.parse(this.keyString); } catch (IllegalArgumentException e) { - throw DcCoreException.OData.ENTITY_KEY_PARSE_ERROR.reason(e); + throw PersoniumCoreException.OData.ENTITY_KEY_PARSE_ERROR.reason(e); } EdmDataServices metadata = getOdataProducer().getMetadata(); EdmEntitySet edmEntitySet = metadata.findEdmEntitySet(entitySetName); if (edmEntitySet == null) { - throw DcCoreException.OData.NO_SUCH_ENTITY_SET; + throw PersoniumCoreException.OData.NO_SUCH_ENTITY_SET; } EdmEntityType edmEntityType = edmEntitySet.getType(); validatePrimaryKey(oEntityKey, edmEntityType); @@ -165,7 +165,7 @@ public Response get( this.odataResource.checkAccessContext(this.accessContext, this.odataResource.getNecessaryReadPrivilege(getEntitySetName())); - UriInfo resUriInfo = DcCoreUtils.createUriInfo(uriInfo, 1); + UriInfo resUriInfo = PersoniumCoreUtils.createUriInfo(uriInfo, 1); // $formatとAcceptヘッダの値から出力形式を決定 MediaType contentType = decideOutputFormat(accept, format); @@ -230,25 +230,25 @@ EntityQueryInfo queryInfo(String expand, String select, UriInfo resUriInfo) { // $select if ("".equals(select)) { - throw DcCoreException.OData.SELECT_PARSE_ERROR; + throw PersoniumCoreException.OData.SELECT_PARSE_ERROR; } if ("*".equals(select)) { select = null; } try { - selects = DcOptionsQueryParser.parseSelect(select); + selects = PersoniumOptionsQueryParser.parseSelect(select); } catch (Exception e) { - throw DcCoreException.OData.SELECT_PARSE_ERROR.reason(e); + throw PersoniumCoreException.OData.SELECT_PARSE_ERROR.reason(e); } try { - expands = DcOptionsQueryParser.parseExpand(expand); + expands = PersoniumOptionsQueryParser.parseExpand(expand); } catch (Exception e) { - throw DcCoreException.OData.EXPAND_PARSE_ERROR.reason(e); + throw PersoniumCoreException.OData.EXPAND_PARSE_ERROR.reason(e); } // $expandに指定されたプロパティ数の上限チェック - if (expands != null && expands.size() > DcCoreConfig.getExpandPropertyMaxSizeForRetrieve()) { - throw DcCoreException.OData.EXPAND_COUNT_LIMITATION_EXCEEDED; + if (expands != null && expands.size() > PersoniumUnitConfig.getExpandPropertyMaxSizeForRetrieve()) { + throw PersoniumCoreException.OData.EXPAND_COUNT_LIMITATION_EXCEEDED; } EntityQueryInfo queryInfo = new EntityQueryInfo(null, @@ -360,7 +360,7 @@ void deleteEntity(final String ifMatch) { String etag = ODataResource.parseEtagHeader(ifMatch); // 削除処理 - DcODataProducer op = this.getOdataProducer(); + PersoniumODataProducer op = this.getOdataProducer(); op.deleteEntity(getEntitySetName(), this.oEntityKey, etag); // 削除後処理 @@ -399,7 +399,7 @@ public ODataLinksResource link(@PathParam("targetNavProp") final String targetNa targetEntityKey = OEntityKey.parse(targetKey); } } catch (IllegalArgumentException e) { - throw DcCoreException.OData.ENTITY_KEY_LINKS_PARSE_ERROR.reason(e); + throw PersoniumCoreException.OData.ENTITY_KEY_LINKS_PARSE_ERROR.reason(e); } OEntityId oeId = OEntityIds.create(getEntitySetName(), this.oEntityKey); return new ODataLinksResource(this.odataResource, oeId, targetNavProp, targetEntityKey); @@ -424,7 +424,7 @@ public ODataPropertyResource getNavProperty(@PathParam("navProp") final String n @Path("{navProp: _.+}({targetId})") public ODataPropertyResource getNavProperty(@PathParam("navProp") final String navProp, @PathParam("targetId") final String targetId) { - throw DcCoreException.OData.KEY_FOR_NAVPROP_SHOULD_NOT_BE_SPECIFIED; + throw PersoniumCoreException.OData.KEY_FOR_NAVPROP_SHOULD_NOT_BE_SPECIFIED; } /** @@ -437,10 +437,10 @@ public Response options() { this.odataResource.checkAccessContext(this.accessContext, this.odataResource.getNecessaryReadPrivilege(getEntitySetName())); - return DcCoreUtils.responseBuilderForOptions( + return PersoniumCoreUtils.responseBuilderForOptions( HttpMethod.GET, HttpMethod.PUT, - DcCoreUtils.HttpMethod.MERGE, + PersoniumCoreUtils.HttpMethod.MERGE, HttpMethod.DELETE ).build(); } @@ -451,7 +451,7 @@ public Response options() { protected void checkNotAllowedMethod() { if (ReceivedMessage.EDM_TYPE_NAME.equals(getEntitySetName()) || SentMessage.EDM_TYPE_NAME.equals(getEntitySetName())) { - throw DcCoreException.Misc.METHOD_NOT_ALLOWED; + throw PersoniumCoreException.Misc.METHOD_NOT_ALLOWED; } } } diff --git a/src/main/java/com/fujitsu/dc/core/rs/odata/ODataLinksResource.java b/src/main/java/io/personium/core/rs/odata/ODataLinksResource.java similarity index 87% rename from src/main/java/com/fujitsu/dc/core/rs/odata/ODataLinksResource.java rename to src/main/java/io/personium/core/rs/odata/ODataLinksResource.java index b89129938..f64571c61 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/odata/ODataLinksResource.java +++ b/src/main/java/io/personium/core/rs/odata/ODataLinksResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.odata; +package io.personium.core.rs.odata; import java.io.Reader; import java.io.StringWriter; @@ -56,14 +56,14 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.model.ctl.Account; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.model.ctl.ReceivedMessage; -import com.fujitsu.dc.core.model.impl.es.odata.EsODataProducer; -import com.fujitsu.dc.core.odata.DcFormatWriterFactory; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.auth.AccessContext; +import io.personium.core.model.ctl.Account; +import io.personium.core.model.ctl.Common; +import io.personium.core.model.ctl.ReceivedMessage; +import io.personium.core.model.impl.es.odata.EsODataProducer; +import io.personium.core.odata.PersoniumFormatWriterFactory; /** * ODataの$linksを扱う JAX-RS Resource. @@ -124,11 +124,11 @@ public Response createLink( // $links の POSTでNav Propのキー指定があってはいけない。 if (this.targetEntityKey != null) { - throw DcCoreException.OData.KEY_FOR_NAVPROP_SHOULD_NOT_BE_SPECIFIED; + throw PersoniumCoreException.OData.KEY_FOR_NAVPROP_SHOULD_NOT_BE_SPECIFIED; } log.debug("POSTING $LINK"); OEntityId newTargetEntity = - parseRequestUri(DcCoreUtils.createUriInfo(uriInfo, NUM_LEVELS_FROM_SVC_ROOT), reqBody); + parseRequestUri(PersoniumCoreUtils.createUriInfo(uriInfo, NUM_LEVELS_FROM_SVC_ROOT), reqBody); // URLで指定したリンク先オブジェクトとBodyに指定したオブジェクトが等しいかをチェックする Pattern p = Pattern.compile("(.+)/([^/]+)$"); @@ -145,7 +145,7 @@ public Response createLink( targetEntitySetName = this.targetNavProp.substring(1); } if (!targetEntitySetName.equals(bodyNavProp)) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(Common.DC_FORMAT_PATTERN_URI); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(Common.P_FORMAT_PATTERN_URI); } this.odataProducer.createLink(sourceEntity, targetNavProp, newTargetEntity); @@ -167,9 +167,9 @@ public Response updateLink( this.checkWriteAccessContext(); if (this.targetEntityKey == null) { - throw DcCoreException.OData.KEY_FOR_NAVPROP_SHOULD_BE_SPECIFIED; + throw PersoniumCoreException.OData.KEY_FOR_NAVPROP_SHOULD_BE_SPECIFIED; } else { - throw DcCoreException.Misc.METHOD_NOT_IMPLEMENTED; + throw PersoniumCoreException.Misc.METHOD_NOT_IMPLEMENTED; } } @@ -191,10 +191,10 @@ static OEntityId parseRequestUri(final UriInfo uriInfo, try { link = parser.parse(reqBody); } catch (Exception e) { - throw DcCoreException.OData.JSON_PARSE_ERROR.reason(e); + throw PersoniumCoreException.OData.JSON_PARSE_ERROR.reason(e); } if (link.getUri() == null) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("uri"); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("uri"); } log.debug(uriInfo.getBaseUri().toASCIIString()); @@ -208,7 +208,7 @@ static OEntityId parseRequestUri(final UriInfo uriInfo, try { oid = OEntityIds.parse(serviceRootUri, linkUrl); } catch (IllegalArgumentException e) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("uri"); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("uri"); } // parse処理では後ろ括弧のチェックの対応を行っていないため、括弧の対応チェックを行う @@ -221,7 +221,7 @@ static OEntityId parseRequestUri(final UriInfo uriInfo, Pattern p = Pattern.compile("^\\(.+\\)$"); Matcher m = p.matcher(entitySetName); if (!m.find()) { - throw DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("uri"); + throw PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("uri"); } return oid; @@ -260,7 +260,7 @@ public Response deleteLink() { // 1. http://host/service.svc/Customers('ALFKI')/$links/Orders(1) // 2. http://host/service.svc/Orders(1)/$links/Customer. if (this.targetEntityKey == null) { - throw DcCoreException.OData.KEY_FOR_NAVPROP_SHOULD_BE_SPECIFIED; + throw PersoniumCoreException.OData.KEY_FOR_NAVPROP_SHOULD_BE_SPECIFIED; } this.odataProducer.deleteLink(sourceEntity, targetNavProp, targetEntityKey); return noContent(); @@ -298,14 +298,14 @@ public Response getLinks( StringWriter sw = new StringWriter(); // context.getRequest().getAcceptableMediaTypes() - UriInfo uriInfo2 = DcCoreUtils.createUriInfo(uriInfo, NUM_LEVELS_FROM_SVC_ROOT); + UriInfo uriInfo2 = PersoniumCoreUtils.createUriInfo(uriInfo, NUM_LEVELS_FROM_SVC_ROOT); String serviceRootUri = uriInfo2.getBaseUri().toASCIIString(); String contentType; if (response.getMultiplicity() == EdmMultiplicity.MANY) { SingleLinks links = SingleLinks.create(serviceRootUri, response.getEntities()); // TODO レスポンスはJSON固定とする. - FormatWriter fw = DcFormatWriterFactory.getFormatWriter(SingleLinks.class, null, "json", + FormatWriter fw = PersoniumFormatWriterFactory.getFormatWriter(SingleLinks.class, null, "json", callback); fw.write(uriInfo2, sw, links); contentType = fw.getContentType(); @@ -315,7 +315,7 @@ public Response getLinks( throw new NotFoundException(); } SingleLink link = SingleLinks.create(serviceRootUri, entityId); - FormatWriter fw = DcFormatWriterFactory.getFormatWriter(SingleLink.class, null, "json", + FormatWriter fw = PersoniumFormatWriterFactory.getFormatWriter(SingleLink.class, null, "json", callback); fw.write(uriInfo, sw, link); contentType = fw.getContentType(); @@ -339,7 +339,7 @@ public Response options() { this.odataResource.checkAccessContext(this.accessContext, this.odataResource.getNecessaryOptionsPrivilege()); - return DcCoreUtils.responseBuilderForOptions( + return PersoniumCoreUtils.responseBuilderForOptions( HttpMethod.GET, HttpMethod.DELETE, HttpMethod.PUT, diff --git a/src/main/java/com/fujitsu/dc/core/rs/odata/ODataMergeResource.java b/src/main/java/io/personium/core/rs/odata/ODataMergeResource.java similarity index 93% rename from src/main/java/com/fujitsu/dc/core/rs/odata/ODataMergeResource.java rename to src/main/java/io/personium/core/rs/odata/ODataMergeResource.java index 2d56cd78e..f9f0326d5 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/odata/ODataMergeResource.java +++ b/src/main/java/io/personium/core/rs/odata/ODataMergeResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.odata; +package io.personium.core.rs.odata; import java.io.Reader; import java.util.ArrayList; @@ -36,10 +36,10 @@ import org.odata4j.edm.EdmEntityType; import org.odata4j.edm.EdmProperty; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.odata.OEntityWrapper; +import io.personium.core.PersoniumCoreException; +import io.personium.core.auth.AccessContext; +import io.personium.core.model.ctl.Common; +import io.personium.core.odata.OEntityWrapper; /** * ODataのEntityリソースのMERGEメソッドを扱うJAX-RS リソース. @@ -70,7 +70,7 @@ public ODataMergeResource(ODataResource odataResource, String entitySetName, Str try { this.oEntityKey = OEntityKey.parse(this.keyString); } catch (IllegalArgumentException e) { - throw DcCoreException.OData.ENTITY_KEY_PARSE_ERROR.reason(e); + throw PersoniumCoreException.OData.ENTITY_KEY_PARSE_ERROR.reason(e); } } diff --git a/src/main/java/com/fujitsu/dc/core/rs/odata/ODataPropertyResource.java b/src/main/java/io/personium/core/rs/odata/ODataPropertyResource.java similarity index 91% rename from src/main/java/com/fujitsu/dc/core/rs/odata/ODataPropertyResource.java rename to src/main/java/io/personium/core/rs/odata/ODataPropertyResource.java index 9bc0da36a..e82c55ee0 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/odata/ODataPropertyResource.java +++ b/src/main/java/io/personium/core/rs/odata/ODataPropertyResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.odata; +package io.personium.core.rs.odata; import java.io.Reader; import java.io.StringWriter; @@ -51,12 +51,12 @@ import org.odata4j.producer.EntityResponse; import org.odata4j.producer.QueryInfo; -import com.fujitsu.dc.common.es.util.DcUUID; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.odata.DcFormatWriterFactory; -import com.fujitsu.dc.core.odata.OEntityWrapper; +import io.personium.common.es.util.PersoniumUUID; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.auth.AccessContext; +import io.personium.core.odata.PersoniumFormatWriterFactory; +import io.personium.core.odata.OEntityWrapper; /** * Navigationプロパティを扱うリソース. @@ -89,7 +89,7 @@ public ODataPropertyResource( EdmEntitySet eSet = getOdataProducer().getMetadata().findEdmEntitySet(this.sourceEntityId.getEntitySetName()); EdmNavigationProperty enp = eSet.getType().findNavigationProperty(this.targetNavProp); if (enp == null) { - throw DcCoreException.OData.NOT_SUCH_NAVPROP; + throw PersoniumCoreException.OData.NOT_SUCH_NAVPROP; } // TargetのEntityKey, EdmEntitySetを準備 EdmEntityType tgtType = enp.getToRole().getType(); @@ -133,7 +133,7 @@ public final Response postEntity( // Entity Responseをレンダー List contentTypes = new ArrayList(); contentTypes.add(outputFormat); - UriInfo resUriInfo = DcCoreUtils.createUriInfo(uriInfo, 2); + UriInfo resUriInfo = PersoniumCoreUtils.createUriInfo(uriInfo, 2); String key = AbstractODataResource.replaceDummyKeyToNull(ent.getEntityKey().toKeyString()); String responseStr = renderEntityResponse(resUriInfo, res, format, contentTypes); @@ -177,7 +177,7 @@ OEntityWrapper createEntityFromInputStream( OEntity newEnt = createRequestEntity(reader, null); // ラッパにくるむ. POSTでIf-Match等 ETagを受け取ることはないのでetagはnull。 - String uuid = DcUUID.randomUUID(); + String uuid = PersoniumUUID.randomUUID(); OEntityWrapper oew = new OEntityWrapper(uuid, newEnt, null); return oew; } @@ -218,7 +218,7 @@ public final Response getNavProperty( this.checkReadAccessContext(); // queryのパース - UriInfo uriInfo2 = DcCoreUtils.createUriInfo(uriInfo, 2); + UriInfo uriInfo2 = PersoniumCoreUtils.createUriInfo(uriInfo, 2); QueryInfo queryInfo = ODataEntitiesResource.queryInfo(uriInfo); // NavigationProperty経由の一覧取得を実行する @@ -233,7 +233,7 @@ public final Response getNavProperty( List acceptableMediaTypes = new ArrayList(); acceptableMediaTypes.add(MediaType.APPLICATION_JSON_TYPE); // TODO 制限事項でQueryは無視するため固定でnullを指定する. - FormatWriter fw = DcFormatWriterFactory.getFormatWriter(EntitiesResponse.class, + FormatWriter fw = PersoniumFormatWriterFactory.getFormatWriter(EntitiesResponse.class, acceptableMediaTypes, null, callback); fw.write(uriInfo2, sw, (EntitiesResponse) response); @@ -257,7 +257,7 @@ public Response options() { // アクセス制御 this.odataResource.checkAccessContext(this.accessContext, this.odataResource.getNecessaryOptionsPrivilege()); - return DcCoreUtils.responseBuilderForOptions( + return PersoniumCoreUtils.responseBuilderForOptions( HttpMethod.GET, HttpMethod.POST ).build(); diff --git a/src/main/java/com/fujitsu/dc/core/rs/odata/ODataResource.java b/src/main/java/io/personium/core/rs/odata/ODataResource.java similarity index 88% rename from src/main/java/com/fujitsu/dc/core/rs/odata/ODataResource.java rename to src/main/java/io/personium/core/rs/odata/ODataResource.java index 3771b7604..5631ea0f0 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/odata/ODataResource.java +++ b/src/main/java/io/personium/core/rs/odata/ODataResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.odata; +package io.personium.core.rs.odata; import java.io.StringWriter; import java.util.Arrays; @@ -44,14 +44,14 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.auth.BoxPrivilege; -import com.fujitsu.dc.core.auth.OAuth2Helper.AcceptableAuthScheme; -import com.fujitsu.dc.core.auth.Privilege; -import com.fujitsu.dc.core.odata.DcODataProducer; -import com.fujitsu.dc.core.odata.OEntityWrapper; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.auth.AccessContext; +import io.personium.core.auth.BoxPrivilege; +import io.personium.core.auth.OAuth2Helper.AcceptableAuthScheme; +import io.personium.core.auth.Privilege; +import io.personium.core.odata.PersoniumODataProducer; +import io.personium.core.odata.OEntityWrapper; /** * OData のサービスを提供する JAX-RS Resource リソースのルート. Unit制御 ・ Cell制御 ・ User OData Schema・ User ODataの4種の用途で使う. @@ -59,7 +59,7 @@ */ public abstract class ODataResource extends ODataCtlResource { - DcODataProducer odataProducer; + PersoniumODataProducer odataProducer; String rootUrl; EdmDataServices metadata; AccessContext accessContext; @@ -76,7 +76,7 @@ public abstract class ODataResource extends ODataCtlResource { * @param producer ODataProducer */ public ODataResource(final AccessContext accessContext, - final String rootUrl, final DcODataProducer producer) { + final String rootUrl, final PersoniumODataProducer producer) { this.accessContext = accessContext; this.odataProducer = producer; this.rootUrl = rootUrl; @@ -146,11 +146,11 @@ public String defineAccessContextSearchContext(AccessContext ac) { * @return JAX-RS Response */ @OPTIONS - @Path("") +// @Path("") public Response optionsRoot() { // アクセス制御 this.checkAccessContext(this.getAccessContext(), BoxPrivilege.READ); - return DcCoreUtils.responseBuilderForOptions( + return PersoniumCoreUtils.responseBuilderForOptions( HttpMethod.GET ).build(); } @@ -160,7 +160,7 @@ public Response optionsRoot() { * @return JAX-RS Response */ protected Response doGetOptionsMetadata() { - return DcCoreUtils.responseBuilderForOptions( + return PersoniumCoreUtils.responseBuilderForOptions( HttpMethod.GET ).build(); } @@ -182,7 +182,7 @@ public ODataBatchResource processBatch() { * @return JAX-RS Response Object */ @GET - @Path("") +// @Path("") public Response getRoot( @Context final UriInfo uriInfo, @QueryParam("$format") final String format, @@ -198,7 +198,7 @@ public Response getRoot( FormatWriter fw = FormatWriterFactory.getFormatWriter(EdmDataServices.class, acceptableMediaTypes, format, ""); - fw.write(DcCoreUtils.createUriInfo(uriInfo, 0), w, this.metadata); + fw.write(PersoniumCoreUtils.createUriInfo(uriInfo, 0), w, this.metadata); return Response.ok(w.toString(), fw.getContentType()) .header(ODataConstants.Headers.DATA_SERVICE_VERSION, ODataConstants.DATA_SERVICE_VERSION_HEADER) @@ -239,7 +239,7 @@ public ODataEntitiesResource entities( // 存在しないエンティティセットを指定されたときは即刻エラー EdmEntitySet eSet = this.metadata.findEdmEntitySet(entitySetName); if (eSet == null) { - throw DcCoreException.OData.NO_SUCH_ENTITY_SET; + throw PersoniumCoreException.OData.NO_SUCH_ENTITY_SET; } String method = request.getMethod(); if (isChangeMethod(method.toUpperCase())) { @@ -263,7 +263,7 @@ public ODataEntityResource entity( // 存在しないエンティティセットを指定されたときは即刻エラー EdmEntitySet eSet = this.getMetadataSource().findEdmEntitySet(entitySetName); if (eSet == null) { - throw DcCoreException.OData.NO_SUCH_ENTITY_SET; + throw PersoniumCoreException.OData.NO_SUCH_ENTITY_SET; } String method = request.getMethod(); if (isChangeMethod(method.toUpperCase())) { @@ -289,7 +289,7 @@ public String getRootUrl() { * このODataサービスのODataProducerを返します. * @return ODataProducer of this OData Service */ - public DcODataProducer getODataProducer() { + public PersoniumODataProducer getODataProducer() { return this.odataProducer; } @@ -309,7 +309,7 @@ public static String parseEtagHeader(final String etagHeaderValue) { Matcher m = pattern.matcher(etagHeaderValue); if (!m.matches()) { - throw DcCoreException.OData.ETAG_NOT_MATCH; + throw PersoniumCoreException.OData.ETAG_NOT_MATCH; } return m.replaceAll("$1"); diff --git a/src/main/java/com/fujitsu/dc/core/rs/odata/QueryParser.java b/src/main/java/io/personium/core/rs/odata/QueryParser.java similarity index 75% rename from src/main/java/com/fujitsu/dc/core/rs/odata/QueryParser.java rename to src/main/java/io/personium/core/rs/odata/QueryParser.java index 209dc31ab..f1d2fed84 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/odata/QueryParser.java +++ b/src/main/java/io/personium/core/rs/odata/QueryParser.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.odata; +package io.personium.core.rs.odata; import java.util.HashMap; import java.util.List; @@ -29,10 +29,10 @@ import org.odata4j.producer.QueryInfo; import org.odata4j.producer.resources.OptionsQueryParser; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.odata.DcOptionsQueryParser; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.Common; +import io.personium.core.odata.PersoniumOptionsQueryParser; import com.sun.jersey.api.uri.UriComponent; /** @@ -53,11 +53,11 @@ public static Integer parseSkipQuery(String query) { try { skip = OptionsQueryParser.parseTop(query); } catch (Exception e) { - throw DcCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.params("$skip").reason(e); + throw PersoniumCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.params("$skip").reason(e); } - if (skip != null && (0 > skip || skip > DcCoreConfig.getSkipQueryMaxSize())) { + if (skip != null && (0 > skip || skip > PersoniumUnitConfig.getSkipQueryMaxSize())) { // Integerでそのまま値を返却すると、カンマが付くため、文字列でエラーメッセージを返却する - throw DcCoreException.OData.QUERY_INVALID_ERROR.params("$skip", skip.toString()); + throw PersoniumCoreException.OData.QUERY_INVALID_ERROR.params("$skip", skip.toString()); } return skip; } @@ -72,11 +72,11 @@ public static Integer parseTopQuery(String query) { try { top = OptionsQueryParser.parseTop(query); } catch (Exception e) { - throw DcCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.params("$top").reason(e); + throw PersoniumCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.params("$top").reason(e); } - if (top != null && (0 > top || top > DcCoreConfig.getTopQueryMaxSize())) { + if (top != null && (0 > top || top > PersoniumUnitConfig.getTopQueryMaxSize())) { // Integerでそのまま値を返却すると、カンマが付くため、文字列でエラーメッセージを返却する - throw DcCoreException.OData.QUERY_INVALID_ERROR.params("$top", top.toString()); + throw PersoniumCoreException.OData.QUERY_INVALID_ERROR.params("$top", top.toString()); } return top; } @@ -90,11 +90,11 @@ public static List parseOderByQuery(String query) { List orderBy = null; try { if (query != null && query.equals("")) { - throw DcCoreException.OData.ORDERBY_PARSE_ERROR; + throw PersoniumCoreException.OData.ORDERBY_PARSE_ERROR; } - orderBy = DcOptionsQueryParser.parseOrderBy(query); + orderBy = PersoniumOptionsQueryParser.parseOrderBy(query); } catch (Exception e) { - throw DcCoreException.OData.ORDERBY_PARSE_ERROR; + throw PersoniumCoreException.OData.ORDERBY_PARSE_ERROR; } return orderBy; } @@ -109,7 +109,7 @@ public static String parseSkipTokenQuery(String query) { try { skipToken = OptionsQueryParser.parseSkipToken(query); } catch (Exception e) { - throw DcCoreException.OData.FILTER_PARSE_ERROR; + throw PersoniumCoreException.OData.FILTER_PARSE_ERROR; } return skipToken; } @@ -128,7 +128,7 @@ public static InlineCount parseInlinecountQuery(String query) { // パースをして有効値以外が返却された場合はパースエラーとする inlineCount = OptionsQueryParser.parseInlineCount(query); if (inlineCount == null) { - throw DcCoreException.OData.INLINECOUNT_PARSE_ERROR.params(query); + throw PersoniumCoreException.OData.INLINECOUNT_PARSE_ERROR.params(query); } } return inlineCount; @@ -142,13 +142,13 @@ public static InlineCount parseInlinecountQuery(String query) { public static List parseExpandQuery(String query) { List expand = null; try { - expand = DcOptionsQueryParser.parseExpand(query); + expand = PersoniumOptionsQueryParser.parseExpand(query); } catch (Exception e) { - throw DcCoreException.OData.EXPAND_PARSE_ERROR; + throw PersoniumCoreException.OData.EXPAND_PARSE_ERROR; } // $expandに指定されたプロパティ数の上限チェック - if (expand != null && expand.size() > DcCoreConfig.getExpandPropertyMaxSizeForList()) { - throw DcCoreException.OData.EXPAND_COUNT_LIMITATION_EXCEEDED; + if (expand != null && expand.size() > PersoniumUnitConfig.getExpandPropertyMaxSizeForList()) { + throw PersoniumCoreException.OData.EXPAND_COUNT_LIMITATION_EXCEEDED; } return expand; } @@ -161,13 +161,13 @@ public static List parseExpandQuery(String query) { public static List parseSelectQuery(String query) { List select = null; if ("".equals(query)) { - throw DcCoreException.OData.SELECT_PARSE_ERROR; + throw PersoniumCoreException.OData.SELECT_PARSE_ERROR; } if (!"*".equals(query)) { try { - select = DcOptionsQueryParser.parseSelect(query); + select = PersoniumOptionsQueryParser.parseSelect(query); } catch (Exception e) { - throw DcCoreException.OData.SELECT_PARSE_ERROR.reason(e); + throw PersoniumCoreException.OData.SELECT_PARSE_ERROR.reason(e); } } return select; @@ -181,9 +181,9 @@ public static List parseSelectQuery(String query) { public static BoolCommonExpression parseFilterQuery(String query) { BoolCommonExpression filter = null; try { - filter = DcOptionsQueryParser.parseFilter(query); + filter = PersoniumOptionsQueryParser.parseFilter(query); } catch (Exception e) { - throw DcCoreException.OData.FILTER_PARSE_ERROR.reason(e); + throw PersoniumCoreException.OData.FILTER_PARSE_ERROR.reason(e); } return filter; } @@ -196,7 +196,7 @@ public static void parseFullTextSearchQuery(String fullTextSearchKeyword) { // 全文検索クエリqのバリデート if (fullTextSearchKeyword != null && (fullTextSearchKeyword.getBytes().length < 1 || fullTextSearchKeyword.getBytes().length > Common.MAX_Q_VALUE_LENGTH)) { - throw DcCoreException.OData.QUERY_INVALID_ERROR.params("q", fullTextSearchKeyword); + throw PersoniumCoreException.OData.QUERY_INVALID_ERROR.params("q", fullTextSearchKeyword); } } @@ -218,9 +218,9 @@ public static QueryInfo createQueryInfo(String requestQuery) { parseFullTextSearchQuery(queryParams.getFirst("q")); // $expand指定時は$topの最大値が変わるためチェックする - if (expand != null && top != null && top > DcCoreConfig.getTopQueryMaxSizeWithExpand()) { + if (expand != null && top != null && top > PersoniumUnitConfig.getTopQueryMaxSizeWithExpand()) { // Integerでそのまま値を返却すると、カンマが付くため、文字列でエラーメッセージを返却する - throw DcCoreException.OData.QUERY_INVALID_ERROR.params("$top", top.toString()); + throw PersoniumCoreException.OData.QUERY_INVALID_ERROR.params("$top", top.toString()); } Map customOptions = new HashMap(); diff --git a/src/main/java/com/fujitsu/dc/core/rs/odata/package-info.java b/src/main/java/io/personium/core/rs/odata/package-info.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/rs/odata/package-info.java rename to src/main/java/io/personium/core/rs/odata/package-info.java index 6cba483e0..4914b57be 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/odata/package-info.java +++ b/src/main/java/io/personium/core/rs/odata/package-info.java @@ -17,4 +17,4 @@ /** * JAX-RS resource classes to provide OData APIs. */ -package com.fujitsu.dc.core.rs.odata; +package io.personium.core.rs.odata; diff --git a/src/main/java/com/fujitsu/dc/core/rs/package-info.java b/src/main/java/io/personium/core/rs/package-info.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/rs/package-info.java rename to src/main/java/io/personium/core/rs/package-info.java index 284fe5688..67a836ed9 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/package-info.java +++ b/src/main/java/io/personium/core/rs/package-info.java @@ -17,5 +17,5 @@ /** * JAX-RS base resource classes. */ -package com.fujitsu.dc.core.rs; +package io.personium.core.rs; diff --git a/src/main/java/com/fujitsu/dc/core/rs/unit/UnitCtlResource.java b/src/main/java/io/personium/core/rs/unit/UnitCtlResource.java similarity index 84% rename from src/main/java/com/fujitsu/dc/core/rs/unit/UnitCtlResource.java rename to src/main/java/io/personium/core/rs/unit/UnitCtlResource.java index 25bd3d078..f69f679db 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/unit/UnitCtlResource.java +++ b/src/main/java/io/personium/core/rs/unit/UnitCtlResource.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.unit; +package io.personium.core.rs.unit; import java.util.Map; @@ -31,26 +31,26 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.es.util.IndexNameEncoder; -import com.fujitsu.dc.core.DcCoreAuthzException; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.auth.OAuth2Helper.AcceptableAuthScheme; -import com.fujitsu.dc.core.auth.Privilege; -import com.fujitsu.dc.core.event.EventUtils; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.BoxCmp; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.CellCmp; -import com.fujitsu.dc.core.model.ModelFactory; -import com.fujitsu.dc.core.model.file.BinaryDataAccessException; -import com.fujitsu.dc.core.model.lock.UnitUserLockManager; -import com.fujitsu.dc.core.odata.OEntityWrapper; -import com.fujitsu.dc.core.rs.odata.ODataResource; +import io.personium.common.es.util.IndexNameEncoder; +import io.personium.core.PersoniumCoreAuthzException; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.auth.AccessContext; +import io.personium.core.auth.OAuth2Helper.AcceptableAuthScheme; +import io.personium.core.auth.Privilege; +import io.personium.core.event.EventUtils; +import io.personium.core.model.Box; +import io.personium.core.model.BoxCmp; +import io.personium.core.model.Cell; +import io.personium.core.model.CellCmp; +import io.personium.core.model.ModelFactory; +import io.personium.core.model.file.BinaryDataAccessException; +import io.personium.core.model.lock.UnitUserLockManager; +import io.personium.core.odata.OEntityWrapper; +import io.personium.core.rs.odata.ODataResource; /** - * Jax-RS Resource handling DC Unit Level Api. + * Jax-RS Resource handling Personium Unit Level Api. */ public class UnitCtlResource extends ODataResource { UriInfo uriInfo; @@ -76,14 +76,14 @@ public UnitCtlResource(AccessContext accessContext, UriInfo uriInfo) { private void checkReferenceMode(AccessContext accessContext) { String unitUserName = accessContext.getSubject(); - String unitPrefix = DcCoreConfig.getEsUnitPrefix(); + String unitPrefix = PersoniumUnitConfig.getEsUnitPrefix(); if (unitUserName == null) { unitUserName = "anon"; } else { unitUserName = IndexNameEncoder.encodeEsIndexName(unitUserName); } if (UnitUserLockManager.hasLockObject(unitPrefix + "_" + unitUserName)) { - throw DcCoreException.Server.SERVICE_MENTENANCE_RESTORE; + throw PersoniumCoreException.Server.SERVICE_MENTENANCE_RESTORE; } } @@ -100,11 +100,11 @@ public void checkAccessContext(AccessContext ac, Privilege privilege) { } else if (AccessContext.TYPE_INVALID.equals(ac.getType())) { ac.throwInvalidTokenException(getAcceptableAuthScheme()); } else if (AccessContext.TYPE_ANONYMOUS.equals(ac.getType())) { - throw DcCoreAuthzException.AUTHORIZATION_REQUIRED.realm(ac.getRealm(), getAcceptableAuthScheme()); + throw PersoniumCoreAuthzException.AUTHORIZATION_REQUIRED.realm(ac.getRealm(), getAcceptableAuthScheme()); } // ユニットマスター、ユニットユーザ、ユニットローカルユニットユーザ以外なら権限エラー - throw DcCoreException.Auth.UNITUSER_ACCESS_REQUIRED; + throw PersoniumCoreException.Auth.UNITUSER_ACCESS_REQUIRED; } /** @@ -172,7 +172,7 @@ public void beforeDelete(final String entitySetName, final OEntityKey oEntityKey // Cell配下が空っぽじゃなければ409エラー if (!cell.isEmpty()) { - throw DcCoreException.OData.CONFLICT_HAS_RELATED; + throw PersoniumCoreException.OData.CONFLICT_HAS_RELATED; } @@ -235,7 +235,7 @@ public void checkAccessContextPerEntity(AccessContext ac, OEntityWrapper oew) { // ユニットユーザトークン、ユニットローカルユニットユーザトークンではオーナーが同じセルに対してのみ操作を許す. // Ownerが空の場合はマスタートークン以外許さない if (owner == null || !owner.equals(ac.getSubject())) { - throw DcCoreException.Auth.NOT_YOURS; + throw PersoniumCoreException.Auth.NOT_YOURS; } } diff --git a/src/main/java/com/fujitsu/dc/core/rs/unit/package-info.java b/src/main/java/io/personium/core/rs/unit/package-info.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/rs/unit/package-info.java rename to src/main/java/io/personium/core/rs/unit/package-info.java index f99fd60f8..0511251c8 100644 --- a/src/main/java/com/fujitsu/dc/core/rs/unit/package-info.java +++ b/src/main/java/io/personium/core/rs/unit/package-info.java @@ -17,4 +17,4 @@ /** * Unit-level JAX-RS resource classes. */ -package com.fujitsu.dc.core.rs.unit; +package io.personium.core.rs.unit; diff --git a/src/main/java/com/fujitsu/dc/core/utils/CacheClient.java b/src/main/java/io/personium/core/utils/CacheClient.java similarity index 95% rename from src/main/java/com/fujitsu/dc/core/utils/CacheClient.java rename to src/main/java/io/personium/core/utils/CacheClient.java index a179a78b1..0d676636a 100644 --- a/src/main/java/com/fujitsu/dc/core/utils/CacheClient.java +++ b/src/main/java/io/personium/core/utils/CacheClient.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.utils; +package io.personium.core.utils; /** * Cache操作用のインタフェースクラス. diff --git a/src/main/java/com/fujitsu/dc/core/utils/EscapeControlCode.java b/src/main/java/io/personium/core/utils/EscapeControlCode.java similarity index 95% rename from src/main/java/com/fujitsu/dc/core/utils/EscapeControlCode.java rename to src/main/java/io/personium/core/utils/EscapeControlCode.java index 34bdd4d3a..d038f6388 100644 --- a/src/main/java/com/fujitsu/dc/core/utils/EscapeControlCode.java +++ b/src/main/java/io/personium/core/utils/EscapeControlCode.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.utils; +package io.personium.core.utils; import java.util.regex.Matcher; import java.util.regex.Pattern; diff --git a/src/main/java/com/fujitsu/dc/core/utils/HttpClientFactory.java b/src/main/java/io/personium/core/utils/HttpClientFactory.java similarity index 96% rename from src/main/java/com/fujitsu/dc/core/utils/HttpClientFactory.java rename to src/main/java/io/personium/core/utils/HttpClientFactory.java index 93e37d436..2068ffc6a 100644 --- a/src/main/java/com/fujitsu/dc/core/utils/HttpClientFactory.java +++ b/src/main/java/io/personium/core/utils/HttpClientFactory.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.utils; +package io.personium.core.utils; import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; diff --git a/src/main/java/com/fujitsu/dc/core/utils/InsecureSSLSocketFactory.java b/src/main/java/io/personium/core/utils/InsecureSSLSocketFactory.java similarity index 96% rename from src/main/java/com/fujitsu/dc/core/utils/InsecureSSLSocketFactory.java rename to src/main/java/io/personium/core/utils/InsecureSSLSocketFactory.java index 82948ac62..4b481e677 100644 --- a/src/main/java/com/fujitsu/dc/core/utils/InsecureSSLSocketFactory.java +++ b/src/main/java/io/personium/core/utils/InsecureSSLSocketFactory.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.utils; +package io.personium.core.utils; import java.io.IOException; import java.net.Socket; diff --git a/src/main/java/com/fujitsu/dc/core/utils/MemcachedClient.java b/src/main/java/io/personium/core/utils/MemcachedClient.java similarity index 82% rename from src/main/java/com/fujitsu/dc/core/utils/MemcachedClient.java rename to src/main/java/io/personium/core/utils/MemcachedClient.java index 63c55b908..e5ecc0e6b 100644 --- a/src/main/java/com/fujitsu/dc/core/utils/MemcachedClient.java +++ b/src/main/java/io/personium/core/utils/MemcachedClient.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.utils; +package io.personium.core.utils; import java.io.IOException; import java.net.InetSocketAddress; @@ -28,8 +28,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreLog; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreLog; /** * 本アプリでのMemcachedアクセスを司るClient. @@ -52,9 +52,9 @@ private MemcachedClient(String host, String port, long opTimeout) { this.spyClient = new net.spy.memcached.MemcachedClient(cfb.build(), addrs); } catch (NumberFormatException e) { - DcCoreLog.Server.MEMCACHED_PORT_FORMAT_ERROR.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.MEMCACHED_PORT_FORMAT_ERROR.params(e.getMessage()).reason(e).writeLog(); } catch (IOException e) { - DcCoreLog.Server.MEMCACHED_CONNECTO_FAIL.params(host, port, e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.MEMCACHED_CONNECTO_FAIL.params(host, port, e.getMessage()).reason(e).writeLog(); } catch (RuntimeException e) { log.info(e.getMessage(), e); throw new MemcachedClientException(e); @@ -97,9 +97,9 @@ public Boolean add(String key, int expiresIn, Object object) { try { return this.spyClient.add(key, expiresIn, object).get(); } catch (InterruptedException e) { - DcCoreLog.Server.MEMCACHED_SET_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.MEMCACHED_SET_FAIL.params(e.getMessage()).reason(e).writeLog(); } catch (ExecutionException e) { - DcCoreLog.Server.MEMCACHED_SET_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.MEMCACHED_SET_FAIL.params(e.getMessage()).reason(e).writeLog(); } catch (RuntimeException e) { log.info(e.getMessage(), e); throw new MemcachedClientException(e); @@ -133,9 +133,9 @@ public Boolean put(String key, int expiresIn, Object object) { return this.spyClient.add(key, expiresIn, object).get(); } } catch (InterruptedException e) { - DcCoreLog.Server.MEMCACHED_SET_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.MEMCACHED_SET_FAIL.params(e.getMessage()).reason(e).writeLog(); } catch (ExecutionException e) { - DcCoreLog.Server.MEMCACHED_SET_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.MEMCACHED_SET_FAIL.params(e.getMessage()).reason(e).writeLog(); } catch (RuntimeException e) { log.info(e.getMessage(), e); throw new MemcachedClientException(e); @@ -150,9 +150,9 @@ public void clear() { try { this.spyClient.flush().get(); } catch (InterruptedException e) { - DcCoreLog.Server.MEMCACHED_CLEAR_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.MEMCACHED_CLEAR_FAIL.params(e.getMessage()).reason(e).writeLog(); } catch (ExecutionException e) { - DcCoreLog.Server.MEMCACHED_CLEAR_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.MEMCACHED_CLEAR_FAIL.params(e.getMessage()).reason(e).writeLog(); } catch (RuntimeException e) { log.info(e.getMessage(), e); throw new MemcachedClientException(e); @@ -168,9 +168,9 @@ public void delete(String key) { try { this.spyClient.delete(key).get(); } catch (InterruptedException e) { - DcCoreLog.Server.MEMCACHED_DELETE_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.MEMCACHED_DELETE_FAIL.params(e.getMessage()).reason(e).writeLog(); } catch (ExecutionException e) { - DcCoreLog.Server.MEMCACHED_DELETE_FAIL.params(e.getMessage()).reason(e).writeLog(); + PersoniumCoreLog.Server.MEMCACHED_DELETE_FAIL.params(e.getMessage()).reason(e).writeLog(); } catch (RuntimeException e) { log.info(e.getMessage(), e); throw new MemcachedClientException(e); @@ -251,15 +251,15 @@ public void deleteLongValue(String key) { static Logger log = LoggerFactory.getLogger(MemcachedClient.class); static { - if ("memcached".equals(DcCoreConfig.getCacheType())) { - cacheClient = new MemcachedClient(DcCoreConfig.getCacheMemcachedHost(), - DcCoreConfig.getCacheMemcachedPort(), - DcCoreConfig.getCacheMemcachedOpTimeout()); + if ("memcached".equals(PersoniumUnitConfig.getCacheType())) { + cacheClient = new MemcachedClient(PersoniumUnitConfig.getCacheMemcachedHost(), + PersoniumUnitConfig.getCacheMemcachedPort(), + PersoniumUnitConfig.getCacheMemcachedOpTimeout()); } - if ("memcached".equals(DcCoreConfig.getLockType())) { - lockClient = new MemcachedClient(DcCoreConfig.getLockMemcachedHost(), - DcCoreConfig.getLockMemcachedPort(), - DcCoreConfig.getLockMemcachedOpTimeout()); + if ("memcached".equals(PersoniumUnitConfig.getLockType())) { + lockClient = new MemcachedClient(PersoniumUnitConfig.getLockMemcachedHost(), + PersoniumUnitConfig.getLockMemcachedPort(), + PersoniumUnitConfig.getLockMemcachedOpTimeout()); } } /** diff --git a/src/main/java/com/fujitsu/dc/core/utils/ODataUtils.java b/src/main/java/io/personium/core/utils/ODataUtils.java similarity index 94% rename from src/main/java/com/fujitsu/dc/core/utils/ODataUtils.java rename to src/main/java/io/personium/core/utils/ODataUtils.java index c391ec3f9..37a026db8 100644 --- a/src/main/java/com/fujitsu/dc/core/utils/ODataUtils.java +++ b/src/main/java/io/personium/core/utils/ODataUtils.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.utils; +package io.personium.core.utils; import java.net.URI; import java.net.URISyntaxException; @@ -34,9 +34,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.model.impl.es.doc.EntitySetDocHandler; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.Common; +import io.personium.core.model.impl.es.doc.EntitySetDocHandler; /** * OData系ユーティリティ関数を集めたクラス. @@ -137,11 +137,11 @@ public static void checkEtag(final String etag, EntitySetDocHandler oedhExisting ifMatchVersion = Long.parseLong(m.replaceAll("$1")); ifMatchUpdated = Long.parseLong(m.replaceAll("$2")); } catch (NumberFormatException e) { - throw DcCoreException.OData.ETAG_NOT_MATCH.reason(e); + throw PersoniumCoreException.OData.ETAG_NOT_MATCH.reason(e); } // バージョンチェック if (ifMatchVersion != oedhExisting.getVersion() || ifMatchUpdated != oedhExisting.getUpdated()) { - throw DcCoreException.OData.ETAG_NOT_MATCH; + throw PersoniumCoreException.OData.ETAG_NOT_MATCH; } } diff --git a/src/main/java/com/fujitsu/dc/core/utils/ResourceUtils.java b/src/main/java/io/personium/core/utils/ResourceUtils.java similarity index 95% rename from src/main/java/com/fujitsu/dc/core/utils/ResourceUtils.java rename to src/main/java/io/personium/core/utils/ResourceUtils.java index 12ae4ec04..d6f98c70f 100644 --- a/src/main/java/com/fujitsu/dc/core/utils/ResourceUtils.java +++ b/src/main/java/io/personium/core/utils/ResourceUtils.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.utils; +package io.personium.core.utils; import java.io.IOException; import java.io.Reader; diff --git a/src/main/java/com/fujitsu/dc/core/utils/UriUtils.java b/src/main/java/io/personium/core/utils/UriUtils.java similarity index 99% rename from src/main/java/com/fujitsu/dc/core/utils/UriUtils.java rename to src/main/java/io/personium/core/utils/UriUtils.java index c1f2b9b79..6af82372a 100644 --- a/src/main/java/com/fujitsu/dc/core/utils/UriUtils.java +++ b/src/main/java/io/personium/core/utils/UriUtils.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.utils; +package io.personium.core.utils; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/com/fujitsu/dc/core/utils/package-info.java b/src/main/java/io/personium/core/utils/package-info.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/utils/package-info.java rename to src/main/java/io/personium/core/utils/package-info.java index e29deaab3..f56b7629d 100644 --- a/src/main/java/com/fujitsu/dc/core/utils/package-info.java +++ b/src/main/java/io/personium/core/utils/package-info.java @@ -17,5 +17,5 @@ /** * utility classes. */ -package com.fujitsu.dc.core.utils; +package io.personium.core.utils; diff --git a/src/main/java/com/fujitsu/dc/core/webcontainer/listener/RepairServiceLauncher.java b/src/main/java/io/personium/core/webcontainer/listener/RepairServiceLauncher.java similarity index 82% rename from src/main/java/com/fujitsu/dc/core/webcontainer/listener/RepairServiceLauncher.java rename to src/main/java/io/personium/core/webcontainer/listener/RepairServiceLauncher.java index decbcaf44..2e689e3ff 100644 --- a/src/main/java/com/fujitsu/dc/core/webcontainer/listener/RepairServiceLauncher.java +++ b/src/main/java/io/personium/core/webcontainer/listener/RepairServiceLauncher.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.webcontainer.listener; +package io.personium.core.webcontainer.listener; import java.io.File; import java.util.concurrent.ScheduledThreadPoolExecutor; @@ -23,10 +23,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.ads.AdsWriteFailureLogException; -import com.fujitsu.dc.common.ads.AdsWriteFailureLogWriter; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.model.impl.es.repair.RepairAds; +import io.personium.common.ads.AdsWriteFailureLogException; +import io.personium.common.ads.AdsWriteFailureLogWriter; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.model.impl.es.repair.RepairAds; /** * Ads書き込み失敗内容をリペアするServiceの定期実行を起動するユーティリティクラス. @@ -43,15 +43,15 @@ public static class RepairAdsService implements Runnable { /** * RepairAdsを起動するか否かを判定するファイルのパス. */ - String invocationFlagFile = DcCoreConfig.getRepairAdsInvocationFilePath(); + String invocationFlagFile = PersoniumUnitConfig.getRepairAdsInvocationFilePath(); @Override public void run() { try { AdsWriteFailureLogWriter adsWriteFailureLogWriter = AdsWriteFailureLogWriter.getInstance( - DcCoreConfig.getAdsWriteFailureLogDir(), - DcCoreConfig.getCoreVersion(), - DcCoreConfig.getAdsWriteFailureLogPhysicalDelete()); + PersoniumUnitConfig.getAdsWriteFailureLogDir(), + PersoniumUnitConfig.getCoreVersion(), + PersoniumUnitConfig.getAdsWriteFailureLogPhysicalDelete()); // 現在出力中のジャーナルログファイルのローテート。 adsWriteFailureLogWriter.rotateActiveFile(); @@ -99,11 +99,11 @@ public RepairServiceLauncher() { // リペアツールの実行をスケジュールする. RepairAdsService service = new RepairAdsService(); executor.scheduleWithFixedDelay(service, - DcCoreConfig.getAdsRepairInitialDelayInSec(), - DcCoreConfig.getAdsRepairIntervalInSec(), + PersoniumUnitConfig.getAdsRepairInitialDelayInSec(), + PersoniumUnitConfig.getAdsRepairIntervalInSec(), TimeUnit.SECONDS); logger.info(String.format("RepairAds scheduled with delay interval %d sec.", - DcCoreConfig.getAdsRepairIntervalInSec())); + PersoniumUnitConfig.getAdsRepairIntervalInSec())); } /** @@ -114,7 +114,7 @@ public void shutdown() { logger.info("Shutting down RepairAds scheduler."); executor.shutdown(); try { - long awaitShutdownInSec = DcCoreConfig.getAdsRepairAwaitShutdownInSec(); + long awaitShutdownInSec = PersoniumUnitConfig.getAdsRepairAwaitShutdownInSec(); logger.info(String.format("Waiting RepairAds termination up to %d sec.", awaitShutdownInSec)); if (executor.awaitTermination(awaitShutdownInSec, TimeUnit.SECONDS)) { logger.info("Completed shutting down RepairAds scheduler."); diff --git a/src/main/java/com/fujitsu/dc/core/webcontainer/listener/WebContainerListenerForAdsRepair.java b/src/main/java/io/personium/core/webcontainer/listener/WebContainerListenerForAdsRepair.java similarity index 92% rename from src/main/java/com/fujitsu/dc/core/webcontainer/listener/WebContainerListenerForAdsRepair.java rename to src/main/java/io/personium/core/webcontainer/listener/WebContainerListenerForAdsRepair.java index b05f152cc..0fa6238a2 100644 --- a/src/main/java/com/fujitsu/dc/core/webcontainer/listener/WebContainerListenerForAdsRepair.java +++ b/src/main/java/io/personium/core/webcontainer/listener/WebContainerListenerForAdsRepair.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.webcontainer.listener; +package io.personium.core.webcontainer.listener; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; diff --git a/src/main/java/com/fujitsu/dc/core/webcontainer/listener/package-info.java b/src/main/java/io/personium/core/webcontainer/listener/package-info.java similarity index 90% rename from src/main/java/com/fujitsu/dc/core/webcontainer/listener/package-info.java rename to src/main/java/io/personium/core/webcontainer/listener/package-info.java index 463272021..915a089db 100644 --- a/src/main/java/com/fujitsu/dc/core/webcontainer/listener/package-info.java +++ b/src/main/java/io/personium/core/webcontainer/listener/package-info.java @@ -14,4 +14,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.webcontainer.listener; +package io.personium.core.webcontainer.listener; diff --git a/src/main/resources/html/authform.html b/src/main/resources/html/authform.html index 40ea5f836..deaa759d8 100644 --- a/src/main/resources/html/authform.html +++ b/src/main/resources/html/authform.html @@ -64,8 +64,8 @@

{3}


- - + + diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml index 6241eb03e..10ffa9666 100644 --- a/src/main/resources/logback.xml +++ b/src/main/resources/logback.xml @@ -26,20 +26,20 @@ - dc1-user.log + personium-user.log - dc1-user.log.%d{yyyy-MM-dd} + personium-core-user.log.%d{yyyy-MM-dd} %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%-5level] %logger{0} %msg%n - dc1-core.log + personium-core.log - dc1-core.log.%d{yyyy-MM-dd} + personium-core.log.%d{yyyy-MM-dd} %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%-5level] %logger{0} %msg%n @@ -58,9 +58,9 @@ - /personium_nfs/dc-core/eventlog/${eventlog_path}/current/default.log - - /personium_nfs/dc-core/eventlog/${eventlog_path}/archive/default.log.%i.zip + /personium_nfs/personium-core/eventlog/${eventlog_path}/current/default.log + + /personium_nfs/personium-core/eventlog/${eventlog_path}/archive/default.log.%i.zip 1 12 @@ -85,13 +85,13 @@ - + - + @@ -107,13 +107,13 @@ - + - + diff --git a/src/main/resources/dc-log-level.properties b/src/main/resources/personium-log-level.properties similarity index 100% rename from src/main/resources/dc-log-level.properties rename to src/main/resources/personium-log-level.properties diff --git a/src/main/resources/dc-messages.properties b/src/main/resources/personium-messages.properties similarity index 97% rename from src/main/resources/dc-messages.properties rename to src/main/resources/personium-messages.properties index e8710638f..614319203 100644 --- a/src/main/resources/dc-messages.properties +++ b/src/main/resources/personium-messages.properties @@ -171,7 +171,7 @@ io.personium.core.msg.PR409-RM-0005=RequestRelation and RequestRelationTarget is # PR400-AU io.personium.core.msg.PR400-AU-0001=Password format is invalid. io.personium.core.msg.PR400-AU-0002=Request parameter is invalid [{0}]. -io.personium.core.msg.PR400-AU-0003=Dc credential required. +io.personium.core.msg.PR400-AU-0003=Personium credential required. # PR401-AU io.personium.core.msg.PR401-AU-0001=Authorization required. @@ -197,7 +197,7 @@ io.personium.core.msg.PR403-AU-0006=Insufficient schema authorization level. ## Authn # PR400-AN io.personium.core.msg.PR400-AN-0001=Unsupported grant type. -io.personium.core.msg.PR400-AN-0002=Invalid dc_target. +io.personium.core.msg.PR400-AN-0002=Invalid p_target. # client authn error io.personium.core.msg.PR400-AN-0003=Failed to parse client secret. @@ -242,7 +242,7 @@ io.personium.core.msg.PR500-AN-0001=Root ca certificate setting error. ## Event # PR400-EV io.personium.core.msg.PR400-EV-0001=JSON parse error. -io.personium.core.msg.PR400-EV-0002=Request header is invalid [X-Dc-RequestKey]. +io.personium.core.msg.PR400-EV-0002=Request header is invalid [X-Personium-RequestKey]. io.personium.core.msg.PR400-EV-0003=[{0}] is required. io.personium.core.msg.PR400-EV-0004=[{0}] field format error. diff --git a/src/main/resources/dc-config-default.properties b/src/main/resources/personium-unit-config-default.properties similarity index 86% rename from src/main/resources/dc-config-default.properties rename to src/main/resources/personium-unit-config-default.properties index a725ce1a3..afef81a23 100644 --- a/src/main/resources/dc-config-default.properties +++ b/src/main/resources/personium-unit-config-default.properties @@ -16,10 +16,10 @@ # ################################################# -#dc-core default configurations +# personium-core default configurations # # DO NOT CHANGE CONFIGURATIONS BELOW. -# USE "dc-config.properties" TO CHANGE CONFIGURATIONS. +# USE "personium-unit-config.properties" TO CHANGE CONFIGURATIONS. ################################################# # core version @@ -30,13 +30,13 @@ io.personium.core.unitUser.issuers= io.personium.core.unitScheme=http # status check -io.personium.core.status.requestProxyUrl=http://localhost:8080/dc1-core/ +io.personium.core.status.requestProxyUrl=http://localhost:8080/personium-core/ # engine configurations io.personium.core.engine.enabled=true io.personium.core.engine.host=localhost io.personium.core.engine.port=8080 -io.personium.core.engine.path=dc1-engine +io.personium.core.engine.path=personium-engine # lock general configurations (set milliseconds) io.personium.core.lock.retry.times=50 @@ -80,7 +80,7 @@ io.personium.core.binaryData.dav.retry.count=100 io.personium.core.binaryData.dav.retry.interval=50 # blob store configurations io.personium.core.blobStore.type=fs -io.personium.core.blobStore.root=/personium_nfs/dc-core/dav +io.personium.core.blobStore.root=/personium_nfs/personium-core/dav # elasticsearch configurations io.personium.core.es.hosts=localhost:9300 @@ -96,17 +96,17 @@ io.personium.core.es.routingFlag=true io.personium.core.es.ads.repair.initialDelayInSec=120 io.personium.core.es.ads.repair.intervalInSec=60 io.personium.core.es.ads.repair.awaitShutdownInSec=600 -io.personium.core.es.ads.repair.invocationFlagFile=/personium/dc-core/invokeRepair +io.personium.core.es.ads.repair.invocationFlagFile=/personium/personium-core/invokeRepair # log configurations for authentic data store -io.personium.core.es.ads.log.dir=/personium/dc-core/ads +io.personium.core.es.ads.log.dir=/personium/personium-core/ads io.personium.core.es.ads.physical.delete=true io.personium.core.es.ads.log.count.iteration=100 # security configurations -# You must set these properties to dc-config.properties file. +# You must set these properties to personium-unit-config.properties file. io.personium.core.masterToken=personium.io -#io.personium.core.security.sercret16=changeme +#io.personium.core.security.secret16=changeme #io.personium.core.security.auth.password.salt=changeme # X509 Certificate file in PEM format @@ -153,11 +153,11 @@ io.personium.core.bar.file.maxSize=100 io.personium.core.bar.entry.maxSize=10 io.personium.core.bar.userdata.linksOutputStreamSize=5 io.personium.core.bar.userdata.bulkSize=1000 -io.personium.core.bar.installfile.dir=/personium_nfs/dc-core/barInstall +io.personium.core.bar.installfile.dir=/personium_nfs/personium-core/barInstall io.personium.core.bar.progress.expireInSec=259200 # event log file directory -io.personium.core.event.log.current.dir=/personium_nfs/dc-core/eventlog +io.personium.core.event.log.current.dir=/personium_nfs/personium-core/eventlog # Account configrations io.personium.core.account.lastauthenticated.enabled=true diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index c2f3a3f1e..a8c84b713 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -21,27 +21,27 @@ xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> - dc1-core + personium-core - com.fujitsu.dc.core.webcontainer.listener.WebContainerListenerForAdsRepair + io.personium.core.webcontainer.listener.WebContainerListenerForAdsRepair - DcCoreApp + PersoniumCoreApp com.sun.jersey.spi.container.servlet.ServletContainer javax.ws.rs.Application - com.fujitsu.dc.core.rs.DcCoreApplication + io.personium.core.rs.PersoniumCoreApplication com.sun.jersey.spi.container.ContainerRequestFilters - com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter + io.personium.core.jersey.filter.PersoniumCoreContainerFilter com.sun.jersey.spi.container.ContainerResponseFilters - com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter + io.personium.core.jersey.filter.PersoniumCoreContainerFilter com.sun.jersey.config.feature.DisableWADL @@ -50,7 +50,7 @@ 1 - DcCoreApp + PersoniumCoreApp /* \ No newline at end of file diff --git a/src/test/java/com/fujitsu/dc/core/DcCoreExceptionTest.java b/src/test/java/com/fujitsu/dc/core/DcCoreExceptionTest.java deleted file mode 100644 index c16ecd59d..000000000 --- a/src/test/java/com/fujitsu/dc/core/DcCoreExceptionTest.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * personium.io - * Copyright 2014 FUJITSU LIMITED - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.fujitsu.dc.core; - -import org.junit.Assert; -import org.junit.Test; -import org.junit.experimental.categories.Category; -import org.junit.runner.RunWith; - -import com.fujitsu.dc.core.DcCoreMessageUtils.Severity; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; - - -/** - * URLの作成の組立を行う関数群. - */ -@RunWith(DcRunner.class) -@Category({ Unit.class }) -public final class DcCoreExceptionTest { - - /** - * 例外発生時のメッセージ生成のテスト. - */ - @Test - public void 例外発生時のメッセージ生成のテスト() { - try { - throw DcCoreException.OData.JSON_PARSE_ERROR; - } catch (DcCoreException e) { - Assert.assertEquals("JSON parse error.", e.getMessage()); - } - } - - /** - * レスポンスコードからログレベル判定処理. - */ - @Test - public void レスポンスコードからログレベル判定処理() { - // 400系はINFO - Assert.assertEquals(Severity.INFO, DcCoreException.decideSeverity(400)); - Assert.assertEquals(Severity.INFO, DcCoreException.decideSeverity(401)); - Assert.assertEquals(Severity.INFO, DcCoreException.decideSeverity(405)); - Assert.assertEquals(Severity.INFO, DcCoreException.decideSeverity(412)); - Assert.assertEquals(Severity.INFO, DcCoreException.decideSeverity(499)); - - // 500系はWARN - Assert.assertEquals(Severity.WARN, DcCoreException.decideSeverity(500)); - Assert.assertEquals(Severity.WARN, DcCoreException.decideSeverity(502)); - Assert.assertEquals(Severity.WARN, DcCoreException.decideSeverity(505)); - Assert.assertEquals(Severity.WARN, DcCoreException.decideSeverity(512)); - Assert.assertEquals(Severity.WARN, DcCoreException.decideSeverity(599)); - - // 400以下はWARN - Assert.assertEquals(Severity.WARN, DcCoreException.decideSeverity(399)); - Assert.assertEquals(Severity.WARN, DcCoreException.decideSeverity(302)); - Assert.assertEquals(Severity.WARN, DcCoreException.decideSeverity(300)); - Assert.assertEquals(Severity.WARN, DcCoreException.decideSeverity(201)); - Assert.assertEquals(Severity.WARN, DcCoreException.decideSeverity(200)); - } - - /** - * メッセージコードのフォーマット異常. - */ - @Test(expected = IllegalArgumentException.class) - public void メッセージコードのフォーマット異常時に実行時例外が発生すること() { - DcCoreException.create("UNKNOWN"); - } -} diff --git a/src/test/java/com/fujitsu/dc/test/IntegrationTests.java b/src/test/java/com/fujitsu/dc/test/IntegrationTests.java deleted file mode 100644 index c2e19f5a5..000000000 --- a/src/test/java/com/fujitsu/dc/test/IntegrationTests.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * personium.io - * Copyright 2014 FUJITSU LIMITED - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.fujitsu.dc.test; - -import junit.framework.TestSuite; - -import org.junit.experimental.categories.Categories; -import org.junit.experimental.categories.Categories.IncludeCategory; -import org.junit.runner.RunWith; -import org.junit.runners.Suite.SuiteClasses; - -import com.fujitsu.dc.test.categories.Integration; - -/** - * 結合テスト用テストスイート. - */ -@RunWith(Categories.class) -@SuiteClasses({ - com.fujitsu.dc.core.AllTests.class, - com.fujitsu.dc.core.model.file.AllTests.class, - com.fujitsu.dc.core.model.impl.es.AllTests.class, - com.fujitsu.dc.core.model.impl.es.accessor.AllTests.class, - com.fujitsu.dc.core.model.impl.es.ads.AllTests.class, - com.fujitsu.dc.core.model.lock.AllTests.class, - com.fujitsu.dc.core.rs.AllTests.class, - com.fujitsu.dc.test.jersey.AllTests.class, - com.fujitsu.dc.test.jersey.bar.AllTests.class, - com.fujitsu.dc.test.jersey.box.AllTests.class, - com.fujitsu.dc.test.jersey.box.odatacol.AllTests.class, - com.fujitsu.dc.test.jersey.box.odatacol.schema.assocend.AllTests.class, - com.fujitsu.dc.test.jersey.box.odatacol.schema.complextype.AllTests.class, - com.fujitsu.dc.test.jersey.box.odatacol.schema.complextypeproperty.AllTests.class, - com.fujitsu.dc.test.jersey.box.odatacol.schema.entitytype.AllTests.class, - com.fujitsu.dc.test.jersey.box.odatacol.schema.property.AllTests.class, - com.fujitsu.dc.test.jersey.cell.AllTests.class, - com.fujitsu.dc.test.jersey.cell.auth.AllTests.class, - com.fujitsu.dc.test.jersey.cell.auth.token.AllTests.class, - com.fujitsu.dc.test.jersey.cell.ctl.AllTests.class, - com.fujitsu.dc.test.jersey.concurrent.AllTests.class, - com.fujitsu.dc.test.performance.box.odatacol.AllTests.class, - com.fujitsu.dc.test.unit.core.AllTests.class, - com.fujitsu.dc.test.unit.core.auth.AllTests.class, - com.fujitsu.dc.test.unit.core.bar.AllTests.class, - com.fujitsu.dc.test.unit.core.jersey.filter.AllTests.class, - com.fujitsu.dc.test.unit.core.model.AllTests.class, - com.fujitsu.dc.test.unit.core.model.impl.es.AllTests.class, - com.fujitsu.dc.test.unit.core.model.impl.es.doc.AllTests.class, - com.fujitsu.dc.test.unit.core.model.impl.es.odata.AllTests.class, - com.fujitsu.dc.test.unit.core.rs.odata.AllTests.class, - com.fujitsu.dc.test.unit.core.rs.odata.validate.AllTests.class -}) -@IncludeCategory(Integration.class) -public class IntegrationTests extends TestSuite { -} diff --git a/src/test/java/com/fujitsu/dc/test/PerformanceTests.java b/src/test/java/com/fujitsu/dc/test/PerformanceTests.java deleted file mode 100644 index bf05118a9..000000000 --- a/src/test/java/com/fujitsu/dc/test/PerformanceTests.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * personium.io - * Copyright 2014 FUJITSU LIMITED - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.fujitsu.dc.test; - -import junit.framework.TestSuite; - -import org.junit.experimental.categories.Categories; -import org.junit.experimental.categories.Categories.IncludeCategory; -import org.junit.runner.RunWith; -import org.junit.runners.Suite.SuiteClasses; - -import com.fujitsu.dc.test.categories.Performance; - -/** - * 結合テスト用テストスイート. - */ -@RunWith(Categories.class) -@SuiteClasses({ - com.fujitsu.dc.core.AllTests.class, - com.fujitsu.dc.core.model.file.AllTests.class, - com.fujitsu.dc.core.model.impl.es.AllTests.class, - com.fujitsu.dc.core.model.impl.es.accessor.AllTests.class, - com.fujitsu.dc.core.model.impl.es.ads.AllTests.class, - com.fujitsu.dc.core.model.lock.AllTests.class, - com.fujitsu.dc.core.rs.AllTests.class, - com.fujitsu.dc.test.jersey.AllTests.class, - com.fujitsu.dc.test.jersey.bar.AllTests.class, - com.fujitsu.dc.test.jersey.box.AllTests.class, - com.fujitsu.dc.test.jersey.box.odatacol.AllTests.class, - com.fujitsu.dc.test.jersey.box.odatacol.schema.assocend.AllTests.class, - com.fujitsu.dc.test.jersey.box.odatacol.schema.complextype.AllTests.class, - com.fujitsu.dc.test.jersey.box.odatacol.schema.complextypeproperty.AllTests.class, - com.fujitsu.dc.test.jersey.box.odatacol.schema.entitytype.AllTests.class, - com.fujitsu.dc.test.jersey.box.odatacol.schema.property.AllTests.class, - com.fujitsu.dc.test.jersey.cell.AllTests.class, - com.fujitsu.dc.test.jersey.cell.auth.AllTests.class, - com.fujitsu.dc.test.jersey.cell.auth.token.AllTests.class, - com.fujitsu.dc.test.jersey.cell.ctl.AllTests.class, - com.fujitsu.dc.test.jersey.concurrent.AllTests.class, - com.fujitsu.dc.test.performance.box.odatacol.AllTests.class, - com.fujitsu.dc.test.unit.core.AllTests.class, - com.fujitsu.dc.test.unit.core.auth.AllTests.class, - com.fujitsu.dc.test.unit.core.bar.AllTests.class, - com.fujitsu.dc.test.unit.core.jersey.filter.AllTests.class, - com.fujitsu.dc.test.unit.core.model.AllTests.class, - com.fujitsu.dc.test.unit.core.model.impl.es.AllTests.class, - com.fujitsu.dc.test.unit.core.model.impl.es.doc.AllTests.class, - com.fujitsu.dc.test.unit.core.model.impl.es.odata.AllTests.class, - com.fujitsu.dc.test.unit.core.rs.odata.AllTests.class, - com.fujitsu.dc.test.unit.core.rs.odata.validate.AllTests.class -}) -@IncludeCategory(Performance.class) -public class PerformanceTests extends TestSuite { -} diff --git a/src/test/java/com/fujitsu/dc/test/RegressionTests.java b/src/test/java/com/fujitsu/dc/test/RegressionTests.java deleted file mode 100644 index bd9362065..000000000 --- a/src/test/java/com/fujitsu/dc/test/RegressionTests.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * personium.io - * Copyright 2014 FUJITSU LIMITED - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.fujitsu.dc.test; - -import junit.framework.TestSuite; - -import org.junit.experimental.categories.Categories; -import org.junit.experimental.categories.Categories.IncludeCategory; -import org.junit.runner.RunWith; -import org.junit.runners.Suite.SuiteClasses; - -import com.fujitsu.dc.test.categories.Regression; - -/** - * 結合テスト用テストスイート. - */ -@RunWith(Categories.class) -@SuiteClasses({ - com.fujitsu.dc.core.AllTests.class, - com.fujitsu.dc.core.model.file.AllTests.class, - com.fujitsu.dc.core.model.impl.es.AllTests.class, - com.fujitsu.dc.core.model.impl.es.accessor.AllTests.class, - com.fujitsu.dc.core.model.impl.es.ads.AllTests.class, - com.fujitsu.dc.core.model.lock.AllTests.class, - com.fujitsu.dc.core.rs.AllTests.class, - com.fujitsu.dc.test.jersey.AllTests.class, - com.fujitsu.dc.test.jersey.bar.AllTests.class, - com.fujitsu.dc.test.jersey.box.AllTests.class, - com.fujitsu.dc.test.jersey.box.odatacol.AllTests.class, - com.fujitsu.dc.test.jersey.box.odatacol.schema.assocend.AllTests.class, - com.fujitsu.dc.test.jersey.box.odatacol.schema.complextype.AllTests.class, - com.fujitsu.dc.test.jersey.box.odatacol.schema.complextypeproperty.AllTests.class, - com.fujitsu.dc.test.jersey.box.odatacol.schema.entitytype.AllTests.class, - com.fujitsu.dc.test.jersey.box.odatacol.schema.property.AllTests.class, - com.fujitsu.dc.test.jersey.cell.AllTests.class, - com.fujitsu.dc.test.jersey.cell.auth.AllTests.class, - com.fujitsu.dc.test.jersey.cell.auth.token.AllTests.class, - com.fujitsu.dc.test.jersey.cell.ctl.AllTests.class, - com.fujitsu.dc.test.jersey.concurrent.AllTests.class, - com.fujitsu.dc.test.performance.box.odatacol.AllTests.class, - com.fujitsu.dc.test.unit.core.AllTests.class, - com.fujitsu.dc.test.unit.core.auth.AllTests.class, - com.fujitsu.dc.test.unit.core.bar.AllTests.class, - com.fujitsu.dc.test.unit.core.jersey.filter.AllTests.class, - com.fujitsu.dc.test.unit.core.model.AllTests.class, - com.fujitsu.dc.test.unit.core.model.impl.es.AllTests.class, - com.fujitsu.dc.test.unit.core.model.impl.es.doc.AllTests.class, - com.fujitsu.dc.test.unit.core.model.impl.es.odata.AllTests.class, - com.fujitsu.dc.test.unit.core.rs.odata.AllTests.class, - com.fujitsu.dc.test.unit.core.rs.odata.validate.AllTests.class -}) -@IncludeCategory(Regression.class) -public class RegressionTests extends TestSuite { -} diff --git a/src/test/java/com/fujitsu/dc/test/UnitTests.java b/src/test/java/com/fujitsu/dc/test/UnitTests.java deleted file mode 100644 index 55eee7f0a..000000000 --- a/src/test/java/com/fujitsu/dc/test/UnitTests.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * personium.io - * Copyright 2014 FUJITSU LIMITED - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.fujitsu.dc.test; - -import junit.framework.TestSuite; - -import org.junit.experimental.categories.Categories; -import org.junit.experimental.categories.Categories.IncludeCategory; -import org.junit.runner.RunWith; -import org.junit.runners.Suite.SuiteClasses; - -import com.fujitsu.dc.test.categories.Integration; - -/** - * 結合テスト用テストスイート. - */ -@RunWith(Categories.class) -@SuiteClasses({ - com.fujitsu.dc.core.AllTests.class, - com.fujitsu.dc.core.model.file.AllTests.class, - com.fujitsu.dc.core.model.impl.es.AllTests.class, - com.fujitsu.dc.core.model.impl.es.accessor.AllTests.class, - com.fujitsu.dc.core.model.impl.es.ads.AllTests.class, - com.fujitsu.dc.core.model.lock.AllTests.class, - com.fujitsu.dc.core.odata.AllTests.class, - com.fujitsu.dc.core.rs.odata.AllTests.class, - com.fujitsu.dc.core.rs.AllTests.class, - com.fujitsu.dc.core.utils.AllTests.class, - com.fujitsu.dc.test.jersey.AllTests.class, - com.fujitsu.dc.test.jersey.bar.AllTests.class, - com.fujitsu.dc.test.jersey.box.AllTests.class, - com.fujitsu.dc.test.jersey.box.odatacol.AllTests.class, - com.fujitsu.dc.test.jersey.box.odatacol.schema.assocend.AllTests.class, - com.fujitsu.dc.test.jersey.box.odatacol.schema.complextype.AllTests.class, - com.fujitsu.dc.test.jersey.box.odatacol.schema.complextypeproperty.AllTests.class, - com.fujitsu.dc.test.jersey.box.odatacol.schema.entitytype.AllTests.class, - com.fujitsu.dc.test.jersey.box.odatacol.schema.property.AllTests.class, - com.fujitsu.dc.test.jersey.cell.AllTests.class, - com.fujitsu.dc.test.jersey.cell.auth.AllTests.class, - com.fujitsu.dc.test.jersey.cell.auth.token.AllTests.class, - com.fujitsu.dc.test.jersey.cell.ctl.AllTests.class, - com.fujitsu.dc.test.jersey.concurrent.AllTests.class, - com.fujitsu.dc.test.performance.box.odatacol.AllTests.class, - com.fujitsu.dc.test.unit.core.AllTests.class, - com.fujitsu.dc.test.unit.core.auth.AllTests.class, - com.fujitsu.dc.test.unit.core.bar.AllTests.class, - com.fujitsu.dc.test.unit.core.jersey.filter.AllTests.class, - com.fujitsu.dc.test.unit.core.model.AllTests.class, - com.fujitsu.dc.test.unit.core.model.impl.es.AllTests.class, - com.fujitsu.dc.test.unit.core.model.impl.es.doc.AllTests.class, - com.fujitsu.dc.test.unit.core.model.impl.es.odata.AllTests.class, - com.fujitsu.dc.test.unit.core.rs.odata.AllTests.class, - com.fujitsu.dc.test.unit.core.rs.odata.validate.AllTests.class -}) -@IncludeCategory(Integration.class) -public class UnitTests extends TestSuite { -} diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/AllTests.java b/src/test/java/com/fujitsu/dc/test/unit/core/AllTests.java deleted file mode 100644 index da5e03807..000000000 --- a/src/test/java/com/fujitsu/dc/test/unit/core/AllTests.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * personium.io - * Copyright 2014 FUJITSU LIMITED - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.fujitsu.dc.test.unit.core; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -/** - * パッケージ配下のテストケースを全て実行するためのテストスイート. - */ -@RunWith(Suite.class) -@SuiteClasses({ - DcCoreConfigTest.class - }) -public class AllTests { -} diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/exceptions/package-info.java b/src/test/java/com/fujitsu/dc/test/unit/core/exceptions/package-info.java deleted file mode 100644 index 22066a348..000000000 --- a/src/test/java/com/fujitsu/dc/test/unit/core/exceptions/package-info.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * personium.io - * Copyright 2014 FUJITSU LIMITED - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * JUnit test. - */ -package com.fujitsu.dc.test.unit.core.exceptions; - diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/jersey/filter/AllTests.java b/src/test/java/com/fujitsu/dc/test/unit/core/jersey/filter/AllTests.java deleted file mode 100644 index 755048fbc..000000000 --- a/src/test/java/com/fujitsu/dc/test/unit/core/jersey/filter/AllTests.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * personium.io - * Copyright 2014 FUJITSU LIMITED - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.fujitsu.dc.test.unit.core.jersey.filter; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -/** - * パッケージ配下のテストケースを全て実行するためのテストスイート. - */ -@RunWith(Suite.class) -@SuiteClasses({ - DcCoreContainerFilterTest.class - }) -public class AllTests { -} diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/jersey/filter/package-info.java b/src/test/java/com/fujitsu/dc/test/unit/core/jersey/filter/package-info.java deleted file mode 100644 index 34beff764..000000000 --- a/src/test/java/com/fujitsu/dc/test/unit/core/jersey/filter/package-info.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * personium.io - * Copyright 2014 FUJITSU LIMITED - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * JUnit test. - */ -package com.fujitsu.dc.test.unit.core.jersey.filter; - diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/doc/package-info.java b/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/doc/package-info.java deleted file mode 100644 index fc3db9d34..000000000 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/doc/package-info.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * personium.io - * Copyright 2014 FUJITSU LIMITED - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * JUnit test. - */ -package com.fujitsu.dc.test.unit.core.model.impl.es.doc; - diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/odata/package-info.java b/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/odata/package-info.java deleted file mode 100644 index e138781a4..000000000 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/odata/package-info.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * personium.io - * Copyright 2014 FUJITSU LIMITED - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * JUnit test. - */ -package com.fujitsu.dc.test.unit.core.model.impl.es.odata; - diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/package-info.java b/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/package-info.java deleted file mode 100644 index 70d54484d..000000000 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/package-info.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * personium.io - * Copyright 2014 FUJITSU LIMITED - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * JUnit test. - */ -package com.fujitsu.dc.test.unit.core.model.impl.es; - diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/lock/package-info.java b/src/test/java/com/fujitsu/dc/test/unit/core/model/lock/package-info.java deleted file mode 100644 index 3f61ca420..000000000 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/lock/package-info.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * personium.io - * Copyright 2014 FUJITSU LIMITED - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * JUnit test. - */ -package com.fujitsu.dc.test.unit.core.model.lock; - diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/package-info.java b/src/test/java/com/fujitsu/dc/test/unit/core/model/package-info.java deleted file mode 100644 index a16e37a44..000000000 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/package-info.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * personium.io - * Copyright 2014 FUJITSU LIMITED - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * JUnit test. - */ -package com.fujitsu.dc.test.unit.core.model; - diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/progress/package-info.java b/src/test/java/com/fujitsu/dc/test/unit/core/model/progress/package-info.java deleted file mode 100644 index 23f4aa085..000000000 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/progress/package-info.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * personium.io - * Copyright 2014 FUJITSU LIMITED - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * JUnit test. - */ -package com.fujitsu.dc.test.unit.core.model.progress; - diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/odata/AllTests.java b/src/test/java/com/fujitsu/dc/test/unit/core/odata/AllTests.java deleted file mode 100644 index d9f2899ed..000000000 --- a/src/test/java/com/fujitsu/dc/test/unit/core/odata/AllTests.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * personium.io - * Copyright 2014 FUJITSU LIMITED - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.fujitsu.dc.test.unit.core.odata; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -/** - * パッケージ配下のテストケースを全て実行するためのテストスイート. - */ -@RunWith(Suite.class) -@SuiteClasses({ - DcExpressionParserTest.class - }) -public class AllTests { -} diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/odata/package-info.java b/src/test/java/com/fujitsu/dc/test/unit/core/odata/package-info.java deleted file mode 100644 index 0f127c561..000000000 --- a/src/test/java/com/fujitsu/dc/test/unit/core/odata/package-info.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * personium.io - * Copyright 2014 FUJITSU LIMITED - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * JUnit test. - */ -package com.fujitsu.dc.test.unit.core.odata; - diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/rs/odata/package-info.java b/src/test/java/com/fujitsu/dc/test/unit/core/rs/odata/package-info.java deleted file mode 100644 index b9043d013..000000000 --- a/src/test/java/com/fujitsu/dc/test/unit/core/rs/odata/package-info.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * personium.io - * Copyright 2014 FUJITSU LIMITED - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * JUnit test. - */ -package com.fujitsu.dc.test.unit.core.rs.odata; - diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/rs/odata/validate/package-info.java b/src/test/java/com/fujitsu/dc/test/unit/core/rs/odata/validate/package-info.java deleted file mode 100644 index 80d7cac26..000000000 --- a/src/test/java/com/fujitsu/dc/test/unit/core/rs/odata/validate/package-info.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * personium.io - * Copyright 2014 FUJITSU LIMITED - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * JUnit test. - */ -package com.fujitsu.dc.test.unit.core.rs.odata.validate; - diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/rs/unit/package-info.java b/src/test/java/com/fujitsu/dc/test/unit/core/rs/unit/package-info.java deleted file mode 100644 index 27e724483..000000000 --- a/src/test/java/com/fujitsu/dc/test/unit/core/rs/unit/package-info.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * personium.io - * Copyright 2014 FUJITSU LIMITED - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * JUnit test. - */ -package com.fujitsu.dc.test.unit.core.rs.unit; - diff --git a/src/test/java/io/personium/core/AllTests.java b/src/test/java/io/personium/core/AllTests.java new file mode 100644 index 000000000..f824e26a1 --- /dev/null +++ b/src/test/java/io/personium/core/AllTests.java @@ -0,0 +1,32 @@ +/** + * personium.io + * Copyright 2014 FUJITSU LIMITED + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.personium.core; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; +import org.junit.runners.Suite.SuiteClasses; + +/** + * パッケージ配下のテストケースを全て実行するためのテストスイート. + */ +@RunWith(Suite.class) +@SuiteClasses({ + PersoniumCoreExceptionTest.class, + PersoniumCoreLogTest.class + }) +public class AllTests { +} diff --git a/src/test/java/io/personium/core/PersoniumCoreExceptionTest.java b/src/test/java/io/personium/core/PersoniumCoreExceptionTest.java new file mode 100644 index 000000000..7d9c420e7 --- /dev/null +++ b/src/test/java/io/personium/core/PersoniumCoreExceptionTest.java @@ -0,0 +1,82 @@ +/** + * personium.io + * Copyright 2014 FUJITSU LIMITED + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.personium.core; + +import org.junit.Assert; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.junit.runner.RunWith; + +import io.personium.core.PersoniumCoreMessageUtils.Severity; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; + + +/** + * URLの作成の組立を行う関数群. + */ +@RunWith(PersoniumIntegTestRunner.class) +@Category({ Unit.class }) +public final class PersoniumCoreExceptionTest { + + /** + * 例外発生時のメッセージ生成のテスト. + */ + @Test + public void 例外発生時のメッセージ生成のテスト() { + try { + throw PersoniumCoreException.OData.JSON_PARSE_ERROR; + } catch (PersoniumCoreException e) { + Assert.assertEquals("JSON parse error.", e.getMessage()); + } + } + + /** + * レスポンスコードからログレベル判定処理. + */ + @Test + public void レスポンスコードからログレベル判定処理() { + // 400系はINFO + Assert.assertEquals(Severity.INFO, PersoniumCoreException.decideSeverity(400)); + Assert.assertEquals(Severity.INFO, PersoniumCoreException.decideSeverity(401)); + Assert.assertEquals(Severity.INFO, PersoniumCoreException.decideSeverity(405)); + Assert.assertEquals(Severity.INFO, PersoniumCoreException.decideSeverity(412)); + Assert.assertEquals(Severity.INFO, PersoniumCoreException.decideSeverity(499)); + + // 500系はWARN + Assert.assertEquals(Severity.WARN, PersoniumCoreException.decideSeverity(500)); + Assert.assertEquals(Severity.WARN, PersoniumCoreException.decideSeverity(502)); + Assert.assertEquals(Severity.WARN, PersoniumCoreException.decideSeverity(505)); + Assert.assertEquals(Severity.WARN, PersoniumCoreException.decideSeverity(512)); + Assert.assertEquals(Severity.WARN, PersoniumCoreException.decideSeverity(599)); + + // 400以下はWARN + Assert.assertEquals(Severity.WARN, PersoniumCoreException.decideSeverity(399)); + Assert.assertEquals(Severity.WARN, PersoniumCoreException.decideSeverity(302)); + Assert.assertEquals(Severity.WARN, PersoniumCoreException.decideSeverity(300)); + Assert.assertEquals(Severity.WARN, PersoniumCoreException.decideSeverity(201)); + Assert.assertEquals(Severity.WARN, PersoniumCoreException.decideSeverity(200)); + } + + /** + * メッセージコードのフォーマット異常. + */ + @Test(expected = IllegalArgumentException.class) + public void メッセージコードのフォーマット異常時に実行時例外が発生すること() { + PersoniumCoreException.create("UNKNOWN"); + } +} diff --git a/src/test/java/com/fujitsu/dc/core/DcCoreLogTest.java b/src/test/java/io/personium/core/PersoniumCoreLogTest.java similarity index 87% rename from src/test/java/com/fujitsu/dc/core/DcCoreLogTest.java rename to src/test/java/io/personium/core/PersoniumCoreLogTest.java index 1d1be8124..ac875b81d 100644 --- a/src/test/java/com/fujitsu/dc/core/DcCoreLogTest.java +++ b/src/test/java/io/personium/core/PersoniumCoreLogTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core; +package io.personium.core; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -28,18 +28,18 @@ import org.slf4j.LoggerFactory; import org.slf4j.Marker; -import com.fujitsu.dc.core.DcCoreMessageUtils.Severity; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; +import io.personium.core.PersoniumCoreMessageUtils.Severity; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; /** * EsModelの単体テストケース. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({ Unit.class }) -public class DcCoreLogTest { - static Logger log = LoggerFactory.getLogger(DcCoreLog.class); +public class PersoniumCoreLogTest { + static Logger log = LoggerFactory.getLogger(PersoniumCoreLog.class); // ロガー差し替えをするので、ここに避難させておく. static Logger shelterdLogger; /** @@ -47,14 +47,14 @@ public class DcCoreLogTest { */ @BeforeClass public static void beforeClass() { - shelterdLogger = DcCoreLog.log; + shelterdLogger = PersoniumCoreLog.log; } /** * AfterClass. */ @AfterClass public static void afterClass() { - DcCoreLog.log = shelterdLogger; + PersoniumCoreLog.log = shelterdLogger; } /** * ログ出力正常系のテスト. @@ -62,8 +62,8 @@ public static void afterClass() { @Test public void ログ出力正常系のテスト() { final String replaceValue = "AAAAABBBBBCCCCCDDDDDD"; - DcCoreLog coreLog = DcCoreLog.Dav.ROLE_NOT_FOUND; - DcCoreLog.log = new TestLogger() { + PersoniumCoreLog coreLog = PersoniumCoreLog.Dav.ROLE_NOT_FOUND; + PersoniumCoreLog.log = new TestLogger() { @Override public void info(String msg) { doLog(msg); @@ -103,8 +103,8 @@ private void doLog(String msg) { */ @Test public void ログレベル設定を省略するとWARNレベルでログが出力されることを確認() { - DcCoreLog coreLog = DcCoreLog.Misc.UNREACHABLE_CODE_ERROR; - DcCoreLog.log = new TestLogger() { + PersoniumCoreLog coreLog = PersoniumCoreLog.Misc.UNREACHABLE_CODE_ERROR; + PersoniumCoreLog.log = new TestLogger() { @Override public void info(String msg) { fail("WARNレベル以外でログが出力."); @@ -144,18 +144,18 @@ private void doLog(String msg) { */ @Test(expected = RuntimeException.class) public void 存在しないメッセージIDを指定すると実行時例外が発生すること() throws RuntimeException { - DcCoreLog.create("UNKNOWN"); + PersoniumCoreLog.create("UNKNOWN"); } /** - * ログレベル設定を切り替えてDcCoreLogを生成する. + * ログレベル設定を切り替えてPersoniumCoreLogを生成する. */ @Test - public void ログレベル設定を切り替えてDcCoreLogを生成する() { + public void ログレベル設定を切り替えてPersoniumCoreLogを生成する() { final String errorMsg = "ERROR Message."; final String warningMsg = "WARNING Message."; final String infoMsg = "INFO Message."; - DcCoreLog.log = new TestLogger() { + PersoniumCoreLog.log = new TestLogger() { @Override public void info(String msg) { assertTrue(msg.indexOf(infoMsg) > 0); @@ -169,11 +169,11 @@ public void error(String msg) { assertTrue(msg.indexOf(errorMsg) > 0); } }; - DcCoreLog infoLog = new DcCoreLog("TEST", Severity.INFO, infoMsg); + PersoniumCoreLog infoLog = new PersoniumCoreLog("TEST", Severity.INFO, infoMsg); infoLog.writeLog(); - DcCoreLog warningLog = new DcCoreLog("TEST", Severity.WARN, warningMsg); + PersoniumCoreLog warningLog = new PersoniumCoreLog("TEST", Severity.WARN, warningMsg); warningLog.writeLog(); - DcCoreLog errorLog = new DcCoreLog("TEST", Severity.ERROR, errorMsg); + PersoniumCoreLog errorLog = new PersoniumCoreLog("TEST", Severity.ERROR, errorMsg); errorLog.writeLog(); } diff --git a/src/test/java/com/fujitsu/dc/core/DcReadDeleteModeManagerTest.java b/src/test/java/io/personium/core/PersoniumReadDeleteModeManagerTest.java similarity index 64% rename from src/test/java/com/fujitsu/dc/core/DcReadDeleteModeManagerTest.java rename to src/test/java/io/personium/core/PersoniumReadDeleteModeManagerTest.java index 722ea725e..cf213bcce 100644 --- a/src/test/java/com/fujitsu/dc/core/DcReadDeleteModeManagerTest.java +++ b/src/test/java/io/personium/core/PersoniumReadDeleteModeManagerTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core; +package io.personium.core; import static org.junit.Assert.fail; @@ -31,7 +31,7 @@ import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; -import com.fujitsu.dc.core.model.lock.ReadDeleteModeLockManager; +import io.personium.core.model.lock.ReadDeleteModeLockManager; /** * PCSの動作モードを参照するクラスのテスト. @@ -39,329 +39,329 @@ @RunWith(PowerMockRunner.class) @PrepareForTest(ReadDeleteModeLockManager.class) -public class DcReadDeleteModeManagerTest { +public class PersoniumReadDeleteModeManagerTest { /** - * ReadDeleteOnlyモード時にGETメソッドが実行された場合はDcCoreExceptionが発生しないこと. + * ReadDeleteOnlyモード時にGETメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと. * @throws Exception . */ @Test - public void ReadDeleteOnlyモード時にGETメソッドが実行された場合はDcCoreExceptionが発生しないこと() throws Exception { + public void ReadDeleteOnlyモード時にGETメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと() throws Exception { PowerMockito.spy(ReadDeleteModeLockManager.class); PowerMockito.when(ReadDeleteModeLockManager.class, "isReadDeleteOnlyMode").thenReturn(true); List pathSegment = getPathSegmentList(new String[] {"cell", "box", "odata", "entity" }); try { - DcReadDeleteModeManager.checkReadDeleteOnlyMode(HttpMethod.GET, pathSegment); - } catch (DcCoreException e) { + PersoniumReadDeleteModeManager.checkReadDeleteOnlyMode(HttpMethod.GET, pathSegment); + } catch (PersoniumCoreException e) { fail(e.getMessage()); } } /** - * ReadDeleteOnlyモード時にDELETEメソッドが実行された場合はDcCoreExceptionが発生しないこと. + * ReadDeleteOnlyモード時にDELETEメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと. * @throws Exception . */ @Test - public void ReadDeleteOnlyモード時にDELETEメソッドが実行された場合はDcCoreExceptionが発生しないこと() throws Exception { + public void ReadDeleteOnlyモード時にDELETEメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと() throws Exception { PowerMockito.spy(ReadDeleteModeLockManager.class); PowerMockito.when(ReadDeleteModeLockManager.class, "isReadDeleteOnlyMode").thenReturn(true); List pathSegment = getPathSegmentList(new String[] {"cell", "box", "odata", "entity" }); try { - DcReadDeleteModeManager.checkReadDeleteOnlyMode(HttpMethod.DELETE, pathSegment); - } catch (DcCoreException e) { + PersoniumReadDeleteModeManager.checkReadDeleteOnlyMode(HttpMethod.DELETE, pathSegment); + } catch (PersoniumCoreException e) { fail(e.getMessage()); } } /** - * ReadDeleteOnlyモード時にPROPFINDメソッドが実行された場合はDcCoreExceptionが発生しないこと. + * ReadDeleteOnlyモード時にPROPFINDメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと. * @throws Exception . */ @Test - public void ReadDeleteOnlyモード時にPROPFINDメソッドが実行された場合はDcCoreExceptionが発生しないこと() throws Exception { + public void ReadDeleteOnlyモード時にPROPFINDメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと() throws Exception { PowerMockito.spy(ReadDeleteModeLockManager.class); PowerMockito.when(ReadDeleteModeLockManager.class, "isReadDeleteOnlyMode").thenReturn(true); List pathSegment = getPathSegmentList(new String[] {"cell", "box", "odata", "entity" }); try { - DcReadDeleteModeManager.checkReadDeleteOnlyMode( - com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPFIND, pathSegment); - } catch (DcCoreException e) { + PersoniumReadDeleteModeManager.checkReadDeleteOnlyMode( + io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPFIND, pathSegment); + } catch (PersoniumCoreException e) { fail(e.getMessage()); } } /** - * ReadDeleteOnlyモード時にOPTIONSメソッドが実行された場合はDcCoreExceptionが発生しないこと. + * ReadDeleteOnlyモード時にOPTIONSメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと. * @throws Exception . */ @Test - public void ReadDeleteOnlyモード時にOPTIONSメソッドが実行された場合はDcCoreExceptionが発生しないこと() throws Exception { + public void ReadDeleteOnlyモード時にOPTIONSメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと() throws Exception { PowerMockito.spy(ReadDeleteModeLockManager.class); PowerMockito.when(ReadDeleteModeLockManager.class, "isReadDeleteOnlyMode").thenReturn(true); List pathSegment = getPathSegmentList(new String[] {"cell", "box", "odata", "entity" }); try { - DcReadDeleteModeManager.checkReadDeleteOnlyMode(HttpMethod.OPTIONS, pathSegment); - } catch (DcCoreException e) { + PersoniumReadDeleteModeManager.checkReadDeleteOnlyMode(HttpMethod.OPTIONS, pathSegment); + } catch (PersoniumCoreException e) { fail(e.getMessage()); } } /** - * ReadDeleteOnlyモード時にHEADメソッドが実行された場合はDcCoreExceptionが発生しないこと. + * ReadDeleteOnlyモード時にHEADメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと. * @throws Exception . */ @Test - public void ReadDeleteOnlyモード時にHEADメソッドが実行された場合はDcCoreExceptionが発生しないこと() throws Exception { + public void ReadDeleteOnlyモード時にHEADメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと() throws Exception { PowerMockito.spy(ReadDeleteModeLockManager.class); PowerMockito.when(ReadDeleteModeLockManager.class, "isReadDeleteOnlyMode").thenReturn(true); List pathSegment = getPathSegmentList(new String[] {"cell", "box", "odata", "entity" }); try { - DcReadDeleteModeManager.checkReadDeleteOnlyMode(HttpMethod.HEAD, pathSegment); - } catch (DcCoreException e) { + PersoniumReadDeleteModeManager.checkReadDeleteOnlyMode(HttpMethod.HEAD, pathSegment); + } catch (PersoniumCoreException e) { fail(e.getMessage()); } } /** - * ReadDeleteOnlyモード時にREPORTメソッドが実行された場合はDcCoreExceptionが発生しないこと. + * ReadDeleteOnlyモード時にREPORTメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと. * @throws Exception . */ @Test - public void ReadDeleteOnlyモード時にREPORTメソッドが実行された場合はDcCoreExceptionが発生しないこと() throws Exception { + public void ReadDeleteOnlyモード時にREPORTメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと() throws Exception { PowerMockito.spy(ReadDeleteModeLockManager.class); PowerMockito.when(ReadDeleteModeLockManager.class, "isReadDeleteOnlyMode").thenReturn(true); List pathSegment = getPathSegmentList(new String[] {"cell", "box", "odata", "entity" }); try { - DcReadDeleteModeManager.checkReadDeleteOnlyMode("REPORT", pathSegment); - } catch (DcCoreException e) { + PersoniumReadDeleteModeManager.checkReadDeleteOnlyMode("REPORT", pathSegment); + } catch (PersoniumCoreException e) { fail(e.getMessage()); } } /** - * ReadDeleteOnlyモード時にPOSTメソッドが実行された場合はDcCoreExceptionが発生すること. + * ReadDeleteOnlyモード時にPOSTメソッドが実行された場合はPersoniumCoreExceptionが発生すること. * @throws Exception . */ - @Test(expected = DcCoreException.class) + @Test(expected = PersoniumCoreException.class) public void ReadDeleteOnlyモード時にPOSTメソッドが実行された場合は503が返却されること() throws Exception { PowerMockito.spy(ReadDeleteModeLockManager.class); PowerMockito.when(ReadDeleteModeLockManager.class, "isReadDeleteOnlyMode").thenReturn(true); List pathSegment = getPathSegmentList(new String[] {"cell", "box", "odata", "entity" }); - DcReadDeleteModeManager.checkReadDeleteOnlyMode(HttpMethod.POST, pathSegment); + PersoniumReadDeleteModeManager.checkReadDeleteOnlyMode(HttpMethod.POST, pathSegment); } /** - * ReadDeleteOnlyモード時にPUTメソッドが実行された場合はDcCoreExceptionが発生すること. + * ReadDeleteOnlyモード時にPUTメソッドが実行された場合はPersoniumCoreExceptionが発生すること. * @throws Exception . */ - @Test(expected = DcCoreException.class) + @Test(expected = PersoniumCoreException.class) public void ReadDeleteOnlyモード時にPUTメソッドが実行された場合は503が返却されること() throws Exception { PowerMockito.spy(ReadDeleteModeLockManager.class); PowerMockito.when(ReadDeleteModeLockManager.class, "isReadDeleteOnlyMode").thenReturn(true); List pathSegment = getPathSegmentList(new String[] {"cell", "box", "odata", "entity" }); - DcReadDeleteModeManager.checkReadDeleteOnlyMode(HttpMethod.PUT, pathSegment); + PersoniumReadDeleteModeManager.checkReadDeleteOnlyMode(HttpMethod.PUT, pathSegment); } /** - * ReadDeleteOnlyモード時にMERGEメソッドが実行された場合はDcCoreExceptionが発生すること. + * ReadDeleteOnlyモード時にMERGEメソッドが実行された場合はPersoniumCoreExceptionが発生すること. * @throws Exception . */ - @Test(expected = DcCoreException.class) + @Test(expected = PersoniumCoreException.class) public void ReadDeleteOnlyモード時にMERGEメソッドが実行された場合は503が返却されること() throws Exception { PowerMockito.spy(ReadDeleteModeLockManager.class); PowerMockito.when(ReadDeleteModeLockManager.class, "isReadDeleteOnlyMode").thenReturn(true); List pathSegment = getPathSegmentList(new String[] {"cell", "box", "odata", "entity" }); - DcReadDeleteModeManager.checkReadDeleteOnlyMode(com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.MERGE, + PersoniumReadDeleteModeManager.checkReadDeleteOnlyMode(io.personium.common.utils.PersoniumCoreUtils.HttpMethod.MERGE, pathSegment); } /** - * ReadDeleteOnlyモード時にMKCOLメソッドが実行された場合はDcCoreExceptionが発生すること. + * ReadDeleteOnlyモード時にMKCOLメソッドが実行された場合はPersoniumCoreExceptionが発生すること. * @throws Exception . */ - @Test(expected = DcCoreException.class) + @Test(expected = PersoniumCoreException.class) public void ReadDeleteOnlyモード時にMKCOLメソッドが実行された場合は503が返却されること() throws Exception { PowerMockito.spy(ReadDeleteModeLockManager.class); PowerMockito.when(ReadDeleteModeLockManager.class, "isReadDeleteOnlyMode").thenReturn(true); List pathSegment = getPathSegmentList(new String[] {"cell", "box", "odata", "entity" }); - DcReadDeleteModeManager.checkReadDeleteOnlyMode(com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.MKCOL, + PersoniumReadDeleteModeManager.checkReadDeleteOnlyMode(io.personium.common.utils.PersoniumCoreUtils.HttpMethod.MKCOL, pathSegment); } /** - * ReadDeleteOnlyモード時にPROPPATCHメソッドが実行された場合はDcCoreExceptionが発生すること. + * ReadDeleteOnlyモード時にPROPPATCHメソッドが実行された場合はPersoniumCoreExceptionが発生すること. * @throws Exception . */ - @Test(expected = DcCoreException.class) + @Test(expected = PersoniumCoreException.class) public void ReadDeleteOnlyモード時にPROPPATCHメソッドが実行された場合は503が返却されること() throws Exception { PowerMockito.spy(ReadDeleteModeLockManager.class); PowerMockito.when(ReadDeleteModeLockManager.class, "isReadDeleteOnlyMode").thenReturn(true); List pathSegment = getPathSegmentList(new String[] {"cell", "box", "odata", "entity" }); - DcReadDeleteModeManager.checkReadDeleteOnlyMode(com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPPATCH, + PersoniumReadDeleteModeManager.checkReadDeleteOnlyMode(io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPPATCH, pathSegment); } /** - * ReadDeleteOnlyモード時にACLメソッドが実行された場合はDcCoreExceptionが発生すること. + * ReadDeleteOnlyモード時にACLメソッドが実行された場合はPersoniumCoreExceptionが発生すること. * @throws Exception . */ - @Test(expected = DcCoreException.class) + @Test(expected = PersoniumCoreException.class) public void ReadDeleteOnlyモード時にACLメソッドが実行された場合は503が返却されること() throws Exception { PowerMockito.spy(ReadDeleteModeLockManager.class); PowerMockito.when(ReadDeleteModeLockManager.class, "isReadDeleteOnlyMode").thenReturn(true); List pathSegment = getPathSegmentList(new String[] {"cell", "box", "odata", "entity" }); - DcReadDeleteModeManager.checkReadDeleteOnlyMode(com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.ACL, + PersoniumReadDeleteModeManager.checkReadDeleteOnlyMode(io.personium.common.utils.PersoniumCoreUtils.HttpMethod.ACL, pathSegment); } /** - * ReadDeleteOnlyモードではない状態でPOSTメソッドが実行された場合はDcCoreExceptionが発生しないこと. + * ReadDeleteOnlyモードではない状態でPOSTメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと. * @throws Exception . */ @Test - public void ReadDeleteOnlyモードではない状態でPOSTメソッドが実行された場合はDcCoreExceptionが発生しないこと() throws Exception { + public void ReadDeleteOnlyモードではない状態でPOSTメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと() throws Exception { PowerMockito.spy(ReadDeleteModeLockManager.class); PowerMockito.when(ReadDeleteModeLockManager.class, "isReadDeleteOnlyMode").thenReturn(false); List pathSegment = getPathSegmentList(new String[] {"cell", "box", "odata", "entity" }); try { - DcReadDeleteModeManager.checkReadDeleteOnlyMode(HttpMethod.POST, pathSegment); - } catch (DcCoreException e) { + PersoniumReadDeleteModeManager.checkReadDeleteOnlyMode(HttpMethod.POST, pathSegment); + } catch (PersoniumCoreException e) { fail(e.getMessage()); } } /** - * ReadDeleteOnlyモードではない状態でPUTメソッドが実行された場合はDcCoreExceptionが発生しないこと. + * ReadDeleteOnlyモードではない状態でPUTメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと. * @throws Exception . */ @Test - public void ReadDeleteOnlyモードではない状態でPUTメソッドが実行された場合はDcCoreExceptionが発生しないこと() throws Exception { + public void ReadDeleteOnlyモードではない状態でPUTメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと() throws Exception { PowerMockito.spy(ReadDeleteModeLockManager.class); PowerMockito.when(ReadDeleteModeLockManager.class, "isReadDeleteOnlyMode").thenReturn(false); List pathSegment = getPathSegmentList(new String[] {"cell", "box", "odata", "entity" }); try { - DcReadDeleteModeManager.checkReadDeleteOnlyMode(HttpMethod.PUT, pathSegment); - } catch (DcCoreException e) { + PersoniumReadDeleteModeManager.checkReadDeleteOnlyMode(HttpMethod.PUT, pathSegment); + } catch (PersoniumCoreException e) { fail(e.getMessage()); } } /** - * ReadDeleteOnlyモードではない状態でMERGEメソッドが実行された場合はDcCoreExceptionが発生しないこと. + * ReadDeleteOnlyモードではない状態でMERGEメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと. * @throws Exception . */ @Test - public void ReadDeleteOnlyモードではない状態でMERGEメソッドが実行された場合はDcCoreExceptionが発生しないこと() throws Exception { + public void ReadDeleteOnlyモードではない状態でMERGEメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと() throws Exception { PowerMockito.spy(ReadDeleteModeLockManager.class); PowerMockito.when(ReadDeleteModeLockManager.class, "isReadDeleteOnlyMode").thenReturn(false); List pathSegment = getPathSegmentList(new String[] {"cell", "box", "odata", "entity" }); try { - DcReadDeleteModeManager.checkReadDeleteOnlyMode(com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.MERGE, + PersoniumReadDeleteModeManager.checkReadDeleteOnlyMode(io.personium.common.utils.PersoniumCoreUtils.HttpMethod.MERGE, pathSegment); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { fail(e.getMessage()); } } /** - * ReadDeleteOnlyモードではない状態でMKCOLメソッドが実行された場合はDcCoreExceptionが発生しないこと. + * ReadDeleteOnlyモードではない状態でMKCOLメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと. * @throws Exception . */ @Test - public void ReadDeleteOnlyモードではない状態でMKCOLメソッドが実行された場合はDcCoreExceptionが発生しないこと() throws Exception { + public void ReadDeleteOnlyモードではない状態でMKCOLメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと() throws Exception { PowerMockito.spy(ReadDeleteModeLockManager.class); PowerMockito.when(ReadDeleteModeLockManager.class, "isReadDeleteOnlyMode").thenReturn(false); List pathSegment = getPathSegmentList(new String[] {"cell", "box", "odata", "entity" }); try { - DcReadDeleteModeManager.checkReadDeleteOnlyMode(com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.MKCOL, + PersoniumReadDeleteModeManager.checkReadDeleteOnlyMode(io.personium.common.utils.PersoniumCoreUtils.HttpMethod.MKCOL, pathSegment); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { fail(e.getMessage()); } } /** - * ReadDeleteOnlyモードではない状態でPROPPATCHメソッドが実行された場合はDcCoreExceptionが発生しないこと. + * ReadDeleteOnlyモードではない状態でPROPPATCHメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと. * @throws Exception . */ @Test - public void ReadDeleteOnlyモードではない状態でPROPPATCHメソッドが実行された場合はDcCoreExceptionが発生しないこと() throws Exception { + public void ReadDeleteOnlyモードではない状態でPROPPATCHメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと() throws Exception { PowerMockito.spy(ReadDeleteModeLockManager.class); PowerMockito.when(ReadDeleteModeLockManager.class, "isReadDeleteOnlyMode").thenReturn(false); List pathSegment = getPathSegmentList(new String[] {"cell", "box", "odata", "entity" }); try { - DcReadDeleteModeManager.checkReadDeleteOnlyMode( - com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPPATCH, pathSegment); - } catch (DcCoreException e) { + PersoniumReadDeleteModeManager.checkReadDeleteOnlyMode( + io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPPATCH, pathSegment); + } catch (PersoniumCoreException e) { fail(e.getMessage()); } } /** - * ReadDeleteOnlyモードではない状態でACLメソッドが実行された場合はDcCoreExceptionが発生しないこと. + * ReadDeleteOnlyモードではない状態でACLメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと. * @throws Exception . */ @Test - public void ReadDeleteOnlyモードではない状態でACLメソッドが実行された場合はDcCoreExceptionが発生しないこと() throws Exception { + public void ReadDeleteOnlyモードではない状態でACLメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと() throws Exception { PowerMockito.spy(ReadDeleteModeLockManager.class); PowerMockito.when(ReadDeleteModeLockManager.class, "isReadDeleteOnlyMode").thenReturn(false); List pathSegment = getPathSegmentList(new String[] {"cell", "box", "odata", "entity" }); try { - DcReadDeleteModeManager.checkReadDeleteOnlyMode(com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.ACL, + PersoniumReadDeleteModeManager.checkReadDeleteOnlyMode(io.personium.common.utils.PersoniumCoreUtils.HttpMethod.ACL, pathSegment); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { fail(e.getMessage()); } } /** - * ReadDeleteOnlyモード時に__authに対するPOSTメソッドが実行された場合はDcCoreExceptionが発生しないこと. + * ReadDeleteOnlyモード時に__authに対するPOSTメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと. * @throws Exception . */ @Test - public void ReadDeleteOnlyモード時に__authに対するPOSTメソッドが実行された場合はDcCoreExceptionが発生しないこと() throws Exception { + public void ReadDeleteOnlyモード時に__authに対するPOSTメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと() throws Exception { PowerMockito.spy(ReadDeleteModeLockManager.class); PowerMockito.when(ReadDeleteModeLockManager.class, "isReadDeleteOnlyMode").thenReturn(true); List pathSegment = getPathSegmentList(new String[] {"cell", "__auth" }); try { - DcReadDeleteModeManager.checkReadDeleteOnlyMode(HttpMethod.POST, pathSegment); - } catch (DcCoreException e) { + PersoniumReadDeleteModeManager.checkReadDeleteOnlyMode(HttpMethod.POST, pathSegment); + } catch (PersoniumCoreException e) { fail(e.getMessage()); } } /** - * ReadDeleteOnlyモード時に__authzに対するPOSTメソッドが実行された場合はDcCoreExceptionが発生しないこと. + * ReadDeleteOnlyモード時に__authzに対するPOSTメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと. * @throws Exception . */ @Test - public void ReadDeleteOnlyモード時に__authzに対するPOSTメソッドが実行された場合はDcCoreExceptionが発生しないこと() throws Exception { + public void ReadDeleteOnlyモード時に__authzに対するPOSTメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと() throws Exception { PowerMockito.spy(ReadDeleteModeLockManager.class); PowerMockito.when(ReadDeleteModeLockManager.class, "isReadDeleteOnlyMode").thenReturn(true); List pathSegment = getPathSegmentList(new String[] {"cell", "__authz" }); try { - DcReadDeleteModeManager.checkReadDeleteOnlyMode(HttpMethod.POST, pathSegment); - } catch (DcCoreException e) { + PersoniumReadDeleteModeManager.checkReadDeleteOnlyMode(HttpMethod.POST, pathSegment); + } catch (PersoniumCoreException e) { fail(e.getMessage()); } } /** - * ReadDeleteOnlyモード時に$batchに対するPOSTメソッドが実行された場合はDcCoreExceptionが発生しないこと. + * ReadDeleteOnlyモード時に$batchに対するPOSTメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと. * @throws Exception . */ @Test - public void ReadDeleteOnlyモード時に$batchに対するPOSTメソッドが実行された場合はDcCoreExceptionが発生しないこと() throws Exception { + public void ReadDeleteOnlyモード時に$batchに対するPOSTメソッドが実行された場合はPersoniumCoreExceptionが発生しないこと() throws Exception { PowerMockito.spy(ReadDeleteModeLockManager.class); PowerMockito.when(ReadDeleteModeLockManager.class, "isReadDeleteOnlyMode").thenReturn(true); try { List pathSegment = getPathSegmentList(new String[] {"cell", "box", "col", "odata", "$batch" }); - DcReadDeleteModeManager.checkReadDeleteOnlyMode(HttpMethod.POST, pathSegment); + PersoniumReadDeleteModeManager.checkReadDeleteOnlyMode(HttpMethod.POST, pathSegment); // 1階層パスを深くしても例外が発生しないことを確認 pathSegment = getPathSegmentList(new String[] {"cell", "box", "col", "col", "odata", "$batch" }); - DcReadDeleteModeManager.checkReadDeleteOnlyMode(HttpMethod.POST, pathSegment); - } catch (DcCoreException e) { + PersoniumReadDeleteModeManager.checkReadDeleteOnlyMode(HttpMethod.POST, pathSegment); + } catch (PersoniumCoreException e) { fail(e.getMessage()); } } diff --git a/src/test/java/com/fujitsu/dc/core/http/header/RangeHeaderHandlerTest.java b/src/test/java/io/personium/core/http/header/RangeHeaderHandlerTest.java similarity index 97% rename from src/test/java/com/fujitsu/dc/core/http/header/RangeHeaderHandlerTest.java rename to src/test/java/io/personium/core/http/header/RangeHeaderHandlerTest.java index dd4c711b2..3c50ea073 100644 --- a/src/test/java/com/fujitsu/dc/core/http/header/RangeHeaderHandlerTest.java +++ b/src/test/java/io/personium/core/http/header/RangeHeaderHandlerTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.http.header; +package io.personium.core.http.header; import static org.junit.Assert.assertEquals; @@ -30,7 +30,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.test.categories.Unit; /** * JdbcAdsユニットテストクラス. diff --git a/src/test/java/com/fujitsu/dc/core/model/file/AllTests.java b/src/test/java/io/personium/core/model/file/AllTests.java similarity index 92% rename from src/test/java/com/fujitsu/dc/core/model/file/AllTests.java rename to src/test/java/io/personium/core/model/file/AllTests.java index 15933a4bb..eb125accb 100644 --- a/src/test/java/com/fujitsu/dc/core/model/file/AllTests.java +++ b/src/test/java/io/personium/core/model/file/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.file; +package io.personium.core.model.file; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/core/model/file/BinaryDataAccessorTest.java b/src/test/java/io/personium/core/model/file/BinaryDataAccessorTest.java similarity index 88% rename from src/test/java/com/fujitsu/dc/core/model/file/BinaryDataAccessorTest.java rename to src/test/java/io/personium/core/model/file/BinaryDataAccessorTest.java index 8a17a17ad..c13709374 100644 --- a/src/test/java/com/fujitsu/dc/core/model/file/BinaryDataAccessorTest.java +++ b/src/test/java/io/personium/core/model/file/BinaryDataAccessorTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.file; +package io.personium.core.model.file; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -36,28 +36,28 @@ import org.junit.runner.RunWith; import org.mockito.Mockito; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; /** * BinaryDataAccessorユニットテストクラス. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class }) public class BinaryDataAccessorTest { /** * 既存ディレクトリにファイルの登録が可能な事を確認する. - * DcCoreConfigを利用するため、coreにテストを記述する + * PersoniumUnitConfingを利用するため、coreにテストを記述する */ @Test public void 既存ディレクトリにファイルの登録が可能な事を確認する() { String filename1 = "PcsInnov1"; String filename2 = "PcsInnov2"; String filename3 = "Pcs3nnov3"; - BinaryDataAccessor binaryDataAccessor = new BinaryDataAccessor(DcCoreConfig.getBlobStoreRoot(), - DcCoreConfig.getFsyncEnabled()); + BinaryDataAccessor binaryDataAccessor = new BinaryDataAccessor(PersoniumUnitConfig.getBlobStoreRoot(), + PersoniumUnitConfig.getFsyncEnabled()); try { long dataSize = "testhoge".getBytes().length; // ディレクトリを作成 @@ -104,14 +104,14 @@ public class BinaryDataAccessorTest { /** * ファイルを物理削除した場合ファイルが削除されていること. - * DcCoreConfigを利用するため、coreにテストを記述する + * PersoniumUnitConfingを利用するため、coreにテストを記述する * @throws BinaryDataAccessException バイナリアクセスに失敗 */ @Test public void ファイルを物理削除した場合ファイルが削除されていること() throws BinaryDataAccessException { String filename1 = "PcsInnovPhysicalDelete1"; - BinaryDataAccessor binaryDataAccessor = new BinaryDataAccessor(DcCoreConfig.getBlobStoreRoot(), - DcCoreConfig.getFsyncEnabled()); + BinaryDataAccessor binaryDataAccessor = new BinaryDataAccessor(PersoniumUnitConfig.getBlobStoreRoot(), + PersoniumUnitConfig.getFsyncEnabled()); try { // テンポラリファイルファイル作成 long dataSize = "testhoge".getBytes().length; @@ -137,14 +137,14 @@ public class BinaryDataAccessorTest { /** * ファイルの物理削除で存在しないファイルを指定した場合例外がスローされないこと. - * DcCoreConfigを利用するため、coreにテストを記述する + * PersoniumUnitConfingを利用するため、coreにテストを記述する * @throws BinaryDataAccessException バイナリアクセスに失敗 */ @Test public void ファイルの物理削除で存在しないファイルを指定した場合例外がスローされないこと() throws BinaryDataAccessException { String filename1 = "PcsInnovPhysicalDelete1"; - BinaryDataAccessor binaryDataAccessor = new BinaryDataAccessor(DcCoreConfig.getBlobStoreRoot(), - DcCoreConfig.getFsyncEnabled()); + BinaryDataAccessor binaryDataAccessor = new BinaryDataAccessor(PersoniumUnitConfig.getBlobStoreRoot(), + PersoniumUnitConfig.getFsyncEnabled()); // 物理削除 binaryDataAccessor.deletePhysicalFile(filename1); @@ -155,14 +155,14 @@ public class BinaryDataAccessorTest { /** * 物理削除設定を指定していない場合ファイルが論理削除されていること. - * DcCoreConfigを利用するため、coreにテストを記述する + * PersoniumUnitConfingを利用するため、coreにテストを記述する * @throws BinaryDataAccessException バイナリアクセスに失敗 */ @Test public void 物理削除設定を指定していない場合ファイルが論理削除されていること() throws BinaryDataAccessException { String filename1 = "PcsInnovPhysicalDelete1"; - BinaryDataAccessor binaryDataAccessor = new BinaryDataAccessor(DcCoreConfig.getBlobStoreRoot(), - DcCoreConfig.getFsyncEnabled()); + BinaryDataAccessor binaryDataAccessor = new BinaryDataAccessor(PersoniumUnitConfig.getBlobStoreRoot(), + PersoniumUnitConfig.getFsyncEnabled()); try { // テンポラリファイルファイル作成 long dataSize = "testhoge".getBytes().length; @@ -193,15 +193,15 @@ public class BinaryDataAccessorTest { /** * 物理削除設定の場合ファイルの実体が削除されていること. - * DcCoreConfigを利用するため、coreにテストを記述する + * PersoniumUnitConfingを利用するため、coreにテストを記述する * @throws BinaryDataAccessException バイナリアクセスに失敗 */ @Test public void 物理削除設定の場合ファイルの実体が削除されていること() throws BinaryDataAccessException { String filename1 = "PcsInnovPhysicalDelete1"; boolean isPhysicalDeleteMode = true; - BinaryDataAccessor binaryDataAccessor = new BinaryDataAccessor(DcCoreConfig.getBlobStoreRoot(), null, - isPhysicalDeleteMode, DcCoreConfig.getFsyncEnabled()); + BinaryDataAccessor binaryDataAccessor = new BinaryDataAccessor(PersoniumUnitConfig.getBlobStoreRoot(), null, + isPhysicalDeleteMode, PersoniumUnitConfig.getFsyncEnabled()); try { // テンポラリファイルファイル作成 long dataSize = "testhoge".getBytes().length; @@ -232,15 +232,15 @@ public class BinaryDataAccessorTest { /** * 論理削除設定の場合ファイルが論理削除されていること. - * DcCoreConfigを利用するため、coreにテストを記述する + * PersoniumUnitConfingを利用するため、coreにテストを記述する * @throws BinaryDataAccessException バイナリアクセスに失敗 */ @Test public void 論理削除設定の場合ファイルが論理削除されていること() throws BinaryDataAccessException { String filename1 = "PcsInnovPhysicalDelete1"; boolean isPhysicalDeleteMode = false; - BinaryDataAccessor binaryDataAccessor = new BinaryDataAccessor(DcCoreConfig.getBlobStoreRoot(), null, - isPhysicalDeleteMode, DcCoreConfig.getFsyncEnabled()); + BinaryDataAccessor binaryDataAccessor = new BinaryDataAccessor(PersoniumUnitConfig.getBlobStoreRoot(), null, + isPhysicalDeleteMode, PersoniumUnitConfig.getFsyncEnabled()); try { // テンポラリファイルファイル作成 long dataSize = "testhoge".getBytes().length; diff --git a/src/test/java/com/fujitsu/dc/core/model/impl/es/AllTests.java b/src/test/java/io/personium/core/model/impl/es/AllTests.java similarity index 92% rename from src/test/java/com/fujitsu/dc/core/model/impl/es/AllTests.java rename to src/test/java/io/personium/core/model/impl/es/AllTests.java index 4560edf28..62b9a409c 100644 --- a/src/test/java/com/fujitsu/dc/core/model/impl/es/AllTests.java +++ b/src/test/java/io/personium/core/model/impl/es/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es; +package io.personium.core.model.impl.es; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/core/model/impl/es/EsModelTest.java b/src/test/java/io/personium/core/model/impl/es/EsModelTest.java similarity index 90% rename from src/test/java/com/fujitsu/dc/core/model/impl/es/EsModelTest.java rename to src/test/java/io/personium/core/model/impl/es/EsModelTest.java index b91f36a62..28835b7db 100644 --- a/src/test/java/com/fujitsu/dc/core/model/impl/es/EsModelTest.java +++ b/src/test/java/io/personium/core/model/impl/es/EsModelTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es; +package io.personium.core.model.impl.es; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -29,18 +29,18 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.common.es.EsIndex; -import com.fujitsu.dc.core.model.impl.es.accessor.DavNodeAccessor; -import com.fujitsu.dc.core.model.impl.es.accessor.EntitySetAccessor; -import com.fujitsu.dc.core.model.impl.es.accessor.ODataLinkAccessor; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; +import io.personium.common.es.EsIndex; +import io.personium.core.model.impl.es.accessor.DavNodeAccessor; +import io.personium.core.model.impl.es.accessor.EntitySetAccessor; +import io.personium.core.model.impl.es.accessor.ODataLinkAccessor; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; /** * EsModelの単体テストケース. */ @Ignore -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({ Unit.class }) public class EsModelTest { diff --git a/src/test/java/com/fujitsu/dc/core/model/impl/es/accessor/AllTests.java b/src/test/java/io/personium/core/model/impl/es/accessor/AllTests.java similarity index 92% rename from src/test/java/com/fujitsu/dc/core/model/impl/es/accessor/AllTests.java rename to src/test/java/io/personium/core/model/impl/es/accessor/AllTests.java index 3a0a89b82..765830ae4 100644 --- a/src/test/java/com/fujitsu/dc/core/model/impl/es/accessor/AllTests.java +++ b/src/test/java/io/personium/core/model/impl/es/accessor/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.accessor; +package io.personium.core.model.impl.es.accessor; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/core/model/impl/es/accessor/CellAccessorTest.java b/src/test/java/io/personium/core/model/impl/es/accessor/CellAccessorTest.java similarity index 84% rename from src/test/java/com/fujitsu/dc/core/model/impl/es/accessor/CellAccessorTest.java rename to src/test/java/io/personium/core/model/impl/es/accessor/CellAccessorTest.java index 50955ddad..ea3ae8492 100644 --- a/src/test/java/com/fujitsu/dc/core/model/impl/es/accessor/CellAccessorTest.java +++ b/src/test/java/io/personium/core/model/impl/es/accessor/CellAccessorTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.accessor; +package io.personium.core.model.impl.es.accessor; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -33,22 +33,22 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.common.es.EsClient; -import com.fujitsu.dc.common.es.EsIndex; -import com.fujitsu.dc.common.es.response.DcIndexResponse; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.model.impl.es.ads.AdsException; -import com.fujitsu.dc.core.model.impl.es.ads.JdbcAds; -import com.fujitsu.dc.core.model.impl.es.doc.CellDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.EntitySetDocHandler; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.common.es.EsClient; +import io.personium.common.es.EsIndex; +import io.personium.common.es.response.PersoniumIndexResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.model.impl.es.ads.AdsException; +import io.personium.core.model.impl.es.ads.JdbcAds; +import io.personium.core.model.impl.es.doc.CellDocHandler; +import io.personium.core.model.impl.es.doc.EntitySetDocHandler; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.unit.core.UrlUtils; /** * CellAccessorTestの単体テストケース. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class }) public class CellAccessorTest { @@ -64,7 +64,7 @@ public class CellAccessorTest { */ @Before public void setUp() throws Exception { - esClient = new EsClient(DcCoreConfig.getEsClusterName(), DcCoreConfig.getEsHosts()); + esClient = new EsClient(PersoniumUnitConfig.getEsClusterName(), PersoniumUnitConfig.getEsHosts()); } /** @@ -73,7 +73,7 @@ public void setUp() throws Exception { */ @After public void tearDown() throws Exception { - String esUnitPrefix = DcCoreConfig.getEsUnitPrefix() + "_"; + String esUnitPrefix = PersoniumUnitConfig.getEsUnitPrefix() + "_"; EsIndex index = esClient.idxAdmin(esUnitPrefix + INDEX_NAME); try { index.delete(); @@ -116,14 +116,14 @@ public void deleteCell(String index, String id) throws AdsException { @Test public void create処理が正常に終了する() { // 事前準備 - String esUnitPrefix = DcCoreConfig.getEsUnitPrefix() + "_"; + String esUnitPrefix = PersoniumUnitConfig.getEsUnitPrefix() + "_"; EsIndex index = esClient.idxAdmin(esUnitPrefix + INDEX_NAME); assertNotNull(index); CellAccessor cellAccessor = new CellAccessor(index, TYPE_NAME, ROUTING_ID_NAME); CellDocHandler docHandler = createTestCellDocHandler(); // データ登録実行 - DcIndexResponse response = cellAccessor.create(docHandler); + PersoniumIndexResponse response = cellAccessor.create(docHandler); // レスポンスのチェック assertNotNull(response); @@ -150,7 +150,7 @@ public void deleteCell(String index, String id) throws AdsException { @Test public void create処理にてAdsが例外を上げた場合でも正常に終了すること() { // 事前準備 - String esUnitPrefix = DcCoreConfig.getEsUnitPrefix() + "_"; + String esUnitPrefix = PersoniumUnitConfig.getEsUnitPrefix() + "_"; EsIndex index = esClient.idxAdmin(esUnitPrefix + INDEX_NAME); assertNotNull(index); CellAccessor cellAccessor = new CellAccessor(index, TYPE_NAME, ROUTING_ID_NAME); @@ -162,7 +162,7 @@ public void deleteCell(String index, String id) throws AdsException { } // データ登録実行 - DcIndexResponse response = cellAccessor.create(docHandler); + PersoniumIndexResponse response = cellAccessor.create(docHandler); // レスポンスのチェック assertNotNull(response); @@ -175,12 +175,12 @@ public void deleteCell(String index, String id) throws AdsException { @Test public void update処理が正常に終了する() { // 事前準備 - String esUnitPrefix = DcCoreConfig.getEsUnitPrefix() + "_"; + String esUnitPrefix = PersoniumUnitConfig.getEsUnitPrefix() + "_"; EsIndex index = esClient.idxAdmin(esUnitPrefix + INDEX_NAME); assertNotNull(index); CellAccessor cellAccessor = new CellAccessor(index, TYPE_NAME, ROUTING_ID_NAME); CellDocHandler docHandler = createTestCellDocHandler(); - DcIndexResponse createResponse = cellAccessor.create(docHandler); + PersoniumIndexResponse createResponse = cellAccessor.create(docHandler); assertNotNull(createResponse); assertFalse(createResponse.getId().equals("")); @@ -189,7 +189,7 @@ public void deleteCell(String index, String id) throws AdsException { staticFields.put("test", "testdata"); docHandler.setStaticFields(staticFields); - DcIndexResponse updateResponse = cellAccessor.update(createResponse.getId(), docHandler); + PersoniumIndexResponse updateResponse = cellAccessor.update(createResponse.getId(), docHandler); // レスポンスのチェック assertNotNull(updateResponse); @@ -218,12 +218,12 @@ public void deleteCell(String index, String id) throws AdsException { @Test public void update処理にてAdsが例外を上げた場合でも正常に終了すること() { // 事前準備 - String esUnitPrefix = DcCoreConfig.getEsUnitPrefix() + "_"; + String esUnitPrefix = PersoniumUnitConfig.getEsUnitPrefix() + "_"; EsIndex index = esClient.idxAdmin(esUnitPrefix + INDEX_NAME); assertNotNull(index); CellAccessor cellAccessor = new CellAccessor(index, TYPE_NAME, ROUTING_ID_NAME); CellDocHandler docHandler = createTestCellDocHandler(); - DcIndexResponse createResponse = cellAccessor.create(docHandler); + PersoniumIndexResponse createResponse = cellAccessor.create(docHandler); assertNotNull(createResponse); assertFalse(createResponse.getId().equals("")); @@ -237,7 +237,7 @@ public void deleteCell(String index, String id) throws AdsException { staticFields.put("test", "testdata"); docHandler.setStaticFields(staticFields); - DcIndexResponse updateResponse = cellAccessor.update(createResponse.getId(), docHandler); + PersoniumIndexResponse updateResponse = cellAccessor.update(createResponse.getId(), docHandler); // レスポンスのチェック assertNotNull(updateResponse); @@ -250,12 +250,12 @@ public void deleteCell(String index, String id) throws AdsException { @Test public void delete処理が正常に終了する() { // 事前準備 - String esUnitPrefix = DcCoreConfig.getEsUnitPrefix() + "_"; + String esUnitPrefix = PersoniumUnitConfig.getEsUnitPrefix() + "_"; EsIndex index = esClient.idxAdmin(esUnitPrefix + INDEX_NAME); assertNotNull(index); CellAccessor cellAccessor = new CellAccessor(index, TYPE_NAME, ROUTING_ID_NAME); CellDocHandler docHandler = createTestCellDocHandler(); - DcIndexResponse response = cellAccessor.create(docHandler); + PersoniumIndexResponse response = cellAccessor.create(docHandler); assertNotNull(response); assertFalse(response.getId().equals("")); @@ -280,12 +280,12 @@ public void deleteCell(String index, String id) throws AdsException { @Test public void delete処理にてAdsが例外を上げた場合でも正常に終了すること() { // 事前準備 - String esUnitPrefix = DcCoreConfig.getEsUnitPrefix() + "_"; + String esUnitPrefix = PersoniumUnitConfig.getEsUnitPrefix() + "_"; EsIndex index = esClient.idxAdmin(esUnitPrefix + INDEX_NAME); assertNotNull(index); CellAccessor cellAccessor = new CellAccessor(index, TYPE_NAME, ROUTING_ID_NAME); CellDocHandler docHandler = createTestCellDocHandler(); - DcIndexResponse response = cellAccessor.create(docHandler); + PersoniumIndexResponse response = cellAccessor.create(docHandler); assertNotNull(response); assertFalse(response.getId().equals("")); try { diff --git a/src/test/java/com/fujitsu/dc/core/model/impl/es/accessor/DataSourceAccessorTest.java b/src/test/java/io/personium/core/model/impl/es/accessor/DataSourceAccessorTest.java similarity index 89% rename from src/test/java/com/fujitsu/dc/core/model/impl/es/accessor/DataSourceAccessorTest.java rename to src/test/java/io/personium/core/model/impl/es/accessor/DataSourceAccessorTest.java index 847c364b8..fdb004fe9 100644 --- a/src/test/java/com/fujitsu/dc/core/model/impl/es/accessor/DataSourceAccessorTest.java +++ b/src/test/java/io/personium/core/model/impl/es/accessor/DataSourceAccessorTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.accessor; +package io.personium.core.model.impl.es.accessor; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -32,20 +32,20 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.common.es.EsClient; -import com.fujitsu.dc.common.es.EsIndex; -import com.fujitsu.dc.common.es.response.DcDeleteResponse; -import com.fujitsu.dc.common.es.response.DcIndexResponse; -import com.fujitsu.dc.common.es.response.DcSearchResponse; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.model.impl.es.QueryMapFactory; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; +import io.personium.common.es.EsClient; +import io.personium.common.es.EsIndex; +import io.personium.common.es.response.PersoniumDeleteResponse; +import io.personium.common.es.response.PersoniumIndexResponse; +import io.personium.common.es.response.PersoniumSearchResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.model.impl.es.QueryMapFactory; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; /** * DataSourceAccessorの単体テストケース. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class }) public class DataSourceAccessorTest { @@ -57,7 +57,7 @@ public class DataSourceAccessorTest { */ @BeforeClass public static void setUpBeforeClass() throws Exception { - esClient = new EsClient(DcCoreConfig.getEsClusterName(), DcCoreConfig.getEsHosts()); + esClient = new EsClient(PersoniumUnitConfig.getEsClusterName(), PersoniumUnitConfig.getEsHosts()); } /** @@ -99,7 +99,7 @@ public void tearDown() throws Exception { EsIndex index = esClient.idxAdmin("index_for_test"); assertNotNull(index); DataSourceAccessor dsa = new DataSourceAccessor(index, "TypeForTest", "RoutingIdTest"); - DcIndexResponse response = dsa.create("id00001", new HashMap()); + PersoniumIndexResponse response = dsa.create("id00001", new HashMap()); assertNotNull(response); assertEquals("id00001", response.getId()); } @@ -112,7 +112,7 @@ public void tearDown() throws Exception { EsIndex index = esClient.idxAdmin("index_for_test"); assertNotNull(index); DataSourceAccessor dsa = new DataSourceAccessor(index, "TypeForTest", "RoutingIdTest"); - DcIndexResponse response = dsa.create(new HashMap()); + PersoniumIndexResponse response = dsa.create(new HashMap()); assertNotNull(response); assertFalse(response.getId().equals("")); } @@ -125,7 +125,7 @@ public void tearDown() throws Exception { EsIndex index = esClient.idxAdmin("index_for_test"); assertNotNull(index); DataSourceAccessor dsa = new DataSourceAccessor(index, "TypeForTest", "RoutingIdTest"); - DcIndexResponse response = dsa.update("id00001", new HashMap()); + PersoniumIndexResponse response = dsa.update("id00001", new HashMap()); assertNotNull(response); assertEquals("id00001", response.getId()); } @@ -139,7 +139,7 @@ public void tearDown() throws Exception { assertNotNull(index); DataSourceAccessor dsa = new DataSourceAccessor(index, "TypeForTest", "RoutingIdTest"); dsa.create("id00001", new HashMap()); - DcSearchResponse response = dsa.search(new HashMap()); + PersoniumSearchResponse response = dsa.search(new HashMap()); assertNotNull(response); } @@ -159,7 +159,7 @@ public void tearDown() throws Exception { Map query = new HashMap(); query.put("size", 3); - DcSearchResponse response = dsa.search(query); + PersoniumSearchResponse response = dsa.search(query); assertEquals(5, response.getHits().getAllPages()); assertEquals(3, response.getHits().getCount()); } @@ -178,7 +178,7 @@ public void tearDown() throws Exception { Map query = new HashMap(); query.put("size", 5); - DcSearchResponse response = dsa.search(query); + PersoniumSearchResponse response = dsa.search(query); assertEquals(3, response.getHits().getAllPages()); assertEquals(3, response.getHits().getCount()); } @@ -197,7 +197,7 @@ public void tearDown() throws Exception { Map query = new HashMap(); query.put("size", 0); - DcSearchResponse response = dsa.search(query); + PersoniumSearchResponse response = dsa.search(query); assertEquals(3, response.getHits().getAllPages()); assertEquals(0, response.getHits().getCount()); } @@ -222,7 +222,7 @@ public void tearDown() throws Exception { dsa.create("id00010", new HashMap()); dsa.create("id00011", new HashMap()); - DcSearchResponse response = dsa.search(null); + PersoniumSearchResponse response = dsa.search(null); assertEquals(11, response.getHits().getAllPages()); assertEquals(11, response.getHits().getCount()); } @@ -252,7 +252,7 @@ public void tearDown() throws Exception { Map query = new HashMap(); query.put("query", QueryMapFactory.filteredQuery(null, QueryMapFactory.termQuery("test", "value"))); - DcSearchResponse response = dsa.search(query); + PersoniumSearchResponse response = dsa.search(query); assertEquals(11, response.getHits().getAllPages()); assertEquals(11, response.getHits().getCount()); } @@ -373,7 +373,7 @@ public void tearDown() throws Exception { assertNotNull(index); DataSourceAccessor dsa = new DataSourceAccessor(index, "TypeForTest", "RoutingIdTest"); dsa.create("id00001", new HashMap()); - DcDeleteResponse response = dsa.delete("id00001", -1); + PersoniumDeleteResponse response = dsa.delete("id00001", -1); assertNotNull(response); assertFalse(response.isNotFound()); } @@ -386,7 +386,7 @@ public void tearDown() throws Exception { EsIndex index = esClient.idxAdmin("index_for_test"); assertNotNull(index); DataSourceAccessor dsa = new DataSourceAccessor(index, "TypeForTest", "RoutingIdTest"); - DcDeleteResponse response = dsa.delete("id00001", -1); + PersoniumDeleteResponse response = dsa.delete("id00001", -1); assertNull(response); } diff --git a/src/test/java/com/fujitsu/dc/core/model/impl/es/accessor/DavNodeAccessorTest.java b/src/test/java/io/personium/core/model/impl/es/accessor/DavNodeAccessorTest.java similarity index 83% rename from src/test/java/com/fujitsu/dc/core/model/impl/es/accessor/DavNodeAccessorTest.java rename to src/test/java/io/personium/core/model/impl/es/accessor/DavNodeAccessorTest.java index d114378ca..a135a9832 100644 --- a/src/test/java/com/fujitsu/dc/core/model/impl/es/accessor/DavNodeAccessorTest.java +++ b/src/test/java/io/personium/core/model/impl/es/accessor/DavNodeAccessorTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.accessor; +package io.personium.core.model.impl.es.accessor; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -38,37 +38,37 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.common.es.EsClient; -import com.fujitsu.dc.common.es.EsIndex; -import com.fujitsu.dc.common.es.response.DcActionResponse; -import com.fujitsu.dc.common.es.response.DcGetResponse; -import com.fujitsu.dc.common.es.response.DcIndexResponse; -import com.fujitsu.dc.common.es.response.EsClientException; -import com.fujitsu.dc.common.es.util.DcUUID; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.model.file.BinaryDataAccessException; -import com.fujitsu.dc.core.model.file.BinaryDataAccessor; -import com.fujitsu.dc.core.model.impl.es.DavNode; -import com.fujitsu.dc.core.model.impl.es.ads.AdsException; -import com.fujitsu.dc.core.model.impl.es.ads.JdbcAds; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; +import io.personium.common.es.EsClient; +import io.personium.common.es.EsIndex; +import io.personium.common.es.response.PersoniumActionResponse; +import io.personium.common.es.response.PersoniumGetResponse; +import io.personium.common.es.response.PersoniumIndexResponse; +import io.personium.common.es.response.EsClientException; +import io.personium.common.es.util.PersoniumUUID; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.model.file.BinaryDataAccessException; +import io.personium.core.model.file.BinaryDataAccessor; +import io.personium.core.model.impl.es.DavNode; +import io.personium.core.model.impl.es.ads.AdsException; +import io.personium.core.model.impl.es.ads.JdbcAds; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; /** * DavNodeAccessorTestの単体テストケース. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class }) public class DavNodeAccessorTest { private static final String UNIT_USER_NAME = "index_for_test"; - private static final String UNIT_PREFIX = DcCoreConfig.getEsUnitPrefix(); + private static final String UNIT_PREFIX = PersoniumUnitConfig.getEsUnitPrefix(); private static final String INDEX_NAME = UNIT_PREFIX + "_" + UNIT_USER_NAME; private static final String TYPE_NAME = "TypeForTest"; private static final String ROUTING_ID = "RoutingIdTest"; - private BinaryDataAccessor binaryDataAccessor = new BinaryDataAccessor(DcCoreConfig.getBlobStoreRoot(), - "index_for_test", DcCoreConfig.getFsyncEnabled()); + private BinaryDataAccessor binaryDataAccessor = new BinaryDataAccessor(PersoniumUnitConfig.getBlobStoreRoot(), + "index_for_test", PersoniumUnitConfig.getFsyncEnabled()); private static EsClient esClient; /** @@ -77,7 +77,7 @@ public class DavNodeAccessorTest { */ @Before public void setUp() throws Exception { - esClient = new EsClient(DcCoreConfig.getEsClusterName(), DcCoreConfig.getEsHosts()); + esClient = new EsClient(PersoniumUnitConfig.getEsClusterName(), PersoniumUnitConfig.getEsHosts()); } /** @@ -133,7 +133,7 @@ class JdbcAdsMockDavNodeAccessor extends DavNodeAccessor { } @Override - public DcActionResponse createForFile(String id, DavNode davNode) { + public PersoniumActionResponse createForFile(String id, DavNode davNode) { throw new EsClientException(id); } } @@ -150,7 +150,7 @@ public DcActionResponse createForFile(String id, DavNode davNode) { DavNode davNode = createTestDavNode(); // データ登録実行 - DcIndexResponse response = davNodeAccessor.create(davNode); + PersoniumIndexResponse response = davNodeAccessor.create(davNode); // レスポンスのチェック assertNotNull(response); @@ -188,7 +188,7 @@ public DcActionResponse createForFile(String id, DavNode davNode) { } // データ登録実行 - DcIndexResponse response = davNodeAccessor.create(davNode); + PersoniumIndexResponse response = davNodeAccessor.create(davNode); // レスポンスのチェック assertNotNull(response); @@ -205,7 +205,7 @@ public DcActionResponse createForFile(String id, DavNode davNode) { assertNotNull(index); DavNodeAccessor davNodeAccessor = new DavNodeAccessor(index, TYPE_NAME, ROUTING_ID); DavNode davNode = createTestDavNode(); - DcIndexResponse createResponse = davNodeAccessor.create(davNode); + PersoniumIndexResponse createResponse = davNodeAccessor.create(davNode); assertNotNull(createResponse); assertFalse(createResponse.getId().equals("")); @@ -213,7 +213,7 @@ public DcActionResponse createForFile(String id, DavNode davNode) { long dateTime = new Date().getTime(); davNode.setUpdated(dateTime); - DcIndexResponse updateResponse = davNodeAccessor.update(createResponse.getId(), davNode); + PersoniumIndexResponse updateResponse = davNodeAccessor.update(createResponse.getId(), davNode); // レスポンスのチェック assertNotNull(updateResponse); @@ -246,7 +246,7 @@ public DcActionResponse createForFile(String id, DavNode davNode) { assertNotNull(index); DavNodeAccessor davNodeAccessor = new DavNodeAccessor(index, TYPE_NAME, ROUTING_ID); DavNode davNode = createTestDavNode(); - DcIndexResponse createResponse = davNodeAccessor.create(davNode); + PersoniumIndexResponse createResponse = davNodeAccessor.create(davNode); assertNotNull(createResponse); assertFalse(createResponse.getId().equals("")); try { @@ -259,7 +259,7 @@ public DcActionResponse createForFile(String id, DavNode davNode) { long dateTime = new Date().getTime(); davNode.setUpdated(dateTime); - DcIndexResponse updateResponse = davNodeAccessor.update(createResponse.getId(), davNode); + PersoniumIndexResponse updateResponse = davNodeAccessor.update(createResponse.getId(), davNode); // レスポンスのチェック assertNotNull(updateResponse); @@ -276,7 +276,7 @@ public DcActionResponse createForFile(String id, DavNode davNode) { assertNotNull(index); DavNodeAccessor davNodeAccessor = new DavNodeAccessor(index, TYPE_NAME, ROUTING_ID); DavNode davNode = createTestDavNode(); - DcIndexResponse response = davNodeAccessor.create(davNode); + PersoniumIndexResponse response = davNodeAccessor.create(davNode); assertNotNull(response); assertFalse(response.getId().equals("")); @@ -305,7 +305,7 @@ public DcActionResponse createForFile(String id, DavNode davNode) { assertNotNull(index); DavNodeAccessor davNodeAccessor = new DavNodeAccessor(index, TYPE_NAME, ROUTING_ID); DavNode davNode = createTestDavNode(); - DcIndexResponse response = davNodeAccessor.create(davNode); + PersoniumIndexResponse response = davNodeAccessor.create(davNode); assertNotNull(response); assertFalse(response.getId().equals("")); try { @@ -327,20 +327,20 @@ public DcActionResponse createForFile(String id, DavNode davNode) { EsIndex index = esClient.idxUser(UNIT_PREFIX, UNIT_USER_NAME); assertNotNull(index); - String id = DcUUID.randomUUID(); + String id = PersoniumUUID.randomUUID(); DavNodeAccessor davNodeAccessor = new DavNodeAccessor(index, TYPE_NAME, ROUTING_ID); DavNode davNode = createTestDavNode(id); // データ登録実行 - DcActionResponse response = davNodeAccessor.createForFile(id, davNode); + PersoniumActionResponse response = davNodeAccessor.createForFile(id, davNode); // レスポンスのチェック assertNotNull(response); String resId = null; - if (response instanceof DcIndexResponse) { - resId = ((DcIndexResponse) response).getId(); - } else if (response instanceof DcGetResponse) { - resId = ((DcGetResponse) response).getId(); + if (response instanceof PersoniumIndexResponse) { + resId = ((PersoniumIndexResponse) response).getId(); + } else if (response instanceof PersoniumGetResponse) { + resId = ((PersoniumGetResponse) response).getId(); } assertEquals(id, resId); @@ -372,20 +372,20 @@ public DcActionResponse createForFile(String id, DavNode davNode) { EsIndex index = esClient.idxUser(UNIT_PREFIX, UNIT_USER_NAME); assertNotNull(index); - String id = DcUUID.randomUUID(); + String id = PersoniumUUID.randomUUID(); DavNodeAccessor davNodeAccessor = new DavNodeAccessor(index, TYPE_NAME, ROUTING_ID); DavNode davNode = createTestDavNode(id); // データ登録実行 - DcActionResponse response = davNodeAccessor.createForFile(id, davNode); + PersoniumActionResponse response = davNodeAccessor.createForFile(id, davNode); // レスポンスのチェック assertNotNull(response); String resId = null; - if (response instanceof DcIndexResponse) { - resId = ((DcIndexResponse) response).getId(); - } else if (response instanceof DcGetResponse) { - resId = ((DcGetResponse) response).getId(); + if (response instanceof PersoniumIndexResponse) { + resId = ((PersoniumIndexResponse) response).getId(); + } else if (response instanceof PersoniumGetResponse) { + resId = ((PersoniumGetResponse) response).getId(); } assertEquals(id, resId); assertTrue(binaryDataAccessor.existsForFilename(id)); @@ -428,7 +428,7 @@ public DcActionResponse createForFile(String id, DavNode davNode) { EsIndex index = esClient.idxUser(UNIT_PREFIX, UNIT_USER_NAME); assertNotNull(index); - String id = DcUUID.randomUUID(); + String id = PersoniumUUID.randomUUID(); DavNodeAccessor davNodeAccessor = new DavNodeAccessor(index, TYPE_NAME, ROUTING_ID); DavNode davNode = createTestDavNode(id); @@ -440,15 +440,15 @@ public DcActionResponse createForFile(String id, DavNode davNode) { } // データ登録実行 - DcActionResponse response = davNodeAccessorTest.createForFile(id, davNode); + PersoniumActionResponse response = davNodeAccessorTest.createForFile(id, davNode); // レスポンスのチェック assertNotNull(response); String resId = null; - if (response instanceof DcIndexResponse) { - resId = ((DcIndexResponse) response).getId(); - } else if (response instanceof DcGetResponse) { - resId = ((DcGetResponse) response).getId(); + if (response instanceof PersoniumIndexResponse) { + resId = ((PersoniumIndexResponse) response).getId(); + } else if (response instanceof PersoniumGetResponse) { + resId = ((PersoniumGetResponse) response).getId(); } assertEquals(id, resId); assertTrue(binaryDataAccessor.existsForFilename(id)); @@ -479,7 +479,7 @@ public DcActionResponse createForFile(String id, DavNode davNode) { EsIndex index = esClient.idxUser(UNIT_PREFIX, UNIT_USER_NAME); assertNotNull(index); - String id = DcUUID.randomUUID(); + String id = PersoniumUUID.randomUUID(); DavNodeAccessor davNodeAccessor = new DavNodeAccessor(index, TYPE_NAME, ROUTING_ID); DavNode davNode = createTestDavNode(); @@ -517,16 +517,16 @@ public DcActionResponse createForFile(String id, DavNode davNode) { // 事前準備 EsIndex index = esClient.idxUser(UNIT_PREFIX, UNIT_USER_NAME); assertNotNull(index); - String id = DcUUID.randomUUID(); + String id = PersoniumUUID.randomUUID(); DavNodeAccessor davNodeAccessor = new DavNodeAccessor(index, TYPE_NAME, ROUTING_ID); DavNode davNode = createTestDavNode(id); - DcActionResponse createResponse = davNodeAccessor.createForFile(id, davNode); + PersoniumActionResponse createResponse = davNodeAccessor.createForFile(id, davNode); assertNotNull(createResponse); String resId = null; - if (createResponse instanceof DcIndexResponse) { - resId = ((DcIndexResponse) createResponse).getId(); - } else if (createResponse instanceof DcGetResponse) { - resId = ((DcGetResponse) createResponse).getId(); + if (createResponse instanceof PersoniumIndexResponse) { + resId = ((PersoniumIndexResponse) createResponse).getId(); + } else if (createResponse instanceof PersoniumGetResponse) { + resId = ((PersoniumGetResponse) createResponse).getId(); } assertFalse(resId.equals("")); @@ -538,7 +538,7 @@ public DcActionResponse createForFile(String id, DavNode davNode) { davNode.setUpdated(dateTime); createTestTmpFile(id, "DavNodeAccessorTest Update!"); - DcIndexResponse updateResponse = davNodeAccessor.updateForFile(resId, davNode, -1); + PersoniumIndexResponse updateResponse = davNodeAccessor.updateForFile(resId, davNode, -1); // レスポンスのチェック assertNotNull(updateResponse); @@ -573,16 +573,16 @@ public DcActionResponse createForFile(String id, DavNode davNode) { // 事前準備 EsIndex index = esClient.idxUser(UNIT_PREFIX, UNIT_USER_NAME); assertNotNull(index); - String id = DcUUID.randomUUID(); + String id = PersoniumUUID.randomUUID(); DavNodeAccessor davNodeAccessor = new DavNodeAccessor(index, TYPE_NAME, ROUTING_ID); DavNode davNode = createTestDavNode(id); - DcActionResponse createResponse = davNodeAccessor.createForFile(id, davNode); + PersoniumActionResponse createResponse = davNodeAccessor.createForFile(id, davNode); assertNotNull(createResponse); String resId = null; - if (createResponse instanceof DcIndexResponse) { - resId = ((DcIndexResponse) createResponse).getId(); - } else if (createResponse instanceof DcGetResponse) { - resId = ((DcGetResponse) createResponse).getId(); + if (createResponse instanceof PersoniumIndexResponse) { + resId = ((PersoniumIndexResponse) createResponse).getId(); + } else if (createResponse instanceof PersoniumGetResponse) { + resId = ((PersoniumGetResponse) createResponse).getId(); } assertFalse(resId.equals("")); assertTrue(binaryDataAccessor.existsForFilename(id)); @@ -599,7 +599,7 @@ public DcActionResponse createForFile(String id, DavNode davNode) { } catch (Exception e1) { throw new RuntimeException(e1); } - DcIndexResponse updateResponse = davNodeAccessorUp.updateForFile(resId, davNode, -1); + PersoniumIndexResponse updateResponse = davNodeAccessorUp.updateForFile(resId, davNode, -1); // レスポンスのチェック assertNotNull(updateResponse); @@ -634,16 +634,16 @@ public DcActionResponse createForFile(String id, DavNode davNode) { // 事前準備 EsIndex index = esClient.idxUser(UNIT_PREFIX, UNIT_USER_NAME); assertNotNull(index); - String id = DcUUID.randomUUID(); + String id = PersoniumUUID.randomUUID(); DavNodeAccessor davNodeAccessor = new DavNodeAccessor(index, TYPE_NAME, ROUTING_ID); DavNode davNode = createTestDavNode(id); - DcActionResponse createResponse = davNodeAccessor.createForFile(id, davNode); + PersoniumActionResponse createResponse = davNodeAccessor.createForFile(id, davNode); assertNotNull(createResponse); String resId = null; - if (createResponse instanceof DcIndexResponse) { - resId = ((DcIndexResponse) createResponse).getId(); - } else if (createResponse instanceof DcGetResponse) { - resId = ((DcGetResponse) createResponse).getId(); + if (createResponse instanceof PersoniumIndexResponse) { + resId = ((PersoniumIndexResponse) createResponse).getId(); + } else if (createResponse instanceof PersoniumGetResponse) { + resId = ((PersoniumGetResponse) createResponse).getId(); } assertFalse(resId.equals("")); assertTrue(binaryDataAccessor.existsForFilename(id)); diff --git a/src/test/java/com/fujitsu/dc/core/model/impl/es/accessor/ODataEntityAccessorTest.java b/src/test/java/io/personium/core/model/impl/es/accessor/ODataEntityAccessorTest.java similarity index 84% rename from src/test/java/com/fujitsu/dc/core/model/impl/es/accessor/ODataEntityAccessorTest.java rename to src/test/java/io/personium/core/model/impl/es/accessor/ODataEntityAccessorTest.java index 95cde9576..137a4c839 100644 --- a/src/test/java/com/fujitsu/dc/core/model/impl/es/accessor/ODataEntityAccessorTest.java +++ b/src/test/java/io/personium/core/model/impl/es/accessor/ODataEntityAccessorTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.accessor; +package io.personium.core.model.impl.es.accessor; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -33,22 +33,22 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.common.es.EsClient; -import com.fujitsu.dc.common.es.EsIndex; -import com.fujitsu.dc.common.es.response.DcIndexResponse; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.model.impl.es.ads.AdsException; -import com.fujitsu.dc.core.model.impl.es.ads.JdbcAds; -import com.fujitsu.dc.core.model.impl.es.doc.EntitySetDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.OEntityDocHandler; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.common.es.EsClient; +import io.personium.common.es.EsIndex; +import io.personium.common.es.response.PersoniumIndexResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.model.impl.es.ads.AdsException; +import io.personium.core.model.impl.es.ads.JdbcAds; +import io.personium.core.model.impl.es.doc.EntitySetDocHandler; +import io.personium.core.model.impl.es.doc.OEntityDocHandler; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.unit.core.UrlUtils; /** * ODataEntityAccessorTestの単体テストケース. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class }) public class ODataEntityAccessorTest { @@ -64,7 +64,7 @@ public class ODataEntityAccessorTest { */ @Before public void setUp() throws Exception { - esClient = new EsClient(DcCoreConfig.getEsClusterName(), DcCoreConfig.getEsHosts()); + esClient = new EsClient(PersoniumUnitConfig.getEsClusterName(), PersoniumUnitConfig.getEsHosts()); } /** @@ -73,7 +73,7 @@ public void setUp() throws Exception { */ @After public void tearDown() throws Exception { - String esUnitPrefix = DcCoreConfig.getEsUnitPrefix(); + String esUnitPrefix = PersoniumUnitConfig.getEsUnitPrefix(); EsIndex index = esClient.idxUser(esUnitPrefix, INDEX_NAME); try { index.delete(); @@ -116,14 +116,14 @@ public void deleteEntity(String index, String id) throws AdsException { @Test public void create処理が正常に終了する() { // 事前準備 - String esUnitPrefix = DcCoreConfig.getEsUnitPrefix(); + String esUnitPrefix = PersoniumUnitConfig.getEsUnitPrefix(); EsIndex index = esClient.idxUser(esUnitPrefix, INDEX_NAME); assertNotNull(index); ODataEntityAccessor entityAccessor = new ODataEntityAccessor(index, TYPE_NAME, ROUTING_ID); OEntityDocHandler docHandler = createTestOEntityDocHandler(); // データ登録実行 - DcIndexResponse response = entityAccessor.create(docHandler); + PersoniumIndexResponse response = entityAccessor.create(docHandler); // レスポンスのチェック assertNotNull(response); @@ -150,7 +150,7 @@ public void deleteEntity(String index, String id) throws AdsException { @Test public void create処理にてAdsが例外を上げた場合でも正常に終了すること() { // 事前準備 - String esUnitPrefix = DcCoreConfig.getEsUnitPrefix(); + String esUnitPrefix = PersoniumUnitConfig.getEsUnitPrefix(); EsIndex index = esClient.idxUser(esUnitPrefix, INDEX_NAME); assertNotNull(index); ODataEntityAccessor entityAccessor = new ODataEntityAccessor(index, TYPE_NAME, ROUTING_ID); @@ -162,7 +162,7 @@ public void deleteEntity(String index, String id) throws AdsException { } // データ登録実行 - DcIndexResponse response = entityAccessor.create(docHandler); + PersoniumIndexResponse response = entityAccessor.create(docHandler); // レスポンスのチェック assertNotNull(response); @@ -175,12 +175,12 @@ public void deleteEntity(String index, String id) throws AdsException { @Test public void update処理が正常に終了する() { // 事前準備 - String esUnitPrefix = DcCoreConfig.getEsUnitPrefix(); + String esUnitPrefix = PersoniumUnitConfig.getEsUnitPrefix(); EsIndex index = esClient.idxUser(esUnitPrefix, INDEX_NAME); assertNotNull(index); ODataEntityAccessor entityAccessor = new ODataEntityAccessor(index, TYPE_NAME, ROUTING_ID); OEntityDocHandler docHandler = createTestOEntityDocHandler(); - DcIndexResponse createResponse = entityAccessor.create(docHandler); + PersoniumIndexResponse createResponse = entityAccessor.create(docHandler); assertNotNull(createResponse); assertFalse(createResponse.getId().equals("")); @@ -189,7 +189,7 @@ public void deleteEntity(String index, String id) throws AdsException { staticFields.put("test", "testdata"); docHandler.setStaticFields(staticFields); - DcIndexResponse updateResponse = entityAccessor.update(createResponse.getId(), docHandler); + PersoniumIndexResponse updateResponse = entityAccessor.update(createResponse.getId(), docHandler); // レスポンスのチェック assertNotNull(updateResponse); @@ -218,12 +218,12 @@ public void deleteEntity(String index, String id) throws AdsException { @Test public void update処理にてAdsが例外を上げた場合でも正常に終了すること() { // 事前準備 - String esUnitPrefix = DcCoreConfig.getEsUnitPrefix(); + String esUnitPrefix = PersoniumUnitConfig.getEsUnitPrefix(); EsIndex index = esClient.idxUser(esUnitPrefix, INDEX_NAME); assertNotNull(index); ODataEntityAccessor entityAccessor = new ODataEntityAccessor(index, TYPE_NAME, ROUTING_ID); OEntityDocHandler docHandler = createTestOEntityDocHandler(); - DcIndexResponse createResponse = entityAccessor.create(docHandler); + PersoniumIndexResponse createResponse = entityAccessor.create(docHandler); assertNotNull(createResponse); assertFalse(createResponse.getId().equals("")); try { @@ -237,7 +237,7 @@ public void deleteEntity(String index, String id) throws AdsException { staticFields.put("test", "testdata"); docHandler.setStaticFields(staticFields); - DcIndexResponse updateResponse = entityAccessor.update(createResponse.getId(), docHandler); + PersoniumIndexResponse updateResponse = entityAccessor.update(createResponse.getId(), docHandler); // レスポンスのチェック assertNotNull(updateResponse); @@ -250,12 +250,12 @@ public void deleteEntity(String index, String id) throws AdsException { @Test public void delete処理が正常に終了する() { // 事前準備 - String esUnitPrefix = DcCoreConfig.getEsUnitPrefix(); + String esUnitPrefix = PersoniumUnitConfig.getEsUnitPrefix(); EsIndex index = esClient.idxUser(esUnitPrefix, INDEX_NAME); assertNotNull(index); ODataEntityAccessor entityAccessor = new ODataEntityAccessor(index, TYPE_NAME, ROUTING_ID); OEntityDocHandler docHandler = createTestOEntityDocHandler(); - DcIndexResponse response = entityAccessor.create(docHandler); + PersoniumIndexResponse response = entityAccessor.create(docHandler); assertNotNull(response); assertFalse(response.getId().equals("")); @@ -280,12 +280,12 @@ public void deleteEntity(String index, String id) throws AdsException { @Test public void delete処理にてAdsが例外を上げた場合でも正常に終了すること() { // 事前準備 - String esUnitPrefix = DcCoreConfig.getEsUnitPrefix(); + String esUnitPrefix = PersoniumUnitConfig.getEsUnitPrefix(); EsIndex index = esClient.idxUser(esUnitPrefix, INDEX_NAME); assertNotNull(index); ODataEntityAccessor entityAccessor = new ODataEntityAccessor(index, TYPE_NAME, ROUTING_ID); OEntityDocHandler docHandler = createTestOEntityDocHandler(); - DcIndexResponse response = entityAccessor.create(docHandler); + PersoniumIndexResponse response = entityAccessor.create(docHandler); assertNotNull(response); assertFalse(response.getId().equals("")); try { diff --git a/src/test/java/com/fujitsu/dc/core/model/impl/es/accessor/ODataLinkAccessorTest.java b/src/test/java/io/personium/core/model/impl/es/accessor/ODataLinkAccessorTest.java similarity index 87% rename from src/test/java/com/fujitsu/dc/core/model/impl/es/accessor/ODataLinkAccessorTest.java rename to src/test/java/io/personium/core/model/impl/es/accessor/ODataLinkAccessorTest.java index 2f0ba80dc..ae29a154e 100644 --- a/src/test/java/com/fujitsu/dc/core/model/impl/es/accessor/ODataLinkAccessorTest.java +++ b/src/test/java/io/personium/core/model/impl/es/accessor/ODataLinkAccessorTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.accessor; +package io.personium.core.model.impl.es.accessor; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -31,24 +31,24 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.common.es.EsClient; -import com.fujitsu.dc.common.es.EsIndex; -import com.fujitsu.dc.common.es.response.DcIndexResponse; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.model.impl.es.ads.AdsException; -import com.fujitsu.dc.core.model.impl.es.ads.JdbcAds; -import com.fujitsu.dc.core.model.impl.es.doc.LinkDocHandler; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; +import io.personium.common.es.EsClient; +import io.personium.common.es.EsIndex; +import io.personium.common.es.response.PersoniumIndexResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.model.impl.es.ads.AdsException; +import io.personium.core.model.impl.es.ads.JdbcAds; +import io.personium.core.model.impl.es.doc.LinkDocHandler; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; /** * ODataLinkAccessorTestの単体テストケース. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class }) public class ODataLinkAccessorTest { - private static final String UNIT_PREFIX = DcCoreConfig.getEsUnitPrefix(); + private static final String UNIT_PREFIX = PersoniumUnitConfig.getEsUnitPrefix(); private static final String UNIT_USER_NAME = "index_for_test"; private static final String INDEX_NAME = UNIT_PREFIX + "_" + UNIT_USER_NAME; private static final String TYPE_NAME = "TypeForTest"; @@ -62,7 +62,7 @@ public class ODataLinkAccessorTest { */ @Before public void setUp() throws Exception { - esClient = new EsClient(DcCoreConfig.getEsClusterName(), DcCoreConfig.getEsHosts()); + esClient = new EsClient(PersoniumUnitConfig.getEsClusterName(), PersoniumUnitConfig.getEsHosts()); } /** @@ -119,7 +119,7 @@ public void deleteLink(String index, String id) throws AdsException { LinkDocHandler docHandler = createTestLinkDocHandler(); // データ登録実行 - DcIndexResponse response = linkAccessor.create(docHandler); + PersoniumIndexResponse response = linkAccessor.create(docHandler); // レスポンスのチェック assertNotNull(response); @@ -157,7 +157,7 @@ public void deleteLink(String index, String id) throws AdsException { } // データ登録実行 - DcIndexResponse response = linkAccessor.create(docHandler); + PersoniumIndexResponse response = linkAccessor.create(docHandler); // レスポンスのチェック assertNotNull(response); @@ -174,7 +174,7 @@ public void deleteLink(String index, String id) throws AdsException { assertNotNull(index); ODataLinkAccessor linkAccessor = new ODataLinkAccessor(index, TYPE_NAME, ROUTING_ID); LinkDocHandler docHandler = createTestLinkDocHandler(); - DcIndexResponse createResponse = linkAccessor.create(docHandler); + PersoniumIndexResponse createResponse = linkAccessor.create(docHandler); assertNotNull(createResponse); assertFalse(createResponse.getId().equals("")); @@ -182,7 +182,7 @@ public void deleteLink(String index, String id) throws AdsException { String updateString = "updatedEnt1Key"; docHandler.setEnt1Key(updateString); - DcIndexResponse updateResponse = linkAccessor.update(createResponse.getId(), docHandler); + PersoniumIndexResponse updateResponse = linkAccessor.update(createResponse.getId(), docHandler); // レスポンスのチェック assertNotNull(updateResponse); @@ -215,7 +215,7 @@ public void deleteLink(String index, String id) throws AdsException { assertNotNull(index); ODataLinkAccessor linkAccessor = new ODataLinkAccessor(index, TYPE_NAME, ROUTING_ID); LinkDocHandler docHandler = createTestLinkDocHandler(); - DcIndexResponse createResponse = linkAccessor.create(docHandler); + PersoniumIndexResponse createResponse = linkAccessor.create(docHandler); assertNotNull(createResponse); assertFalse(createResponse.getId().equals("")); try { @@ -228,7 +228,7 @@ public void deleteLink(String index, String id) throws AdsException { String updateString = "updatedEnt1Key"; docHandler.setEnt1Key(updateString); - DcIndexResponse updateResponse = linkAccessor.update(createResponse.getId(), docHandler); + PersoniumIndexResponse updateResponse = linkAccessor.update(createResponse.getId(), docHandler); // レスポンスのチェック assertNotNull(updateResponse); @@ -245,7 +245,7 @@ public void deleteLink(String index, String id) throws AdsException { assertNotNull(index); ODataLinkAccessor linkAccessor = new ODataLinkAccessor(index, TYPE_NAME, ROUTING_ID); LinkDocHandler docHandler = createTestLinkDocHandler(); - DcIndexResponse response = linkAccessor.create(docHandler); + PersoniumIndexResponse response = linkAccessor.create(docHandler); assertNotNull(response); assertFalse(response.getId().equals("")); @@ -274,7 +274,7 @@ public void deleteLink(String index, String id) throws AdsException { assertNotNull(index); ODataLinkAccessor linkAccessor = new ODataLinkAccessor(index, TYPE_NAME, ROUTING_ID); LinkDocHandler docHandler = createTestLinkDocHandler(); - DcIndexResponse response = linkAccessor.create(docHandler); + PersoniumIndexResponse response = linkAccessor.create(docHandler); assertNotNull(response); assertFalse(response.getId().equals("")); try { diff --git a/src/test/java/com/fujitsu/dc/core/model/impl/es/ads/AllTests.java b/src/test/java/io/personium/core/model/impl/es/ads/AllTests.java similarity index 92% rename from src/test/java/com/fujitsu/dc/core/model/impl/es/ads/AllTests.java rename to src/test/java/io/personium/core/model/impl/es/ads/AllTests.java index eefa342fc..419d7b768 100644 --- a/src/test/java/com/fujitsu/dc/core/model/impl/es/ads/AllTests.java +++ b/src/test/java/io/personium/core/model/impl/es/ads/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.ads; +package io.personium.core.model.impl.es.ads; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/core/model/impl/es/ads/JdbcAdsTest.java b/src/test/java/io/personium/core/model/impl/es/ads/JdbcAdsTest.java similarity index 92% rename from src/test/java/com/fujitsu/dc/core/model/impl/es/ads/JdbcAdsTest.java rename to src/test/java/io/personium/core/model/impl/es/ads/JdbcAdsTest.java index 0a7beca41..62d01cc43 100644 --- a/src/test/java/com/fujitsu/dc/core/model/impl/es/ads/JdbcAdsTest.java +++ b/src/test/java/io/personium/core/model/impl/es/ads/JdbcAdsTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.ads; +package io.personium.core.model.impl.es.ads; import static org.junit.Assert.assertEquals; @@ -31,13 +31,13 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.es.util.DcUUID; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.impl.es.DavNode; -import com.fujitsu.dc.core.model.impl.es.doc.LinkDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.OEntityDocHandler; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.common.es.util.PersoniumUUID; +import io.personium.core.model.Box; +import io.personium.core.model.Cell; +import io.personium.core.model.impl.es.DavNode; +import io.personium.core.model.impl.es.doc.LinkDocHandler; +import io.personium.core.model.impl.es.doc.OEntityDocHandler; +import io.personium.test.categories.Unit; /** * JdbcAdsユニットテストクラス. @@ -80,7 +80,7 @@ public void after() throws Exception { public void CELLに対応するADSのCRUD() throws Exception { JdbcAds ads = new JdbcAds(); OEntityDocHandler oedh = new OEntityDocHandler(); - String testId = DcUUID.randomUUID(); + String testId = PersoniumUUID.randomUUID(); oedh.setId(testId); oedh.setType(Cell.EDM_TYPE_NAME); oedh.setPublished(new Date().getTime()); @@ -144,9 +144,9 @@ public void after() throws Exception { OEntityDocHandler createTestOEntityDocHandler() { OEntityDocHandler oedh = new OEntityDocHandler(); - String testId = DcUUID.randomUUID(); + String testId = PersoniumUUID.randomUUID(); oedh.setId(testId); - oedh.setType(DcUUID.randomUUID()); + oedh.setType(PersoniumUUID.randomUUID()); oedh.setCellId("cellid"); oedh.setBoxId("boxid"); oedh.setPublished(new Date().getTime()); @@ -212,7 +212,7 @@ OEntityDocHandler createTestOEntityDocHandler() { // 作成 DavNode davNode = new DavNode(); - davNode.setId(DcUUID.randomUUID()); + davNode.setId(PersoniumUUID.randomUUID()); ads.createDavNode(TEST_INDEX, davNode); assertEquals(1, ads.countDavNode(TEST_INDEX)); List list = ads.getDavNodeList(TEST_INDEX, 0, 10); diff --git a/src/test/java/com/fujitsu/dc/core/model/impl/es/cache/AllTests.java b/src/test/java/io/personium/core/model/impl/es/cache/AllTests.java similarity index 92% rename from src/test/java/com/fujitsu/dc/core/model/impl/es/cache/AllTests.java rename to src/test/java/io/personium/core/model/impl/es/cache/AllTests.java index cf9c480ac..15177bec6 100644 --- a/src/test/java/com/fujitsu/dc/core/model/impl/es/cache/AllTests.java +++ b/src/test/java/io/personium/core/model/impl/es/cache/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.cache; +package io.personium.core.model.impl.es.cache; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/core/model/impl/es/cache/BoxCacheTest.java b/src/test/java/io/personium/core/model/impl/es/cache/BoxCacheTest.java similarity index 86% rename from src/test/java/com/fujitsu/dc/core/model/impl/es/cache/BoxCacheTest.java rename to src/test/java/io/personium/core/model/impl/es/cache/BoxCacheTest.java index a999cedd0..d3c4e0dcc 100644 --- a/src/test/java/com/fujitsu/dc/core/model/impl/es/cache/BoxCacheTest.java +++ b/src/test/java/io/personium/core/model/impl/es/cache/BoxCacheTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.cache; +package io.personium.core.model.impl.es.cache; import static org.fest.assertions.Assertions.assertThat; import static org.junit.Assert.assertNotNull; @@ -33,19 +33,19 @@ import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.impl.es.CellEsImpl; -import com.fujitsu.dc.core.utils.MemcachedClient; -import com.fujitsu.dc.core.utils.MemcachedClient.MemcachedClientException; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.model.Box; +import io.personium.core.model.impl.es.CellEsImpl; +import io.personium.core.utils.MemcachedClient; +import io.personium.core.utils.MemcachedClient.MemcachedClientException; +import io.personium.test.categories.Unit; /** * BoxCache ユニットテストクラス. */ @Category({Unit.class }) @RunWith(PowerMockRunner.class) -@PrepareForTest({BoxCache.class, DcCoreConfig.class }) +@PrepareForTest({BoxCache.class, PersoniumUnitConfig.class }) public class BoxCacheTest { /** @@ -69,8 +69,8 @@ public class BoxCacheTest { PowerMockito.when(BoxCache.class, "getMcdClient").thenReturn(mockMemcachedClient); // キャッシュの設定を有効にする - PowerMockito.spy(DcCoreConfig.class); - PowerMockito.when(DcCoreConfig.class, "isBoxCacheEnabled").thenReturn(true); + PowerMockito.spy(PersoniumUnitConfig.class); + PowerMockito.when(PersoniumUnitConfig.class, "isBoxCacheEnabled").thenReturn(true); // getメソッドのテスト CellEsImpl cell = new CellEsImpl(); @@ -104,8 +104,8 @@ public class BoxCacheTest { PowerMockito.when(BoxCache.class, "getMcdClient").thenReturn(mockMemcachedClient); // キャッシュの設定を有効にする - PowerMockito.spy(DcCoreConfig.class); - PowerMockito.when(DcCoreConfig.class, "isBoxCacheEnabled").thenReturn(true); + PowerMockito.spy(PersoniumUnitConfig.class); + PowerMockito.when(PersoniumUnitConfig.class, "isBoxCacheEnabled").thenReturn(true); // getメソッドのテスト CellEsImpl cell = new CellEsImpl(); @@ -139,8 +139,8 @@ public class BoxCacheTest { PowerMockito.when(BoxCache.class, "getMcdClient").thenReturn(mockMemcachedClient); // キャッシュの設定を無効にする - PowerMockito.spy(DcCoreConfig.class); - PowerMockito.when(DcCoreConfig.class, "isBoxCacheEnabled").thenReturn(false); + PowerMockito.spy(PersoniumUnitConfig.class); + PowerMockito.when(PersoniumUnitConfig.class, "isBoxCacheEnabled").thenReturn(false); // キャッシュ登録されないこと BoxCache.cache(boxToCache); @@ -176,8 +176,8 @@ public class BoxCacheTest { PowerMockito.when(BoxCache.class, "getMcdClient").thenReturn(mockMemcachedClient); // キャッシュの設定を有効にする - PowerMockito.spy(DcCoreConfig.class); - PowerMockito.when(DcCoreConfig.class, "isBoxCacheEnabled").thenReturn(true); + PowerMockito.spy(PersoniumUnitConfig.class); + PowerMockito.when(PersoniumUnitConfig.class, "isBoxCacheEnabled").thenReturn(true); // 事前にキャッシュを登録 BoxCache.cache(boxToCache); @@ -185,8 +185,8 @@ public class BoxCacheTest { isEqualTo(boxToCache, BoxCache.get(boxName, cell)); // キャッシュの設定を無効にする - PowerMockito.spy(DcCoreConfig.class); - PowerMockito.when(DcCoreConfig.class, "isBoxCacheEnabled").thenReturn(false); + PowerMockito.spy(PersoniumUnitConfig.class); + PowerMockito.when(PersoniumUnitConfig.class, "isBoxCacheEnabled").thenReturn(false); // キャッシュを取得できないこと Box boxFromCache = BoxCache.get(boxName, cell); @@ -222,8 +222,8 @@ public class BoxCacheTest { PowerMockito.when(BoxCache.class, "getMcdClient").thenReturn(mockMemcachedClient); // キャッシュの設定を有効にする - PowerMockito.spy(DcCoreConfig.class); - PowerMockito.when(DcCoreConfig.class, "isBoxCacheEnabled").thenReturn(true); + PowerMockito.spy(PersoniumUnitConfig.class); + PowerMockito.when(PersoniumUnitConfig.class, "isBoxCacheEnabled").thenReturn(true); // キャッシュに登録できること BoxCache.cache(boxToCache); diff --git a/src/test/java/com/fujitsu/dc/core/model/impl/es/cache/CellCacheTest.java b/src/test/java/io/personium/core/model/impl/es/cache/CellCacheTest.java similarity index 85% rename from src/test/java/com/fujitsu/dc/core/model/impl/es/cache/CellCacheTest.java rename to src/test/java/io/personium/core/model/impl/es/cache/CellCacheTest.java index 19129a6c3..36cd2b694 100644 --- a/src/test/java/com/fujitsu/dc/core/model/impl/es/cache/CellCacheTest.java +++ b/src/test/java/io/personium/core/model/impl/es/cache/CellCacheTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.cache; +package io.personium.core.model.impl.es.cache; import static org.fest.assertions.Assertions.assertThat; import static org.junit.Assert.assertEquals; @@ -36,17 +36,17 @@ import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.utils.MemcachedClient; -import com.fujitsu.dc.core.utils.MemcachedClient.MemcachedClientException; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.utils.MemcachedClient; +import io.personium.core.utils.MemcachedClient.MemcachedClientException; +import io.personium.test.categories.Unit; /** * CellCache ユニットテストクラス. */ @Category({Unit.class }) @RunWith(PowerMockRunner.class) -@PrepareForTest({CellCache.class, DcCoreConfig.class }) +@PrepareForTest({CellCache.class, PersoniumUnitConfig.class }) public class CellCacheTest { /** @@ -69,8 +69,8 @@ public class CellCacheTest { PowerMockito.when(CellCache.class, "getMcdClient").thenReturn(mockMemcachedClient); // キャッシュの設定を有効にする - PowerMockito.spy(DcCoreConfig.class); - PowerMockito.when(DcCoreConfig.class, "isCellCacheEnabled").thenReturn(true); + PowerMockito.spy(PersoniumUnitConfig.class); + PowerMockito.when(PersoniumUnitConfig.class, "isCellCacheEnabled").thenReturn(true); // getメソッドのテスト Map cache = CellCache.get(cellName); @@ -97,8 +97,8 @@ public class CellCacheTest { PowerMockito.when(CellCache.class, "getMcdClient").thenReturn(mockMemcachedClient); // キャッシュの設定を有効にする - PowerMockito.spy(DcCoreConfig.class); - PowerMockito.when(DcCoreConfig.class, "isCellCacheEnabled").thenReturn(true); + PowerMockito.spy(PersoniumUnitConfig.class); + PowerMockito.when(PersoniumUnitConfig.class, "isCellCacheEnabled").thenReturn(true); // getメソッドのテスト Map cache = CellCache.get(cellName); @@ -125,8 +125,8 @@ public class CellCacheTest { PowerMockito.when(CellCache.class, "getMcdClient").thenReturn(mockMemcachedClient); // キャッシュの設定を無効にする - PowerMockito.spy(DcCoreConfig.class); - PowerMockito.when(DcCoreConfig.class, "isCellCacheEnabled").thenReturn(false); + PowerMockito.spy(PersoniumUnitConfig.class); + PowerMockito.when(PersoniumUnitConfig.class, "isCellCacheEnabled").thenReturn(false); // キャッシュ登録されないこと CellCache.cache(cellName, cellToCache); @@ -157,8 +157,8 @@ public class CellCacheTest { PowerMockito.when(CellCache.class, "getMcdClient").thenReturn(mockMemcachedClient); // キャッシュの設定を有効にする - PowerMockito.spy(DcCoreConfig.class); - PowerMockito.when(DcCoreConfig.class, "isCellCacheEnabled").thenReturn(true); + PowerMockito.spy(PersoniumUnitConfig.class); + PowerMockito.when(PersoniumUnitConfig.class, "isCellCacheEnabled").thenReturn(true); // 事前にキャッシュを登録 CellCache.cache(cellName, cellToCache); @@ -167,8 +167,8 @@ public class CellCacheTest { assertThat(cellFromCache).isEqualTo(cellFromCache); // キャッシュの設定を無効にする - PowerMockito.spy(DcCoreConfig.class); - PowerMockito.when(DcCoreConfig.class, "isCellCacheEnabled").thenReturn(false); + PowerMockito.spy(PersoniumUnitConfig.class); + PowerMockito.when(PersoniumUnitConfig.class, "isCellCacheEnabled").thenReturn(false); // キャッシュを取得できないこと cellFromCache = CellCache.get(cellName); @@ -199,8 +199,8 @@ public class CellCacheTest { PowerMockito.when(CellCache.class, "getMcdClient").thenReturn(mockMemcachedClient); // キャッシュの設定を有効にする - PowerMockito.spy(DcCoreConfig.class); - PowerMockito.when(DcCoreConfig.class, "isCellCacheEnabled").thenReturn(true); + PowerMockito.spy(PersoniumUnitConfig.class); + PowerMockito.when(PersoniumUnitConfig.class, "isCellCacheEnabled").thenReturn(true); // キャッシュに登録できること CellCache.cache(cellName, cellToCache); diff --git a/src/test/java/com/fujitsu/dc/core/model/impl/es/cache/MockMemcachedClient.java b/src/test/java/io/personium/core/model/impl/es/cache/MockMemcachedClient.java similarity index 89% rename from src/test/java/com/fujitsu/dc/core/model/impl/es/cache/MockMemcachedClient.java rename to src/test/java/io/personium/core/model/impl/es/cache/MockMemcachedClient.java index 261919ad2..6153ca438 100644 --- a/src/test/java/com/fujitsu/dc/core/model/impl/es/cache/MockMemcachedClient.java +++ b/src/test/java/io/personium/core/model/impl/es/cache/MockMemcachedClient.java @@ -14,12 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.cache; +package io.personium.core.model.impl.es.cache; import java.util.HashMap; import java.util.Map; -import com.fujitsu.dc.core.utils.CacheClient; +import io.personium.core.utils.CacheClient; /** * テスト用のキャッシュクラス. diff --git a/src/test/java/com/fujitsu/dc/core/model/impl/es/cache/UserDataSchemaCacheTest.java b/src/test/java/io/personium/core/model/impl/es/cache/UserDataSchemaCacheTest.java similarity index 87% rename from src/test/java/com/fujitsu/dc/core/model/impl/es/cache/UserDataSchemaCacheTest.java rename to src/test/java/io/personium/core/model/impl/es/cache/UserDataSchemaCacheTest.java index ddd76b1d1..6b9fe934d 100644 --- a/src/test/java/com/fujitsu/dc/core/model/impl/es/cache/UserDataSchemaCacheTest.java +++ b/src/test/java/io/personium/core/model/impl/es/cache/UserDataSchemaCacheTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.impl.es.cache; +package io.personium.core.model.impl.es.cache; import static org.fest.assertions.Assertions.assertThat; import static org.junit.Assert.assertEquals; @@ -34,17 +34,17 @@ import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.utils.MemcachedClient; -import com.fujitsu.dc.core.utils.MemcachedClient.MemcachedClientException; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.utils.MemcachedClient; +import io.personium.core.utils.MemcachedClient.MemcachedClientException; +import io.personium.test.categories.Unit; /** * UserDataSchemaCache ユニットテストクラス. */ @Category({Unit.class }) @RunWith(PowerMockRunner.class) -@PrepareForTest({UserDataSchemaCache.class, DcCoreConfig.class }) +@PrepareForTest({UserDataSchemaCache.class, PersoniumUnitConfig.class }) public class UserDataSchemaCacheTest { /** @@ -68,8 +68,8 @@ public class UserDataSchemaCacheTest { PowerMockito.when(UserDataSchemaCache.class, "getMcdClient").thenReturn(mockMemcachedClient); // キャッシュの設定を有効にする - PowerMockito.spy(DcCoreConfig.class); - PowerMockito.when(DcCoreConfig.class, "isSchemaCacheEnabled").thenReturn(true); + PowerMockito.spy(PersoniumUnitConfig.class); + PowerMockito.when(PersoniumUnitConfig.class, "isSchemaCacheEnabled").thenReturn(true); // getメソッドのテスト Map cache = UserDataSchemaCache.get(nodeId); @@ -98,8 +98,8 @@ public class UserDataSchemaCacheTest { PowerMockito.when(UserDataSchemaCache.class, "getMcdClient").thenReturn(mockMemcachedClient); // キャッシュの設定を有効にする - PowerMockito.spy(DcCoreConfig.class); - PowerMockito.when(DcCoreConfig.class, "isSchemaCacheEnabled").thenReturn(true); + PowerMockito.spy(PersoniumUnitConfig.class); + PowerMockito.when(PersoniumUnitConfig.class, "isSchemaCacheEnabled").thenReturn(true); // getメソッドのテスト Map cache = UserDataSchemaCache.get(nodeId); @@ -130,8 +130,8 @@ public class UserDataSchemaCacheTest { PowerMockito.when(UserDataSchemaCache.class, "getMcdClient").thenReturn(mockMemcachedClient); // キャッシュの設定を有効にする - PowerMockito.spy(DcCoreConfig.class); - PowerMockito.when(DcCoreConfig.class, "isSchemaCacheEnabled").thenReturn(true); + PowerMockito.spy(PersoniumUnitConfig.class); + PowerMockito.when(PersoniumUnitConfig.class, "isSchemaCacheEnabled").thenReturn(true); // isChangedメソッドのテスト boolean isChanged = UserDataSchemaCache.isChanged(nodeId, data); @@ -161,8 +161,8 @@ public class UserDataSchemaCacheTest { PowerMockito.when(UserDataSchemaCache.class, "getMcdClient").thenReturn(mockMemcachedClient); // キャッシュの設定を有効にする - PowerMockito.spy(DcCoreConfig.class); - PowerMockito.when(DcCoreConfig.class, "isSchemaCacheEnabled").thenReturn(true); + PowerMockito.spy(PersoniumUnitConfig.class); + PowerMockito.when(PersoniumUnitConfig.class, "isSchemaCacheEnabled").thenReturn(true); // isChangedメソッドのテスト boolean isChanged = UserDataSchemaCache.isChanged(nodeId, data); @@ -188,8 +188,8 @@ public class UserDataSchemaCacheTest { PowerMockito.when(UserDataSchemaCache.class, "getMcdClient").thenReturn(mockMemcachedClient); // キャッシュの設定を無効にする - PowerMockito.spy(DcCoreConfig.class); - PowerMockito.when(DcCoreConfig.class, "isSchemaCacheEnabled").thenReturn(false); + PowerMockito.spy(PersoniumUnitConfig.class); + PowerMockito.when(PersoniumUnitConfig.class, "isSchemaCacheEnabled").thenReturn(false); // キャッシュ登録されないこと UserDataSchemaCache.cache(nodeId, schemaToCache); @@ -220,8 +220,8 @@ public class UserDataSchemaCacheTest { PowerMockito.when(UserDataSchemaCache.class, "getMcdClient").thenReturn(mockMemcachedClient); // キャッシュの設定を有効にする - PowerMockito.spy(DcCoreConfig.class); - PowerMockito.when(DcCoreConfig.class, "isSchemaCacheEnabled").thenReturn(true); + PowerMockito.spy(PersoniumUnitConfig.class); + PowerMockito.when(PersoniumUnitConfig.class, "isSchemaCacheEnabled").thenReturn(true); // 事前にキャッシュを登録 UserDataSchemaCache.cache(nodeId, schemaToCache); @@ -230,8 +230,8 @@ public class UserDataSchemaCacheTest { assertThat(schemaFromCache).isEqualTo(schemaFromCache); // キャッシュの設定を無効にする - PowerMockito.spy(DcCoreConfig.class); - PowerMockito.when(DcCoreConfig.class, "isSchemaCacheEnabled").thenReturn(false); + PowerMockito.spy(PersoniumUnitConfig.class); + PowerMockito.when(PersoniumUnitConfig.class, "isSchemaCacheEnabled").thenReturn(false); // キャッシュを取得できないこと schemaFromCache = UserDataSchemaCache.get(nodeId); @@ -260,8 +260,8 @@ public class UserDataSchemaCacheTest { PowerMockito.when(UserDataSchemaCache.class, "getMcdClient").thenReturn(mockMemcachedClient); // キャッシュの設定を無効にする - PowerMockito.spy(DcCoreConfig.class); - PowerMockito.when(DcCoreConfig.class, "isSchemaCacheEnabled").thenReturn(false); + PowerMockito.spy(PersoniumUnitConfig.class); + PowerMockito.when(PersoniumUnitConfig.class, "isSchemaCacheEnabled").thenReturn(false); // isChanged? Map schemaToCacheNew = new HashMap(); @@ -288,8 +288,8 @@ public class UserDataSchemaCacheTest { PowerMockito.when(UserDataSchemaCache.class, "getMcdClient").thenReturn(mockMemcachedClient); // キャッシュの設定を有効にする - PowerMockito.spy(DcCoreConfig.class); - PowerMockito.when(DcCoreConfig.class, "isSchemaCacheEnabled").thenReturn(true); + PowerMockito.spy(PersoniumUnitConfig.class); + PowerMockito.when(PersoniumUnitConfig.class, "isSchemaCacheEnabled").thenReturn(true); // 事前にキャッシュを登録する UserDataSchemaCache.cache(nodeId, schemaToCache); @@ -319,8 +319,8 @@ public class UserDataSchemaCacheTest { PowerMockito.when(UserDataSchemaCache.class, "getMcdClient").thenReturn(mockMemcachedClient); // キャッシュの設定を有効にする - PowerMockito.spy(DcCoreConfig.class); - PowerMockito.when(DcCoreConfig.class, "isSchemaCacheEnabled").thenReturn(true); + PowerMockito.spy(PersoniumUnitConfig.class); + PowerMockito.when(PersoniumUnitConfig.class, "isSchemaCacheEnabled").thenReturn(true); // isChanged? Map schemaToCacheNew = new HashMap(); @@ -347,8 +347,8 @@ public class UserDataSchemaCacheTest { PowerMockito.when(UserDataSchemaCache.class, "getMcdClient").thenReturn(mockMemcachedClient); // キャッシュの設定を有効にする - PowerMockito.spy(DcCoreConfig.class); - PowerMockito.when(DcCoreConfig.class, "isSchemaCacheEnabled").thenReturn(true); + PowerMockito.spy(PersoniumUnitConfig.class); + PowerMockito.when(PersoniumUnitConfig.class, "isSchemaCacheEnabled").thenReturn(true); // 事前にキャッシュを登録する UserDataSchemaCache.cache(nodeId, schemaToCache); @@ -378,8 +378,8 @@ public class UserDataSchemaCacheTest { PowerMockito.when(UserDataSchemaCache.class, "getMcdClient").thenReturn(mockMemcachedClient); // キャッシュの設定を有効にする - PowerMockito.spy(DcCoreConfig.class); - PowerMockito.when(DcCoreConfig.class, "isSchemaCacheEnabled").thenReturn(true); + PowerMockito.spy(PersoniumUnitConfig.class); + PowerMockito.when(PersoniumUnitConfig.class, "isSchemaCacheEnabled").thenReturn(true); // 事前にキャッシュを登録する UserDataSchemaCache.cache(nodeId, schemaToCache); @@ -411,8 +411,8 @@ public class UserDataSchemaCacheTest { PowerMockito.when(UserDataSchemaCache.class, "getMcdClient").thenReturn(mockMemcachedClient); // キャッシュの設定を有効にする - PowerMockito.spy(DcCoreConfig.class); - PowerMockito.when(DcCoreConfig.class, "isSchemaCacheEnabled").thenReturn(true); + PowerMockito.spy(PersoniumUnitConfig.class); + PowerMockito.when(PersoniumUnitConfig.class, "isSchemaCacheEnabled").thenReturn(true); // キャッシュに登録できること UserDataSchemaCache.cache(nodeId, schemaToCache); diff --git a/src/test/java/com/fujitsu/dc/core/model/lock/AccountLockManagerTest.java b/src/test/java/io/personium/core/model/lock/AccountLockManagerTest.java similarity index 81% rename from src/test/java/com/fujitsu/dc/core/model/lock/AccountLockManagerTest.java rename to src/test/java/io/personium/core/model/lock/AccountLockManagerTest.java index 9f1144a93..73bd0e03e 100644 --- a/src/test/java/com/fujitsu/dc/core/model/lock/AccountLockManagerTest.java +++ b/src/test/java/io/personium/core/model/lock/AccountLockManagerTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.lock; +package io.personium.core.model.lock; import static org.junit.Assert.fail; @@ -24,14 +24,14 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; /** * LockManagerユニットテストクラス. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({ Unit.class }) public class AccountLockManagerTest { @@ -59,7 +59,7 @@ public void after() { try { AccountLockManager.registAccountLockObjct("AccountId"); AccountLockManager.registAccountLockObjct("AccountId"); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { fail(); } } diff --git a/src/test/java/com/fujitsu/dc/core/model/lock/AllTests.java b/src/test/java/io/personium/core/model/lock/AllTests.java similarity index 93% rename from src/test/java/com/fujitsu/dc/core/model/lock/AllTests.java rename to src/test/java/io/personium/core/model/lock/AllTests.java index 3ae945e8d..180d6766c 100644 --- a/src/test/java/com/fujitsu/dc/core/model/lock/AllTests.java +++ b/src/test/java/io/personium/core/model/lock/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.lock; +package io.personium.core.model.lock; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/core/model/lock/CellLockManagerTest.java b/src/test/java/io/personium/core/model/lock/CellLockManagerTest.java similarity index 88% rename from src/test/java/com/fujitsu/dc/core/model/lock/CellLockManagerTest.java rename to src/test/java/io/personium/core/model/lock/CellLockManagerTest.java index fd546fac0..8a8525c2f 100644 --- a/src/test/java/com/fujitsu/dc/core/model/lock/CellLockManagerTest.java +++ b/src/test/java/io/personium/core/model/lock/CellLockManagerTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.lock; +package io.personium.core.model.lock; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -26,14 +26,14 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; /** * CellLockManagerユニットテストクラス. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({ Unit.class }) public class CellLockManagerTest { /** @@ -60,7 +60,7 @@ public void after() { try { long count = CellLockManager.getReferenceCount("TestingCellId"); assertEquals(-1, count); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { fail(); } } @@ -75,7 +75,7 @@ public void after() { assertEquals(1, createdResult); long fetchedCount = CellLockManager.getReferenceCount("TestingCellId"); assertEquals(1, fetchedCount); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { fail(); } } @@ -94,7 +94,7 @@ public void after() { long fetchedCount = CellLockManager.getReferenceCount("TestingCellId"); assertEquals(2, fetchedCount); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { fail(); } } @@ -110,7 +110,7 @@ public void after() { long fetchedCount = CellLockManager.getReferenceCount("TestingCellId"); assertEquals(-1, fetchedCount); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { fail(); } } @@ -135,7 +135,7 @@ public void after() { long fetchedCount = CellLockManager.getReferenceCount("TestingCellId"); assertEquals(-1, fetchedCount); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { fail(); } } @@ -151,7 +151,7 @@ public void after() { long fetchedCount = CellLockManager.getCellStatus("TestingCellId"); assertEquals(1, fetchedCount); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { fail(); } } @@ -167,7 +167,7 @@ public void after() { long fetchedCount = CellLockManager.getCellStatus("TestingCellId"); assertEquals(0, fetchedCount); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { fail(); } } @@ -189,7 +189,7 @@ public void after() { fetchedCount = CellLockManager.getCellStatus("TestingCellId"); assertEquals(1, fetchedCount); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { fail(); } } diff --git a/src/test/java/com/fujitsu/dc/core/model/lock/LockManagerTest.java b/src/test/java/io/personium/core/model/lock/LockManagerTest.java similarity index 90% rename from src/test/java/com/fujitsu/dc/core/model/lock/LockManagerTest.java rename to src/test/java/io/personium/core/model/lock/LockManagerTest.java index fb195d25e..43e9a9032 100644 --- a/src/test/java/com/fujitsu/dc/core/model/lock/LockManagerTest.java +++ b/src/test/java/io/personium/core/model/lock/LockManagerTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.model.lock; +package io.personium.core.model.lock; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -27,14 +27,14 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; /** * LockManagerユニットテストクラス. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class }) public class LockManagerTest { @@ -68,8 +68,8 @@ public void before() { try { lock = LockManager.getLock(Lock.CATEGORY_ODATA, lockName, null, null); lock2 = LockManager.getLock(Lock.CATEGORY_ODATA, lockName, null, null); - } catch (DcCoreException e) { - assertEquals(DcCoreException.class, e.getClass()); + } catch (PersoniumCoreException e) { + assertEquals(PersoniumCoreException.class, e.getClass()); } finally { lock.release(); if (lock2 != null) { @@ -160,8 +160,8 @@ public void run() { RetryCountingLockManager rclm = (RetryCountingLockManager) LockManager.singleton; try { LockManager.getLock(Lock.CATEGORY_ODATA, "aaa", null, null); - } catch (DcCoreException e) { - assertEquals(DcCoreException.class, e.getClass()); + } catch (PersoniumCoreException e) { + assertEquals(PersoniumCoreException.class, e.getClass()); } finally { // doGetLock呼び出し回数 は 最初の呼び出しの1回と + リトライ回数 となる assertEquals(LockManager.getLockRetryTimes() + 1, rclm.getCount); diff --git a/src/test/java/com/fujitsu/dc/core/odata/AllTests.java b/src/test/java/io/personium/core/odata/AllTests.java similarity index 89% rename from src/test/java/com/fujitsu/dc/core/odata/AllTests.java rename to src/test/java/io/personium/core/odata/AllTests.java index 545983634..c139f4171 100644 --- a/src/test/java/com/fujitsu/dc/core/odata/AllTests.java +++ b/src/test/java/io/personium/core/odata/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.odata; +package io.personium.core.odata; import org.junit.runner.RunWith; import org.junit.runners.Suite; @@ -25,7 +25,7 @@ */ @RunWith(Suite.class) @SuiteClasses({ - DcJsonWriterTest.class + PersoniumJsonWriterTest.class }) public class AllTests { } diff --git a/src/test/java/com/fujitsu/dc/core/odata/DcJsonWriterTest.java b/src/test/java/io/personium/core/odata/PersoniumJsonWriterTest.java similarity index 93% rename from src/test/java/com/fujitsu/dc/core/odata/DcJsonWriterTest.java rename to src/test/java/io/personium/core/odata/PersoniumJsonWriterTest.java index a9413b960..50ab5b63c 100644 --- a/src/test/java/com/fujitsu/dc/core/odata/DcJsonWriterTest.java +++ b/src/test/java/io/personium/core/odata/PersoniumJsonWriterTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.odata; +package io.personium.core.odata; import static org.junit.Assert.assertEquals; @@ -28,14 +28,14 @@ import org.junit.experimental.theories.Theory; import org.junit.runner.RunWith; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.test.categories.Unit; /** - * DcJsonWriterユニットテストクラス. + * PersoniumJsonWriterユニットテストクラス. */ @RunWith(Enclosed.class) @Category({Unit.class }) -public class DcJsonWriterTest { +public class PersoniumJsonWriterTest { /** * テスト用Fixture。 @@ -118,7 +118,7 @@ public static Fixture[] getFixture() { StringWriter writer = null; try { writer = new StringWriter(); - DcJsonWriter jsonWriter = new DcJsonWriter(writer); + PersoniumJsonWriter jsonWriter = new PersoniumJsonWriter(writer); jsonWriter.writeNumber(f.inputValue); String actual = writer.toString(); assertEquals(f.testComment, f.expectedReturnValue, actual); diff --git a/src/test/java/io/personium/core/rs/AllTests.java b/src/test/java/io/personium/core/rs/AllTests.java new file mode 100644 index 000000000..fc9739b79 --- /dev/null +++ b/src/test/java/io/personium/core/rs/AllTests.java @@ -0,0 +1,31 @@ +/** + * personium.io + * Copyright 2014 FUJITSU LIMITED + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.personium.core.rs; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; +import org.junit.runners.Suite.SuiteClasses; + +/** + * パッケージ配下のテストケースを全て実行するためのテストスイート. + */ +@RunWith(Suite.class) +@SuiteClasses({ + PersoniumCoreExceptionMapperTest.class + }) +public class AllTests { +} diff --git a/src/test/java/com/fujitsu/dc/core/rs/DcCoreExceptionMapperTest.java b/src/test/java/io/personium/core/rs/PersoniumCoreExceptionMapperTest.java similarity index 90% rename from src/test/java/com/fujitsu/dc/core/rs/DcCoreExceptionMapperTest.java rename to src/test/java/io/personium/core/rs/PersoniumCoreExceptionMapperTest.java index a22ada863..da2740368 100644 --- a/src/test/java/com/fujitsu/dc/core/rs/DcCoreExceptionMapperTest.java +++ b/src/test/java/io/personium/core/rs/PersoniumCoreExceptionMapperTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs; +package io.personium.core.rs; import static org.junit.Assert.assertTrue; import javax.ws.rs.core.Response; @@ -28,16 +28,16 @@ import org.slf4j.LoggerFactory; import org.slf4j.Marker; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; /** * 本アプリケーションの例外マッパー. ログ出力と適切な形でのエラー応答出力を行う。 */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({ Unit.class }) -public final class DcCoreExceptionMapperTest { - static Logger log = LoggerFactory.getLogger(DcCoreExceptionMapper.class); +public final class PersoniumCoreExceptionMapperTest { + static Logger log = LoggerFactory.getLogger(PersoniumCoreExceptionMapper.class); // ロガー差し替えをするので、ここに避難させておく. static Logger shelterdLogger; /** @@ -45,14 +45,14 @@ public final class DcCoreExceptionMapperTest { */ @BeforeClass public static void beforeClass() { - shelterdLogger = DcCoreExceptionMapper.log; + shelterdLogger = PersoniumCoreExceptionMapper.log; } /** * AfterClass. */ @AfterClass public static void afterClass() { - DcCoreExceptionMapper.log = shelterdLogger; + PersoniumCoreExceptionMapper.log = shelterdLogger; } /** @@ -60,8 +60,8 @@ public static void afterClass() { */ @Test public void toResponseメソッドが() { - DcCoreExceptionMapper mapper = new DcCoreExceptionMapper(); - DcCoreExceptionMapper.log = new TestLogger() { + PersoniumCoreExceptionMapper mapper = new PersoniumCoreExceptionMapper(); + PersoniumCoreExceptionMapper.log = new TestLogger() { @Override public void error(String msg, Throwable t) { log.debug(msg); diff --git a/src/test/java/com/fujitsu/dc/core/rs/odata/AbstractODataResourceTest.java b/src/test/java/io/personium/core/rs/odata/AbstractODataResourceTest.java similarity index 91% rename from src/test/java/com/fujitsu/dc/core/rs/odata/AbstractODataResourceTest.java rename to src/test/java/io/personium/core/rs/odata/AbstractODataResourceTest.java index fe2acf0a9..2cdb5dbb8 100644 --- a/src/test/java/com/fujitsu/dc/core/rs/odata/AbstractODataResourceTest.java +++ b/src/test/java/io/personium/core/rs/odata/AbstractODataResourceTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.odata; +package io.personium.core.rs.odata; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -31,8 +31,8 @@ import org.odata4j.core.OProperties; import org.odata4j.core.OProperty; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Unit; /** * AbstractODataResourceユニットテストクラス. @@ -117,9 +117,9 @@ public static Fixture[] getFixture() { try { method.invoke(resource, property); } catch (InvocationTargetException ex) { - if (ex.getCause() instanceof DcCoreException) { - DcCoreException e = (DcCoreException) ex.getCause(); - if (DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode().equals(e.getCode())) { + if (ex.getCause() instanceof PersoniumCoreException) { + PersoniumCoreException e = (PersoniumCoreException) ex.getCause(); + if (PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode().equals(e.getCode())) { valildResult = false; } else { fail(f.testComment + ": 期待したエラーコードではない. 例外コード:[" + e.getCode() + "]"); diff --git a/src/test/java/com/fujitsu/dc/core/rs/odata/AllTests.java b/src/test/java/io/personium/core/rs/odata/AllTests.java similarity index 93% rename from src/test/java/com/fujitsu/dc/core/rs/odata/AllTests.java rename to src/test/java/io/personium/core/rs/odata/AllTests.java index 244555b26..9066b5df2 100644 --- a/src/test/java/com/fujitsu/dc/core/rs/odata/AllTests.java +++ b/src/test/java/io/personium/core/rs/odata/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs.odata; +package io.personium.core.rs.odata; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/core/utils/AllTests.java b/src/test/java/io/personium/core/utils/AllTests.java similarity index 93% rename from src/test/java/com/fujitsu/dc/core/utils/AllTests.java rename to src/test/java/io/personium/core/utils/AllTests.java index 83a7bc81f..c27d3b771 100644 --- a/src/test/java/com/fujitsu/dc/core/utils/AllTests.java +++ b/src/test/java/io/personium/core/utils/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.utils; +package io.personium.core.utils; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/core/utils/ODataUtilsTest.java b/src/test/java/io/personium/core/utils/ODataUtilsTest.java similarity index 97% rename from src/test/java/com/fujitsu/dc/core/utils/ODataUtilsTest.java rename to src/test/java/io/personium/core/utils/ODataUtilsTest.java index 313bcc58e..873b47138 100644 --- a/src/test/java/com/fujitsu/dc/core/utils/ODataUtilsTest.java +++ b/src/test/java/io/personium/core/utils/ODataUtilsTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.utils; +package io.personium.core.utils; import static org.junit.Assert.assertEquals; @@ -25,7 +25,7 @@ import org.junit.experimental.theories.Theory; import org.junit.runner.RunWith; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.test.categories.Unit; /** * ODataUtilsユニットテストクラス. diff --git a/src/test/java/com/fujitsu/dc/core/webcontainer/listener/AllTests.java b/src/test/java/io/personium/core/webcontainer/listener/AllTests.java similarity index 91% rename from src/test/java/com/fujitsu/dc/core/webcontainer/listener/AllTests.java rename to src/test/java/io/personium/core/webcontainer/listener/AllTests.java index fe8a73d76..eb745c42c 100644 --- a/src/test/java/com/fujitsu/dc/core/webcontainer/listener/AllTests.java +++ b/src/test/java/io/personium/core/webcontainer/listener/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.webcontainer.listener; +package io.personium.core.webcontainer.listener; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/core/webcontainer/listener/RepairServiceLauncherTest.java b/src/test/java/io/personium/core/webcontainer/listener/RepairServiceLauncherTest.java similarity index 97% rename from src/test/java/com/fujitsu/dc/core/webcontainer/listener/RepairServiceLauncherTest.java rename to src/test/java/io/personium/core/webcontainer/listener/RepairServiceLauncherTest.java index d0cfb5a73..b3ede92a2 100644 --- a/src/test/java/com/fujitsu/dc/core/webcontainer/listener/RepairServiceLauncherTest.java +++ b/src/test/java/io/personium/core/webcontainer/listener/RepairServiceLauncherTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.webcontainer.listener; +package io.personium.core.webcontainer.listener; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; @@ -33,7 +33,7 @@ import org.junit.runners.JUnit4; /** - * com.fujitsu.dc.core.webcontainer.listener.RepairServiceLauncherのテスト. + * io.personium.core.webcontainer.listener.RepairServiceLauncherのテスト. */ @RunWith(JUnit4.class) public class RepairServiceLauncherTest { diff --git a/src/test/java/com/fujitsu/dc/test/CompareJSON.java b/src/test/java/io/personium/test/CompareJSON.java similarity index 97% rename from src/test/java/com/fujitsu/dc/test/CompareJSON.java rename to src/test/java/io/personium/test/CompareJSON.java index 10cd9ec73..e2ce7c943 100644 --- a/src/test/java/com/fujitsu/dc/test/CompareJSON.java +++ b/src/test/java/io/personium/test/CompareJSON.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test; +package io.personium.test; import java.util.Arrays; import java.util.HashMap; diff --git a/src/test/java/io/personium/test/IntegrationTests.java b/src/test/java/io/personium/test/IntegrationTests.java new file mode 100644 index 000000000..f67653205 --- /dev/null +++ b/src/test/java/io/personium/test/IntegrationTests.java @@ -0,0 +1,68 @@ +/** + * personium.io + * Copyright 2014 FUJITSU LIMITED + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.personium.test; + +import junit.framework.TestSuite; + +import org.junit.experimental.categories.Categories; +import org.junit.experimental.categories.Categories.IncludeCategory; +import org.junit.runner.RunWith; +import org.junit.runners.Suite.SuiteClasses; + +import io.personium.test.categories.Integration; + +/** + * 結合テスト用テストスイート. + */ +@RunWith(Categories.class) +@SuiteClasses({ + io.personium.core.AllTests.class, + io.personium.core.model.file.AllTests.class, + io.personium.core.model.impl.es.AllTests.class, + io.personium.core.model.impl.es.accessor.AllTests.class, + io.personium.core.model.impl.es.ads.AllTests.class, + io.personium.core.model.lock.AllTests.class, + io.personium.core.rs.AllTests.class, + io.personium.test.jersey.AllTests.class, + io.personium.test.jersey.bar.AllTests.class, + io.personium.test.jersey.box.AllTests.class, + io.personium.test.jersey.box.odatacol.AllTests.class, + io.personium.test.jersey.box.odatacol.schema.assocend.AllTests.class, + io.personium.test.jersey.box.odatacol.schema.complextype.AllTests.class, + io.personium.test.jersey.box.odatacol.schema.complextypeproperty.AllTests.class, + io.personium.test.jersey.box.odatacol.schema.entitytype.AllTests.class, + io.personium.test.jersey.box.odatacol.schema.property.AllTests.class, + io.personium.test.jersey.cell.AllTests.class, + io.personium.test.jersey.cell.auth.AllTests.class, + io.personium.test.jersey.cell.auth.token.AllTests.class, + io.personium.test.jersey.cell.ctl.AllTests.class, + io.personium.test.jersey.concurrent.AllTests.class, + io.personium.test.performance.box.odatacol.AllTests.class, + io.personium.test.unit.core.AllTests.class, + io.personium.test.unit.core.auth.AllTests.class, + io.personium.test.unit.core.bar.AllTests.class, + io.personium.test.unit.core.jersey.filter.AllTests.class, + io.personium.test.unit.core.model.AllTests.class, + io.personium.test.unit.core.model.impl.es.AllTests.class, + io.personium.test.unit.core.model.impl.es.doc.AllTests.class, + io.personium.test.unit.core.model.impl.es.odata.AllTests.class, + io.personium.test.unit.core.rs.odata.AllTests.class, + io.personium.test.unit.core.rs.odata.validate.AllTests.class +}) +@IncludeCategory(Integration.class) +public class IntegrationTests extends TestSuite { +} diff --git a/src/test/java/io/personium/test/PerformanceTests.java b/src/test/java/io/personium/test/PerformanceTests.java new file mode 100644 index 000000000..7e2f44803 --- /dev/null +++ b/src/test/java/io/personium/test/PerformanceTests.java @@ -0,0 +1,68 @@ +/** + * personium.io + * Copyright 2014 FUJITSU LIMITED + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.personium.test; + +import junit.framework.TestSuite; + +import org.junit.experimental.categories.Categories; +import org.junit.experimental.categories.Categories.IncludeCategory; +import org.junit.runner.RunWith; +import org.junit.runners.Suite.SuiteClasses; + +import io.personium.test.categories.Performance; + +/** + * 結合テスト用テストスイート. + */ +@RunWith(Categories.class) +@SuiteClasses({ + io.personium.core.AllTests.class, + io.personium.core.model.file.AllTests.class, + io.personium.core.model.impl.es.AllTests.class, + io.personium.core.model.impl.es.accessor.AllTests.class, + io.personium.core.model.impl.es.ads.AllTests.class, + io.personium.core.model.lock.AllTests.class, + io.personium.core.rs.AllTests.class, + io.personium.test.jersey.AllTests.class, + io.personium.test.jersey.bar.AllTests.class, + io.personium.test.jersey.box.AllTests.class, + io.personium.test.jersey.box.odatacol.AllTests.class, + io.personium.test.jersey.box.odatacol.schema.assocend.AllTests.class, + io.personium.test.jersey.box.odatacol.schema.complextype.AllTests.class, + io.personium.test.jersey.box.odatacol.schema.complextypeproperty.AllTests.class, + io.personium.test.jersey.box.odatacol.schema.entitytype.AllTests.class, + io.personium.test.jersey.box.odatacol.schema.property.AllTests.class, + io.personium.test.jersey.cell.AllTests.class, + io.personium.test.jersey.cell.auth.AllTests.class, + io.personium.test.jersey.cell.auth.token.AllTests.class, + io.personium.test.jersey.cell.ctl.AllTests.class, + io.personium.test.jersey.concurrent.AllTests.class, + io.personium.test.performance.box.odatacol.AllTests.class, + io.personium.test.unit.core.AllTests.class, + io.personium.test.unit.core.auth.AllTests.class, + io.personium.test.unit.core.bar.AllTests.class, + io.personium.test.unit.core.jersey.filter.AllTests.class, + io.personium.test.unit.core.model.AllTests.class, + io.personium.test.unit.core.model.impl.es.AllTests.class, + io.personium.test.unit.core.model.impl.es.doc.AllTests.class, + io.personium.test.unit.core.model.impl.es.odata.AllTests.class, + io.personium.test.unit.core.rs.odata.AllTests.class, + io.personium.test.unit.core.rs.odata.validate.AllTests.class +}) +@IncludeCategory(Performance.class) +public class PerformanceTests extends TestSuite { +} diff --git a/src/test/java/com/fujitsu/dc/test/DcCoreTestConfig.java b/src/test/java/io/personium/test/PersoniumCoreTestConfig.java similarity index 82% rename from src/test/java/com/fujitsu/dc/test/DcCoreTestConfig.java rename to src/test/java/io/personium/test/PersoniumCoreTestConfig.java index fe02ce0f8..c7ade89fd 100644 --- a/src/test/java/com/fujitsu/dc/test/DcCoreTestConfig.java +++ b/src/test/java/io/personium/test/PersoniumCoreTestConfig.java @@ -14,18 +14,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test; +package io.personium.test; -import com.fujitsu.dc.core.DcCoreConfig; +import io.personium.core.PersoniumUnitConfig; /** * Coreのテスト用設定を定義するクラス. */ -public class DcCoreTestConfig { +public class PersoniumCoreTestConfig { private static final String PROP_TARGET_VERSION = "io.personium.test.target.version"; - private DcCoreTestConfig() { + private PersoniumCoreTestConfig() { } /** @@ -34,7 +34,7 @@ private DcCoreTestConfig() { * @return テスト時に指定するターゲットバージョン */ public static String getCoreVersion() { - return System.getProperty(PROP_TARGET_VERSION, DcCoreConfig.getCoreVersion()); + return System.getProperty(PROP_TARGET_VERSION, PersoniumUnitConfig.getCoreVersion()); } } diff --git a/src/test/java/io/personium/test/RegressionTests.java b/src/test/java/io/personium/test/RegressionTests.java new file mode 100644 index 000000000..0901d426d --- /dev/null +++ b/src/test/java/io/personium/test/RegressionTests.java @@ -0,0 +1,68 @@ +/** + * personium.io + * Copyright 2014 FUJITSU LIMITED + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.personium.test; + +import junit.framework.TestSuite; + +import org.junit.experimental.categories.Categories; +import org.junit.experimental.categories.Categories.IncludeCategory; +import org.junit.runner.RunWith; +import org.junit.runners.Suite.SuiteClasses; + +import io.personium.test.categories.Regression; + +/** + * 結合テスト用テストスイート. + */ +@RunWith(Categories.class) +@SuiteClasses({ + io.personium.core.AllTests.class, + io.personium.core.model.file.AllTests.class, + io.personium.core.model.impl.es.AllTests.class, + io.personium.core.model.impl.es.accessor.AllTests.class, + io.personium.core.model.impl.es.ads.AllTests.class, + io.personium.core.model.lock.AllTests.class, + io.personium.core.rs.AllTests.class, + io.personium.test.jersey.AllTests.class, + io.personium.test.jersey.bar.AllTests.class, + io.personium.test.jersey.box.AllTests.class, + io.personium.test.jersey.box.odatacol.AllTests.class, + io.personium.test.jersey.box.odatacol.schema.assocend.AllTests.class, + io.personium.test.jersey.box.odatacol.schema.complextype.AllTests.class, + io.personium.test.jersey.box.odatacol.schema.complextypeproperty.AllTests.class, + io.personium.test.jersey.box.odatacol.schema.entitytype.AllTests.class, + io.personium.test.jersey.box.odatacol.schema.property.AllTests.class, + io.personium.test.jersey.cell.AllTests.class, + io.personium.test.jersey.cell.auth.AllTests.class, + io.personium.test.jersey.cell.auth.token.AllTests.class, + io.personium.test.jersey.cell.ctl.AllTests.class, + io.personium.test.jersey.concurrent.AllTests.class, + io.personium.test.performance.box.odatacol.AllTests.class, + io.personium.test.unit.core.AllTests.class, + io.personium.test.unit.core.auth.AllTests.class, + io.personium.test.unit.core.bar.AllTests.class, + io.personium.test.unit.core.jersey.filter.AllTests.class, + io.personium.test.unit.core.model.AllTests.class, + io.personium.test.unit.core.model.impl.es.AllTests.class, + io.personium.test.unit.core.model.impl.es.doc.AllTests.class, + io.personium.test.unit.core.model.impl.es.odata.AllTests.class, + io.personium.test.unit.core.rs.odata.AllTests.class, + io.personium.test.unit.core.rs.odata.validate.AllTests.class +}) +@IncludeCategory(Regression.class) +public class RegressionTests extends TestSuite { +} diff --git a/src/test/java/com/fujitsu/dc/test/SingleJUnitTestRunner.java b/src/test/java/io/personium/test/SingleJUnitTestRunner.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/SingleJUnitTestRunner.java rename to src/test/java/io/personium/test/SingleJUnitTestRunner.java index 875a27a91..0ec0a20ee 100644 --- a/src/test/java/com/fujitsu/dc/test/SingleJUnitTestRunner.java +++ b/src/test/java/io/personium/test/SingleJUnitTestRunner.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test; +package io.personium.test; import org.junit.runner.JUnitCore; import org.junit.runner.Request; diff --git a/src/test/java/io/personium/test/UnitTests.java b/src/test/java/io/personium/test/UnitTests.java new file mode 100644 index 000000000..818b5c405 --- /dev/null +++ b/src/test/java/io/personium/test/UnitTests.java @@ -0,0 +1,71 @@ +/** + * personium.io + * Copyright 2014 FUJITSU LIMITED + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.personium.test; + +import junit.framework.TestSuite; + +import org.junit.experimental.categories.Categories; +import org.junit.experimental.categories.Categories.IncludeCategory; +import org.junit.runner.RunWith; +import org.junit.runners.Suite.SuiteClasses; + +import io.personium.test.categories.Integration; + +/** + * 結合テスト用テストスイート. + */ +@RunWith(Categories.class) +@SuiteClasses({ + io.personium.core.AllTests.class, + io.personium.core.model.file.AllTests.class, + io.personium.core.model.impl.es.AllTests.class, + io.personium.core.model.impl.es.accessor.AllTests.class, + io.personium.core.model.impl.es.ads.AllTests.class, + io.personium.core.model.lock.AllTests.class, + io.personium.core.odata.AllTests.class, + io.personium.core.rs.odata.AllTests.class, + io.personium.core.rs.AllTests.class, + io.personium.core.utils.AllTests.class, + io.personium.test.jersey.AllTests.class, + io.personium.test.jersey.bar.AllTests.class, + io.personium.test.jersey.box.AllTests.class, + io.personium.test.jersey.box.odatacol.AllTests.class, + io.personium.test.jersey.box.odatacol.schema.assocend.AllTests.class, + io.personium.test.jersey.box.odatacol.schema.complextype.AllTests.class, + io.personium.test.jersey.box.odatacol.schema.complextypeproperty.AllTests.class, + io.personium.test.jersey.box.odatacol.schema.entitytype.AllTests.class, + io.personium.test.jersey.box.odatacol.schema.property.AllTests.class, + io.personium.test.jersey.cell.AllTests.class, + io.personium.test.jersey.cell.auth.AllTests.class, + io.personium.test.jersey.cell.auth.token.AllTests.class, + io.personium.test.jersey.cell.ctl.AllTests.class, + io.personium.test.jersey.concurrent.AllTests.class, + io.personium.test.performance.box.odatacol.AllTests.class, + io.personium.test.unit.core.AllTests.class, + io.personium.test.unit.core.auth.AllTests.class, + io.personium.test.unit.core.bar.AllTests.class, + io.personium.test.unit.core.jersey.filter.AllTests.class, + io.personium.test.unit.core.model.AllTests.class, + io.personium.test.unit.core.model.impl.es.AllTests.class, + io.personium.test.unit.core.model.impl.es.doc.AllTests.class, + io.personium.test.unit.core.model.impl.es.odata.AllTests.class, + io.personium.test.unit.core.rs.odata.AllTests.class, + io.personium.test.unit.core.rs.odata.validate.AllTests.class +}) +@IncludeCategory(Integration.class) +public class UnitTests extends TestSuite { +} diff --git a/src/test/java/com/fujitsu/dc/test/categories/Integration.java b/src/test/java/io/personium/test/categories/Integration.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/categories/Integration.java rename to src/test/java/io/personium/test/categories/Integration.java index 3a4e8b225..088ce10a5 100644 --- a/src/test/java/com/fujitsu/dc/test/categories/Integration.java +++ b/src/test/java/io/personium/test/categories/Integration.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.categories; +package io.personium.test.categories; /** * 結合テスト用マーカーインタフェース. diff --git a/src/test/java/com/fujitsu/dc/test/categories/Performance.java b/src/test/java/io/personium/test/categories/Performance.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/categories/Performance.java rename to src/test/java/io/personium/test/categories/Performance.java index b22ddff93..ec9af1c81 100644 --- a/src/test/java/com/fujitsu/dc/test/categories/Performance.java +++ b/src/test/java/io/personium/test/categories/Performance.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.categories; +package io.personium.test.categories; /** * パフォーマンステスト用マーカーインタフェース. diff --git a/src/test/java/com/fujitsu/dc/test/categories/Regression.java b/src/test/java/io/personium/test/categories/Regression.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/categories/Regression.java rename to src/test/java/io/personium/test/categories/Regression.java index 755238ed7..49e035ea5 100644 --- a/src/test/java/com/fujitsu/dc/test/categories/Regression.java +++ b/src/test/java/io/personium/test/categories/Regression.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.categories; +package io.personium.test.categories; /** * リグレッションテスト用マーカーインタフェース. diff --git a/src/test/java/com/fujitsu/dc/test/categories/Unit.java b/src/test/java/io/personium/test/categories/Unit.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/categories/Unit.java rename to src/test/java/io/personium/test/categories/Unit.java index b4ba7476b..f966b907e 100644 --- a/src/test/java/com/fujitsu/dc/test/categories/Unit.java +++ b/src/test/java/io/personium/test/categories/Unit.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.categories; +package io.personium.test.categories; /** * ユニットテスト用マーカーインタフェース. diff --git a/src/test/java/com/fujitsu/dc/test/jersey/AbstractCase.java b/src/test/java/io/personium/test/jersey/AbstractCase.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/AbstractCase.java rename to src/test/java/io/personium/test/jersey/AbstractCase.java index 4fae792dc..81ef58a1c 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/AbstractCase.java +++ b/src/test/java/io/personium/test/jersey/AbstractCase.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey; +package io.personium.test.jersey; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -45,17 +45,17 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.model.Box; +import io.personium.core.model.Cell; +import io.personium.test.unit.core.UrlUtils; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; /** * JerseyTestFrameworkを利用したユニットテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Ignore public class AbstractCase extends JerseyTest { @@ -63,7 +63,7 @@ public class AbstractCase extends JerseyTest { private Log log; /** マスタートークン. */ - public static final String MASTER_TOKEN_NAME = DcCoreConfig.getMasterToken(); + public static final String MASTER_TOKEN_NAME = PersoniumUnitConfig.getMasterToken(); /** マスタートークン(Bearer + MASTER_TOKEN_NAME). */ public static final String BEARER_MASTER_TOKEN = "Bearer " + MASTER_TOKEN_NAME; /** クエリフォーマット xml. */ @@ -132,9 +132,9 @@ public final void setHeaders(final HashMap newHeaders) { * @return Cell作成時のレスポンスオブジェクト */ @SuppressWarnings("unchecked") - public final DcResponse createCell(final String cellName) { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + public final PersoniumResponse createCell(final String cellName) { + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -161,9 +161,9 @@ public final DcResponse createCell(final String cellName) { * @return Box作成時のレスポンスオブジェクト */ @SuppressWarnings("unchecked") - public final DcResponse createBox(final String cellName, final String boxName) { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + public final PersoniumResponse createBox(final String cellName, final String boxName) { + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -188,9 +188,9 @@ public final DcResponse createBox(final String cellName, final String boxName) { * @param url リクエスト先のURL * @return レスポンスオブジェクト */ - public final DcResponse restGet(final String url) { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + public final PersoniumResponse restGet(final String url) { + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; if (this.headers == null) { // setHeadersで設定されていない場合、リクエストヘッダをセット @@ -214,9 +214,9 @@ public final DcResponse restGet(final String url) { * @param data postデータ * @return レスポンスオブジェクト */ - public final DcResponse restPost(final String url, final String data) { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + public final PersoniumResponse restPost(final String url, final String data) { + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -237,9 +237,9 @@ public final DcResponse restPost(final String url, final String data) { * @param data リクエストデータ * @return レスポンスオブジェクト */ - public final DcResponse restPut(final String url, final String data) { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + public final PersoniumResponse restPut(final String url, final String data) { + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -259,9 +259,9 @@ public final DcResponse restPut(final String url, final String data) { * @param url リクエスト先のURL * @return レスポンスオブジェクト */ - public final DcResponse restDelete(final String url) { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + public final PersoniumResponse restDelete(final String url) { + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -282,9 +282,9 @@ public final DcResponse restDelete(final String url) { * @param req リクエストパラメータ * @return res */ - public static DcResponse request(DcRequest req) { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + public static PersoniumResponse request(PersoniumRequest req) { + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; String method = req.getMethod(); try { // リクエスト @@ -593,7 +593,7 @@ public final void checkDomainResponse(final JSONObject doc, final String locatio * @param response DcResponseオブジェクト * @param contentType レスポンスのContentType */ - public final void checkCellListResponse(DcResponse response, MediaType contentType) { + public final void checkCellListResponse(PersoniumResponse response, MediaType contentType) { // Cell作成のレスポンスチェック // 200になることを確認 @@ -627,7 +627,7 @@ public final void checkCellListResponse(DcResponse response, MediaType contentTy * @param response DcResponseオブジェクト * @param contentType レスポンスのContentType */ - public final void checkDomainListResponse(DcResponse response, MediaType contentType) { + public final void checkDomainListResponse(PersoniumResponse response, MediaType contentType) { // Cell取得のレスポンスチェック // 200になることを確認 diff --git a/src/test/java/com/fujitsu/dc/test/jersey/AcceptEncodingTest.java b/src/test/java/io/personium/test/jersey/AcceptEncodingTest.java similarity index 78% rename from src/test/java/com/fujitsu/dc/test/jersey/AcceptEncodingTest.java rename to src/test/java/io/personium/test/jersey/AcceptEncodingTest.java index 9a23200ff..285dad225 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/AcceptEncodingTest.java +++ b/src/test/java/io/personium/test/jersey/AcceptEncodingTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey; +package io.personium.test.jersey; import static org.junit.Assert.assertEquals; @@ -25,17 +25,17 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.core.model.Cell; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.unit.core.UrlUtils; /** * Accept-Encodingヘッダのテスト. * Accept-Encodingヘッダを処理するミドルウェアが存在しない場合はテストが失敗する。 */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class AcceptEncodingTest extends AbstractCase { @@ -43,7 +43,7 @@ public class AcceptEncodingTest extends AbstractCase { * コンストラクタ. */ public AcceptEncodingTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -52,11 +52,11 @@ public AcceptEncodingTest() { @Test public final void Accept_Encodingヘッダにgzipを指定した場合にレスポンスボディがgzipで返却されること() { String locationUrlGet = UrlUtils.unitCtl(Cell.EDM_TYPE_NAME); - DcRequest req = DcRequest.get(locationUrlGet + "?$inlinecount=allpages"); + PersoniumRequest req = PersoniumRequest.get(locationUrlGet + "?$inlinecount=allpages"); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.ACCEPT_ENCODING, "gzip"); - DcResponse res = AbstractCase.request(req); + PersoniumResponse res = AbstractCase.request(req); // GZip 圧縮されていることをレスポンスヘッダから確認する String contentEncodingHeader = res.getFirstHeader(HttpHeaders.CONTENT_ENCODING); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/AllTests.java b/src/test/java/io/personium/test/jersey/AllTests.java similarity index 93% rename from src/test/java/com/fujitsu/dc/test/jersey/AllTests.java rename to src/test/java/io/personium/test/jersey/AllTests.java index d0c69d9a0..648686b31 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/AllTests.java +++ b/src/test/java/io/personium/test/jersey/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey; +package io.personium.test.jersey; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/CrossDomainTest.java b/src/test/java/io/personium/test/jersey/CrossDomainTest.java similarity index 88% rename from src/test/java/com/fujitsu/dc/test/jersey/CrossDomainTest.java rename to src/test/java/io/personium/test/jersey/CrossDomainTest.java index 7b0df3011..e8c4cd9ce 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/CrossDomainTest.java +++ b/src/test/java/io/personium/test/jersey/CrossDomainTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey; +package io.personium.test.jersey; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -28,23 +28,23 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.common.utils.DcCoreUtils.HttpHeaders; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.model.ctl.ReceivedMessage; -import com.fujitsu.dc.core.model.ctl.SentMessage; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.common.utils.PersoniumCoreUtils.HttpHeaders; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.model.ctl.ReceivedMessage; +import io.personium.core.model.ctl.SentMessage; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; /** * 認証のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class CrossDomainTest extends JerseyTest { @@ -61,13 +61,13 @@ public class CrossDomainTest extends JerseyTest { private static final Map INIT_PARAMS = new HashMap(); static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("javax.ws.rs.Application", - "com.fujitsu.dc.core.rs.DcCoreApplication"); + "io.personium.core.rs.PersoniumCoreApplication"); INIT_PARAMS.put("com.sun.jersey.config.feature.DisableWADL", "true"); } @@ -105,7 +105,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/__ctl") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -120,7 +120,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/__ctl") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -135,7 +135,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/__ctl/\\$metadata") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -150,7 +150,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/__ctl/\\$metadata") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -165,7 +165,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/__ctl/Cell") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -180,7 +180,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/__ctl/Cell") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -195,7 +195,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/__ctl/Cell('hoho')") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -210,7 +210,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/__ctl/Cell('hoho')") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_NOT_FOUND) .debug(); @@ -225,7 +225,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/__auth") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -240,7 +240,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1/__auth") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_METHOD_NOT_ALLOWED) .debug(); @@ -255,7 +255,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -270,7 +270,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -285,7 +285,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/__ctl") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -300,7 +300,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1/__ctl") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -315,7 +315,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/__ctl/Account") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -330,7 +330,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1/__ctl/Account") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -345,7 +345,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/__ctl/Account('id')") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -360,7 +360,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1/__ctl/Account('id')") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_NOT_FOUND) .debug(); @@ -375,7 +375,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/__ctl/" + SentMessage.EDM_TYPE_NAME + "('id')") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -390,7 +390,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1/__ctl/" + SentMessage.EDM_TYPE_NAME + "('id')") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_NOT_FOUND) .debug(); @@ -405,7 +405,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/__ctl/" + SentMessage.EDM_TYPE_NAME) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -420,7 +420,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1/__ctl/" + SentMessage.EDM_TYPE_NAME) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -435,7 +435,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/__ctl/" + ReceivedMessage.EDM_TYPE_NAME) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -450,7 +450,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1/__ctl/" + ReceivedMessage.EDM_TYPE_NAME) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -465,7 +465,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/__ctl/" + ReceivedMessage.EDM_TYPE_NAME + "('id')") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -480,7 +480,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1/__ctl/" + ReceivedMessage.EDM_TYPE_NAME + "('id')") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_NOT_FOUND) .debug(); @@ -495,7 +495,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/__ctl/ExtRole") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -510,7 +510,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1/__ctl/ExtRole") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -525,7 +525,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/__ctl/ExtRole('id')") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -540,7 +540,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1/__ctl/ExtRole('id')") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_NOT_FOUND) .debug(); @@ -555,7 +555,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/__ctl/Relation") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -570,7 +570,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1/__ctl/Relation") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -585,7 +585,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/__ctl/Relation('id')") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -600,7 +600,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1/__ctl/Relation('id')") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_NOT_FOUND) .debug(); @@ -615,7 +615,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/__ctl/Role") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -630,7 +630,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1/__ctl/Role") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -645,7 +645,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/__ctl/Role('id')") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -660,7 +660,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1/__ctl/Role('id')") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_NOT_FOUND) .debug(); @@ -675,7 +675,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/__ctl/Account('account14')/\\$links/_Role") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -690,7 +690,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1/__ctl/Account('account4')/\\$links/_Role") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -705,7 +705,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/__ctl/Box") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -720,7 +720,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1/__ctl/Box") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -735,7 +735,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/__ctl/Box('id')") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -750,7 +750,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1/__ctl/Box('id')") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_NOT_FOUND) .debug(); @@ -765,7 +765,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/__ctl/ExtCell") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -780,7 +780,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1/__ctl/ExtCell") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -795,7 +795,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/__ctl/ExtCell('id')") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -810,7 +810,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1/__ctl/ExtCell('id')") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_NOT_FOUND) .debug(); @@ -825,7 +825,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/box1") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -840,7 +840,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1/box1") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -859,7 +859,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/box1/servicecol") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -882,7 +882,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1/box1/servicecol") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_METHOD_NOT_ALLOWED) .debug(); @@ -907,7 +907,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/box1/servicecol/service") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -932,7 +932,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1/box1/servicecol/service") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_METHOD_NOT_ALLOWED) .debug(); @@ -955,7 +955,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/box1/davcol") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -978,7 +978,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1/box1/davcol") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -1001,7 +1001,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/box1/davcol/test.txt") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -1024,7 +1024,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1/box1/davcol/test.txt") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_NOT_FOUND) .debug(); @@ -1047,7 +1047,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/box1/odatacol") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -1070,7 +1070,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1/box1/odatacol") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -1093,7 +1093,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/box1/odatacol/\\$metadata") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -1116,7 +1116,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1/box1/odatacol/\\$metadata") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -1138,20 +1138,20 @@ public CrossDomainTest() { createODataCollection(); // EntityTypeの作成 - EntityTypeUtils.create(TEST_CELL1, DcCoreConfig.getMasterToken(), ODATA_COL, + EntityTypeUtils.create(TEST_CELL1, PersoniumUnitConfig.getMasterToken(), ODATA_COL, entSetName, HttpStatus.SC_CREATED); TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/box1/odatacol/entity") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); checkXHR2Header(response, "OPTIONS, GET, POST"); } finally { // EntityTypeの削除 - EntityTypeUtils.delete(ODATA_COL, DcCoreConfig.getMasterToken(), "application/xml", + EntityTypeUtils.delete(ODATA_COL, PersoniumUnitConfig.getMasterToken(), "application/xml", entSetName, TEST_CELL1, -1); // コレクションの削除 deleteODataCollection(); @@ -1169,20 +1169,20 @@ public CrossDomainTest() { createODataCollection(); // EntityTypeの作成 - EntityTypeUtils.create(TEST_CELL1, DcCoreConfig.getMasterToken(), ODATA_COL, + EntityTypeUtils.create(TEST_CELL1, PersoniumUnitConfig.getMasterToken(), ODATA_COL, entSetName, HttpStatus.SC_CREATED); TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1/box1/odatacol/entity") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); checkXHR2HeaderOnlyOrigin(response); } finally { // EntityTypeの削除 - EntityTypeUtils.delete(ODATA_COL, DcCoreConfig.getMasterToken(), "application/xml", + EntityTypeUtils.delete(ODATA_COL, PersoniumUnitConfig.getMasterToken(), "application/xml", entSetName, TEST_CELL1, -1); // コレクションの削除 deleteODataCollection(); @@ -1202,20 +1202,20 @@ public CrossDomainTest() { createODataCollection(); // EntityTypeの作成 - EntityTypeUtils.create(TEST_CELL1, DcCoreConfig.getMasterToken(), ODATA_COL, + EntityTypeUtils.create(TEST_CELL1, PersoniumUnitConfig.getMasterToken(), ODATA_COL, entSetName, HttpStatus.SC_CREATED); TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/box1/odatacol/id") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); checkXHR2Header(response, "OPTIONS, GET, PUT, MERGE, DELETE"); } finally { // EntityTypeの削除 - EntityTypeUtils.delete(ODATA_COL, DcCoreConfig.getMasterToken(), "application/xml", + EntityTypeUtils.delete(ODATA_COL, PersoniumUnitConfig.getMasterToken(), "application/xml", entSetName, TEST_CELL1, -1); // コレクションの削除 deleteODataCollection(); @@ -1235,7 +1235,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1/box1/odatacol/entity('id')") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_NOT_FOUND) .debug(); @@ -1254,7 +1254,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/box1/setodata/SalesDetail('userdata001')/_Sales") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -1269,7 +1269,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight-no-access-control-allow-headers.txt") .with("path", "/testcell1/box1/odatacol/SalesDetail('userdata001')/_Sales") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_NOT_FOUND) .debug(); @@ -1284,7 +1284,7 @@ public CrossDomainTest() { TResponse response = Http.request("crossdomain/xhr2-preflight.txt") .with("path", "/testcell1/box1/setodata/SalesDetail('userdata001')/_Sales") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -1388,16 +1388,16 @@ private void checkXHR2HeaderOnlyOrigin(TResponse response) { } /** - * X-Dc-Versionヘッダーが存在していることを確認する. + * X-Personium-Versionヘッダーが存在していることを確認する. * @params response レスポンス情報 * @params allowMethod 許可メソッド */ private void checkDcVersionHeader(TResponse response) { - if (DcCoreConfig.getCoreVersion().compareTo("1.1.0") >= 0) { - response.checkHeader(HttpHeaders.X_DC_VERSION, DcCoreConfig.getCoreVersion()); + if (PersoniumUnitConfig.getCoreVersion().compareTo("1.1.0") >= 0) { + response.checkHeader(HttpHeaders.X_PERSONIUM_VERSION, PersoniumUnitConfig.getCoreVersion()); } else { - // Versionが1.1.0より古い場合は、X-Dc-Versionヘッダーを返さない - response.checkHeader(HttpHeaders.X_DC_VERSION, null); + // Versionが1.1.0より古い場合は、X-Personium-Versionヘッダーを返さない + response.checkHeader(HttpHeaders.X_PERSONIUM_VERSION, null); } } } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/DaoException.java b/src/test/java/io/personium/test/jersey/DaoException.java similarity index 95% rename from src/test/java/com/fujitsu/dc/test/jersey/DaoException.java rename to src/test/java/io/personium/test/jersey/DaoException.java index 4141ce7b1..783f13e0f 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/DaoException.java +++ b/src/test/java/io/personium/test/jersey/DaoException.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey; +package io.personium.test.jersey; import org.json.simple.JSONObject; import org.json.simple.JSONValue; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/HttpClientFactory.java b/src/test/java/io/personium/test/jersey/HttpClientFactory.java similarity index 99% rename from src/test/java/com/fujitsu/dc/test/jersey/HttpClientFactory.java rename to src/test/java/io/personium/test/jersey/HttpClientFactory.java index ab05876fb..486bab4f4 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/HttpClientFactory.java +++ b/src/test/java/io/personium/test/jersey/HttpClientFactory.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey; +package io.personium.test.jersey; import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/ODataCommon.java b/src/test/java/io/personium/test/jersey/ODataCommon.java similarity index 90% rename from src/test/java/com/fujitsu/dc/test/jersey/ODataCommon.java rename to src/test/java/io/personium/test/jersey/ODataCommon.java index aed3186e7..5242d1771 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/ODataCommon.java +++ b/src/test/java/io/personium/test/jersey/ODataCommon.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey; +package io.personium.test.jersey; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -39,16 +39,16 @@ import org.junit.runner.RunWith; import org.odata4j.core.ODataConstants; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.Cell; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.WebAppDescriptor; /** * ODataリソース関連の共通テスト処理. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Ignore public class ODataCommon extends AbstractCase { @@ -58,7 +58,7 @@ public class ODataCommon extends AbstractCase { public static final int COUNT_NONE = -1; /** DcResponseオブジェクト. */ - private DcResponse res = null; + private PersoniumResponse res = null; /** リクエスト送信先URLを取得するプロパティのキー. */ public static final String ERROR_RESPONSE_LANG_EN = "en"; @@ -90,7 +90,7 @@ public ODataCommon(WebAppDescriptor build) { * DcResponseヘッダのsetter. * @param value 値 */ - public void setResponse(DcResponse value) { + public void setResponse(PersoniumResponse value) { res = value; } @@ -99,10 +99,10 @@ public void setResponse(DcResponse value) { * @param url URL * @return レスポンス */ - public static DcResponse getOdataResource(String url) { - DcResponse dcRes = null; + public static PersoniumResponse getOdataResource(String url) { + PersoniumResponse dcRes = null; if (url != null) { - DcRequest req = DcRequest.get(url) + PersoniumRequest req = PersoniumRequest.get(url) .header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN) .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); dcRes = request(req); @@ -116,10 +116,10 @@ public static DcResponse getOdataResource(String url) { * @param url URL * @return レスポンス */ - public static DcResponse deleteOdataResource(String url) { - DcResponse dcRes = null; + public static PersoniumResponse deleteOdataResource(String url) { + PersoniumResponse dcRes = null; if (url != null) { - DcRequest req = DcRequest.delete(url) + PersoniumRequest req = PersoniumRequest.delete(url) .header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN) .header(HttpHeaders.IF_MATCH, "*"); dcRes = request(req); @@ -139,7 +139,7 @@ public void cellDelete() { * テストで作成したセルを削除する. * @param response DcResponseオブジェクト */ - public void cellDelete(DcResponse response) { + public void cellDelete(PersoniumResponse response) { if (response.getStatusCode() == HttpStatus.SC_CREATED) { // 作成したCellのIDを抽出 String cellId = response.getResponseHeaders(HttpHeaders.LOCATION)[0].getValue().split("'")[1]; @@ -149,7 +149,7 @@ public void cellDelete(DcResponse response) { StringBuilder cellUrl = new StringBuilder(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME, cellId)); // Cellを削除 - DcResponse resDel = restDelete(cellUrl.toString()); + PersoniumResponse resDel = restDelete(cellUrl.toString()); assertEquals(HttpStatus.SC_NO_CONTENT, resDel.getStatusCode()); } } @@ -165,7 +165,7 @@ public void cellDelete(String cellId, Boolean checkStatusCode) { StringBuilder cellUrl = new StringBuilder(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME, cellId)); // Cellを削除 - DcResponse resDel = restDelete(cellUrl.toString()); + PersoniumResponse resDel = restDelete(cellUrl.toString()); if (checkStatusCode) { assertEquals(HttpStatus.SC_NO_CONTENT, resDel.getStatusCode()); @@ -195,7 +195,7 @@ public void cellDeleteList(ArrayList cellIdList) { * @param req DcRequestオブジェクト * @param name 作成するCellの名前 */ - public void cellNormal(DcRequest req, String name) { + public void cellNormal(PersoniumRequest req, String name) { req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody("Name", name); this.res = request(req); checkSuccessResponse(res, MediaType.APPLICATION_JSON_TYPE); @@ -207,7 +207,7 @@ public void cellNormal(DcRequest req, String name) { * @param name 作成するCellの名前 * @return res this.resオブジェクト */ - public DcResponse cellNormalResponse(DcRequest req, String name) { + public PersoniumResponse cellNormalResponse(PersoniumRequest req, String name) { req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody("Name", name); this.res = request(req); checkSuccessResponse(res, MediaType.APPLICATION_JSON_TYPE); @@ -220,7 +220,7 @@ public DcResponse cellNormalResponse(DcRequest req, String name) { * @param name 作成するCellの名前 * @return res this.resオブジェクト */ - public DcResponse domainNormalResponse(DcRequest req, String name) { + public PersoniumResponse domainNormalResponse(PersoniumRequest req, String name) { req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody("Name", name); req.header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON); this.res = request(req); @@ -236,7 +236,7 @@ public DcResponse domainNormalResponse(DcRequest req, String name) { * @param errValue エラー値 * @param errSc 期待するエラーステータスコード */ - public void domainErrResponse(DcRequest req, String name, String errKey, String errValue, int errSc) { + public void domainErrResponse(PersoniumRequest req, String name, String errKey, String errValue, int errSc) { req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN) .addJsonBody("Name", name) .addJsonBody(errKey, errValue); @@ -249,7 +249,7 @@ public void domainErrResponse(DcRequest req, String name, String errKey, String * Cellの一覧取得の正常系のテスト. * @param req DcRequestオブジェクト */ - public void cellListNormal(DcRequest req) { + public void cellListNormal(PersoniumRequest req) { req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); this.res = request(req); checkCellListResponse(res, MediaType.APPLICATION_JSON_TYPE); @@ -259,7 +259,7 @@ public void cellListNormal(DcRequest req) { * Cellの一覧取得の正常系のテスト(XML). * @param req DcRequestオブジェクト */ - public void cellListNormalXml(DcRequest req) { + public void cellListNormalXml(PersoniumRequest req) { req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); this.res = request(req); String resContentType = res.getFirstHeader(HttpHeaders.CONTENT_TYPE); @@ -270,7 +270,7 @@ public void cellListNormalXml(DcRequest req) { * Domainの一覧取得の正常系のテスト. * @param req DcRequestオブジェクト */ - public void domainListNormal(DcRequest req) { + public void domainListNormal(PersoniumRequest req) { req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); this.res = request(req); @@ -282,7 +282,7 @@ public void domainListNormal(DcRequest req) { * @param req DcRequestオブジェクト * @param name 作成するCellの名前 */ - public void cellErrorInvalidMethod(DcRequest req, String name) { + public void cellErrorInvalidMethod(PersoniumRequest req, String name) { req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody("Name", name); this.res = request(req); @@ -299,7 +299,7 @@ public void cellErrorInvalidMethod(DcRequest req, String name) { * メソッドが不正なパターンのテスト. * @param req DcRequestオブジェクト */ - public void cellErrorInvalidMethod(DcRequest req) { + public void cellErrorInvalidMethod(PersoniumRequest req) { req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON); @@ -316,7 +316,7 @@ public void cellErrorInvalidMethod(DcRequest req) { * @param req DcRequestオブジェクト * @param name 作成するCellの名前 */ - public void cellConflict(DcRequest req, String name) { + public void cellConflict(PersoniumRequest req, String name) { // 1回目 req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody("Name", name); @@ -327,7 +327,7 @@ public void cellConflict(DcRequest req, String name) { assertEquals(HttpStatus.SC_CREATED, res.getStatusCode()); // 2回目の要求 - DcResponse resConflict = request(req); + PersoniumResponse resConflict = request(req); // Cell作成のレスポンスチェック // 409になることを確認 @@ -335,7 +335,7 @@ public void cellConflict(DcRequest req, String name) { assertEquals(HttpStatus.SC_CONFLICT, resConflict.getStatusCode()); // レスポンスボディのチェック - checkErrorResponse(resConflict.bodyAsJson(), DcCoreException.OData.ENTITY_ALREADY_EXISTS.getCode()); + checkErrorResponse(resConflict.bodyAsJson(), PersoniumCoreException.OData.ENTITY_ALREADY_EXISTS.getCode()); } finally { cellDelete(resConflict); } @@ -349,7 +349,7 @@ public void cellConflict(DcRequest req, String name) { * @param name1 1つ目に作成するCellの名前 * @param name2 2つ目に作成するCellの名前 */ - public void cellCreateResCheck(DcRequest req, String method, String url, String name1, String name2) { + public void cellCreateResCheck(PersoniumRequest req, String method, String url, String name1, String name2) { // 1回目 req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody("Name", name1); @@ -360,12 +360,12 @@ public void cellCreateResCheck(DcRequest req, String method, String url, String assertEquals(HttpStatus.SC_CREATED, res.getStatusCode()); // 2回目の要求 - DcRequest req2 = null; + PersoniumRequest req2 = null; if (method.equals(HttpMethod.POST)) { - req2 = DcRequest.post(url); + req2 = PersoniumRequest.post(url); } req2.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody("Name", name2); - DcResponse resConflict = request(req2); + PersoniumResponse resConflict = request(req2); // Cell作成のレスポンスチェック try { @@ -373,7 +373,7 @@ public void cellCreateResCheck(DcRequest req, String method, String url, String // 409であることを確認 assertEquals(HttpStatus.SC_CONFLICT, resConflict.getStatusCode()); // レスポンスボディのチェック - checkErrorResponse(resConflict.bodyAsJson(), DcCoreException.OData.ENTITY_ALREADY_EXISTS.getCode()); + checkErrorResponse(resConflict.bodyAsJson(), PersoniumCoreException.OData.ENTITY_ALREADY_EXISTS.getCode()); } else { // 201であることを確認 assertEquals(HttpStatus.SC_CREATED, resConflict.getStatusCode()); @@ -387,7 +387,7 @@ public void cellCreateResCheck(DcRequest req, String method, String url, String * リクエストボディが未指定のパターンのテスト. * @param req DcRequestオブジェクト */ - public void cellErrorEmptyBody(DcRequest req) { + public void cellErrorEmptyBody(PersoniumRequest req) { // Cellを作成 req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); this.res = request(req); @@ -404,7 +404,7 @@ public void cellErrorEmptyBody(DcRequest req) { * @param req DcRequestオブジェクト * @param name Cell名 */ - public void cellErrorInvalidJson(DcRequest req, String name) { + public void cellErrorInvalidJson(PersoniumRequest req, String name) { // Cellを作成 req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addStringBody(name); this.res = request(req); @@ -422,7 +422,7 @@ public void cellErrorInvalidJson(DcRequest req, String name) { * @param req DcRequestオブジェクト * @param name Cell名 */ - public void cellErrorInvalidXml(DcRequest req, String name) { + public void cellErrorInvalidXml(PersoniumRequest req, String name) { // Cellを作成 req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addStringBody(name); this.res = request(req); @@ -440,7 +440,7 @@ public void cellErrorInvalidXml(DcRequest req, String name) { * @param req DcRequestオブジェクト * @param name Cell名 */ - public void cellErrorInvalidField(DcRequest req, String name) { + public void cellErrorInvalidField(PersoniumRequest req, String name) { // Cellを作成 String[] key = {"Name", "testKey" }; String[] value = {name, "testValue" }; @@ -461,7 +461,7 @@ public void cellErrorInvalidField(DcRequest req, String name) { * @param name Cell名 * @return レスポンスオブジェクト */ - private void cellErrorInvalidName(DcRequest req, String name) { + private void cellErrorInvalidName(PersoniumRequest req, String name) { // Cellを作成 req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody("Name", name); this.res = request(req); @@ -476,7 +476,7 @@ private void cellErrorInvalidName(DcRequest req, String name) { * Cell名が0バイトのパターンのテスト. * @param req DcRequestオブジェクト */ - public void cellErrorName0(DcRequest req) { + public void cellErrorName0(PersoniumRequest req) { cellErrorInvalidName(req, ""); // ボディのチェック @@ -487,7 +487,7 @@ public void cellErrorName0(DcRequest req) { * Cell名が129バイトのパターンのテスト. * @param req DcRequestオブジェクト */ - public void cellErrorName129(DcRequest req) { + public void cellErrorName129(PersoniumRequest req) { String name = "01234567890123456789012345678901234567890123456789" + "0123456789012345678901234567890123456789012345678901234567890123456789012345678"; cellErrorInvalidName(req, name); @@ -500,7 +500,7 @@ public void cellErrorName129(DcRequest req) { * Cell名がa~zと0~9と‐と_以外のパターンのテスト. * @param req DcRequestオブジェクト */ - public void cellErrorNameCharacter(DcRequest req) { + public void cellErrorNameCharacter(PersoniumRequest req) { String name = "テスト"; cellErrorInvalidName(req, name); @@ -512,7 +512,7 @@ public void cellErrorNameCharacter(DcRequest req) { * Cell名が「__」のパターンのテスト. * @param req DcRequestオブジェクト */ - public void cellErrorNameUnderbaer(DcRequest req) { + public void cellErrorNameUnderbaer(PersoniumRequest req) { String name = "__"; cellErrorInvalidName(req, name); @@ -524,7 +524,7 @@ public void cellErrorNameUnderbaer(DcRequest req) { * Cell名が「__ctl」のパターンのテスト. * @param req DcRequestオブジェクト */ - public void cellErrorNameUnderbaerCtl(DcRequest req) { + public void cellErrorNameUnderbaerCtl(PersoniumRequest req) { String name = "__ctl"; cellErrorInvalidName(req, name); @@ -537,7 +537,7 @@ public void cellErrorNameUnderbaerCtl(DcRequest req) { * @param req DcRequestオブジェクト * @param keyName 管理キー名 */ - public void cellErrorBodyDateCtl(DcRequest req, String keyName) { + public void cellErrorBodyDateCtl(PersoniumRequest req, String keyName) { // Cellを作成 String[] key = {"Name", keyName }; String[] value = {"testCell", "/Date(0)/" }; @@ -555,7 +555,7 @@ public void cellErrorBodyDateCtl(DcRequest req, String keyName) { * @param req DcRequestオブジェクト * @param keyName 管理キー名 */ - public void cellErrorBodyMetadataCtl(DcRequest req, String keyName) { + public void cellErrorBodyMetadataCtl(PersoniumRequest req, String keyName) { // Cellを作成 String[] key = {"Name", keyName }; String[] value = {"testCell", "test" }; @@ -572,7 +572,7 @@ public void cellErrorBodyMetadataCtl(DcRequest req, String keyName) { * Cellの作成のNameが1文字のパターンのテスト. * @param req DcRequestオブジェクト. */ - public void cellName1(DcRequest req) { + public void cellName1(PersoniumRequest req) { String id = "0"; req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody("Name", id); this.res = request(req); @@ -583,7 +583,7 @@ public void cellName1(DcRequest req) { * Cellの作成のNameが128文字のパターンのテスト. * @param req DcRequestオブジェクト. */ - public void cellName128(DcRequest req) { + public void cellName128(PersoniumRequest req) { String id = "01234567890123456789012345678901234567890123456789" + "012345678901234567890123456789012345678901234567890123456789012345678901234567"; req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody("Name", id); @@ -595,7 +595,7 @@ public void cellName128(DcRequest req) { * 認証エラーの処理.Authorizationヘッダがない. * @param req DcRequestオブジェクト. */ - private void cellErrorAccess(DcRequest req) { + private void cellErrorAccess(PersoniumRequest req) { this.res = request(req); // Cell作成のレスポンスチェック @@ -610,7 +610,7 @@ private void cellErrorAccess(DcRequest req) { * 認証エラーの処理.Authorizationヘッダが異常. * @param req DcRequestオブジェクト. */ - private void cellErrorAuth(DcRequest req) { + private void cellErrorAuth(PersoniumRequest req) { this.res = request(req); // Cell作成のレスポンスチェック @@ -625,7 +625,7 @@ private void cellErrorAuth(DcRequest req) { * 認証ヘッダが無いパターンのテスト. * @param req DcRequestオブジェクト */ - public void cellErrorAuthNone(DcRequest req) { + public void cellErrorAuthNone(PersoniumRequest req) { cellErrorAccess(req); } @@ -633,7 +633,7 @@ public void cellErrorAuthNone(DcRequest req) { * 不正なトークンでの認証エラーテスト. * @param req DcRequestオブジェクト */ - public void cellErrorAuthInvalid(DcRequest req) { + public void cellErrorAuthInvalid(PersoniumRequest req) { req.header(HttpHeaders.AUTHORIZATION, "test"); cellErrorAuth(req); } @@ -643,7 +643,7 @@ public void cellErrorAuthInvalid(DcRequest req) { * @param response response * @param contentType ContentType */ - private void checkSuccessResponse(DcResponse response, MediaType contentType) { + private void checkSuccessResponse(PersoniumResponse response, MediaType contentType) { // Cell作成のレスポンスチェック // 201になることを確認 assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); @@ -686,7 +686,7 @@ private void checkSuccessResponse(DcResponse response, MediaType contentType) { * @param response response * @param contentType ContentType */ - private void checkDomainSuccessResponse(DcResponse response, MediaType contentType) { + private void checkDomainSuccessResponse(PersoniumResponse response, MediaType contentType) { // Cell作成のレスポンスチェック // 201になることを確認 assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); @@ -834,7 +834,7 @@ public static final void checkErrorResponseBody(TResponse res, String expectedCo * @param expectedCode 期待するエラーコード * @param expectedMessage 期待するメッセージ */ - public static final void checkErrorResponseBody(DcResponse res, String expectedCode, String expectedMessage) { + public static final void checkErrorResponseBody(PersoniumResponse res, String expectedCode, String expectedMessage) { JSONObject body = (JSONObject) res.bodyAsJson(); String code = (String) body.get("code"); String message = (String) ((JSONObject) body.get("message")).get("value"); @@ -1288,7 +1288,7 @@ public static String getPublished(TResponse response) { * @param response response * @return publishedの値 */ - public static String getPublished(DcResponse response) { + public static String getPublished(PersoniumResponse response) { JSONObject results = (JSONObject) ((JSONObject) response.bodyAsJson().get("d")).get("results"); return (String) results.get("__published"); } @@ -1298,7 +1298,7 @@ public static String getPublished(DcResponse response) { * @param response response * @return Etagの値 */ - public static String getEtag(DcResponse response) { + public static String getEtag(PersoniumResponse response) { return response.getResponseHeaders(HttpHeaders.ETAG)[0].getValue(); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/OptionsMethodTest.java b/src/test/java/io/personium/test/jersey/OptionsMethodTest.java similarity index 89% rename from src/test/java/com/fujitsu/dc/test/jersey/OptionsMethodTest.java rename to src/test/java/io/personium/test/jersey/OptionsMethodTest.java index abc877e8e..f155f0479 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/OptionsMethodTest.java +++ b/src/test/java/io/personium/test/jersey/OptionsMethodTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey; +package io.personium.test.jersey; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -40,15 +40,15 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.jersey.filter.PersoniumCoreContainerFilter; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.setup.Setup; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; import com.sun.jersey.core.header.InBoundHeaders; import com.sun.jersey.spi.container.ContainerRequest; import com.sun.jersey.spi.container.WebApplication; @@ -57,7 +57,7 @@ /** * OPTIONSメソッドに関するテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class OptionsMethodTest extends JerseyTest { @@ -65,7 +65,7 @@ public class OptionsMethodTest extends JerseyTest { * Constructor. */ public OptionsMethodTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -100,15 +100,15 @@ public static TResponse optionsRequest(final String path, final int code) { @Test public void 認証なしのOPTIONSメソッドがリクエストされた場合にpersoniumで受け付けている全メソッドが返却されること() throws URISyntaxException { // 被テストオブジェクトを準備 - DcCoreContainerFilter containerFilter = new DcCoreContainerFilter(); + PersoniumCoreContainerFilter containerFilter = new PersoniumCoreContainerFilter(); // ContainerRequiestを準備 WebApplication wa = mock(WebApplication.class); InBoundHeaders headers = new InBoundHeaders(); // X-FORWARDED-* 系のヘッダ設定 String scheme = "https"; String host = "example.org"; - headers.add(DcCoreUtils.HttpHeaders.X_FORWARDED_PROTO, scheme); - headers.add(DcCoreUtils.HttpHeaders.X_FORWARDED_HOST, host); + headers.add(PersoniumCoreUtils.HttpHeaders.X_FORWARDED_PROTO, scheme); + headers.add(PersoniumCoreUtils.HttpHeaders.X_FORWARDED_HOST, host); ContainerRequest request = new ContainerRequest(wa, HttpMethod.OPTIONS, new URI("http://dc1.example.com/hoge"), new URI("http://dc1.example.com/hoge/hoho"), @@ -137,12 +137,12 @@ public static TResponse optionsRequest(final String path, final int code) { masterMethods.put(HttpMethod.PUT, ""); masterMethods.put(HttpMethod.DELETE, ""); masterMethods.put(HttpMethod.HEAD, ""); - masterMethods.put(com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.MERGE, ""); - masterMethods.put(com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.MKCOL, ""); - masterMethods.put(com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.MOVE, ""); - masterMethods.put(com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPFIND, ""); - masterMethods.put(com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPPATCH, ""); - masterMethods.put(com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.ACL, ""); + masterMethods.put(io.personium.common.utils.PersoniumCoreUtils.HttpMethod.MERGE, ""); + masterMethods.put(io.personium.common.utils.PersoniumCoreUtils.HttpMethod.MKCOL, ""); + masterMethods.put(io.personium.common.utils.PersoniumCoreUtils.HttpMethod.MOVE, ""); + masterMethods.put(io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPFIND, ""); + masterMethods.put(io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPPATCH, ""); + masterMethods.put(io.personium.common.utils.PersoniumCoreUtils.HttpMethod.ACL, ""); for (String method : methods) { if (method.trim() == "") { continue; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/DcException.java b/src/test/java/io/personium/test/jersey/PersoniumException.java similarity index 82% rename from src/test/java/com/fujitsu/dc/test/jersey/DcException.java rename to src/test/java/io/personium/test/jersey/PersoniumException.java index 341fa4bd1..9863d61c5 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/DcException.java +++ b/src/test/java/io/personium/test/jersey/PersoniumException.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey; +package io.personium.test.jersey; import org.json.simple.JSONObject; import org.json.simple.JSONValue; @@ -22,7 +22,7 @@ /** * DAOで発生するException. */ -public class DcException extends Exception { +public class PersoniumException extends Exception { /** serialVersionID. */ private static final long serialVersionUID = 1L; @@ -31,7 +31,7 @@ public class DcException extends Exception { * @param msg メッセージ * @param t thorowable */ - public DcException(final String msg, final Throwable t) { + public PersoniumException(final String msg, final Throwable t) { super(msg, t); } @@ -39,7 +39,7 @@ public DcException(final String msg, final Throwable t) { * コンストラクタ. * @param msg メッセージ */ - public DcException(final String msg) { + public PersoniumException(final String msg) { super(msg); } @@ -49,14 +49,14 @@ public DcException(final String msg) { * @param c ステータスコード * @return DaoExceptionオブジェクト */ - public static DcException create(final String msg, final int c) { + public static PersoniumException create(final String msg, final int c) { String str = ""; if (msg.startsWith("{")) { str = "{\"msg\":" + msg + ",\"code\":\"" + Integer.toString(c) + "\"}"; } else { str = "{\"msg\":\"" + msg + "\",\"code\":\"" + Integer.toString(c) + "\"}"; } - return new DcException(str); + return new PersoniumException(str); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/DcRunner.java b/src/test/java/io/personium/test/jersey/PersoniumIntegTestRunner.java similarity index 73% rename from src/test/java/com/fujitsu/dc/test/jersey/DcRunner.java rename to src/test/java/io/personium/test/jersey/PersoniumIntegTestRunner.java index 2e543d4e4..99bf52811 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/DcRunner.java +++ b/src/test/java/io/personium/test/jersey/PersoniumIntegTestRunner.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey; +package io.personium.test.jersey; import java.io.IOException; import java.security.NoSuchAlgorithmException; @@ -28,18 +28,18 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.auth.token.LocalToken; -import com.fujitsu.dc.common.auth.token.TransCellAccessToken; -import com.fujitsu.dc.core.DcCoreConfig; +import io.personium.common.auth.token.LocalToken; +import io.personium.common.auth.token.TransCellAccessToken; +import io.personium.core.PersoniumUnitConfig; /** * IT用テストランナークラス. */ -public class DcRunner extends BlockJUnit4ClassRunner { +public class PersoniumIntegTestRunner extends BlockJUnit4ClassRunner { /** * ログ用オブジェクト. */ - private static Logger log = LoggerFactory.getLogger(DcRunner.class); + private static Logger log = LoggerFactory.getLogger(PersoniumIntegTestRunner.class); /** * コンストラクタ. @@ -51,14 +51,14 @@ public class DcRunner extends BlockJUnit4ClassRunner { * @throws NoSuchAlgorithmException NoSuchAlgorithmException * @throws javax.security.cert.CertificateException CertificateException */ - public DcRunner(Class klass) + public PersoniumIntegTestRunner(Class klass) throws InitializationError, NoSuchAlgorithmException, InvalidKeySpecException, CertificateException, IOException, javax.security.cert.CertificateException { super(klass); // トークン処理ライブラリの初期設定. - TransCellAccessToken.configureX509(DcCoreConfig.getX509PrivateKey(), DcCoreConfig.getX509Certificate(), - DcCoreConfig.getX509RootCertificate()); - LocalToken.setKeyString(DcCoreConfig.getTokenSecretKey()); + TransCellAccessToken.configureX509(PersoniumUnitConfig.getX509PrivateKey(), PersoniumUnitConfig.getX509Certificate(), + PersoniumUnitConfig.getX509RootCertificate()); + LocalToken.setKeyString(PersoniumUnitConfig.getTokenSecretKey()); } @Override diff --git a/src/test/java/com/fujitsu/dc/test/jersey/DcRequest.java b/src/test/java/io/personium/test/jersey/PersoniumRequest.java similarity index 81% rename from src/test/java/com/fujitsu/dc/test/jersey/DcRequest.java rename to src/test/java/io/personium/test/jersey/PersoniumRequest.java index 53b25203a..c7799aea5 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/DcRequest.java +++ b/src/test/java/io/personium/test/jersey/PersoniumRequest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey; +package io.personium.test.jersey; import java.util.HashMap; @@ -25,7 +25,7 @@ /** * RESTテスト用のリクエストクラス. */ -public class DcRequest { +public class PersoniumRequest { /** Requestヘッダのハッシュマップ. */ private HashMap headers; /** リクエスト先のURL. */ @@ -52,7 +52,7 @@ private enum BodyType { * コンストラクタ. * @param url URL */ - public DcRequest(String url) { + public PersoniumRequest(String url) { this.headers = new HashMap(); this.urlString = url; } @@ -62,8 +62,8 @@ public DcRequest(String url) { * @param url URL * @return req DcRequestオブジェクト */ - public static DcRequest get(String url) { - DcRequest req = new DcRequest(url); + public static PersoniumRequest get(String url) { + PersoniumRequest req = new PersoniumRequest(url); req.method = HttpMethod.GET; return req; } @@ -73,8 +73,8 @@ public static DcRequest get(String url) { * @param url URL * @return req DcRequestオブジェクト */ - public static DcRequest put(String url) { - DcRequest req = new DcRequest(url); + public static PersoniumRequest put(String url) { + PersoniumRequest req = new PersoniumRequest(url); req.method = HttpMethod.PUT; return req; } @@ -84,8 +84,8 @@ public static DcRequest put(String url) { * @param url URL * @return req DcRequestオブジェクト */ - public static DcRequest post(String url) { - DcRequest req = new DcRequest(url); + public static PersoniumRequest post(String url) { + PersoniumRequest req = new PersoniumRequest(url); req.method = HttpMethod.POST; return req; } @@ -95,8 +95,8 @@ public static DcRequest post(String url) { * @param url URL * @return req DcRequestオブジェクト */ - public static DcRequest delete(String url) { - DcRequest req = new DcRequest(url); + public static PersoniumRequest delete(String url) { + PersoniumRequest req = new PersoniumRequest(url); req.method = HttpMethod.DELETE; return req; } @@ -106,9 +106,9 @@ public static DcRequest delete(String url) { * @param url URL * @return req DcRequestオブジェクト */ - public static DcRequest move(String url) { - DcRequest req = new DcRequest(url); - req.method = com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.MOVE; + public static PersoniumRequest move(String url) { + PersoniumRequest req = new PersoniumRequest(url); + req.method = io.personium.common.utils.PersoniumCoreUtils.HttpMethod.MOVE; return req; } @@ -117,7 +117,7 @@ public static DcRequest move(String url) { * @param inMethod HTTP method * @return DcRequestオブジェクト */ - public DcRequest method(String inMethod) { + public PersoniumRequest method(String inMethod) { this.method = inMethod; return this; } @@ -199,7 +199,7 @@ public String getHeader(final String name) { * @param value Cell ID値 * @return DcRequestオブジェクト */ - public DcRequest cell(final String value) { + public PersoniumRequest cell(final String value) { this.cellID = value; return this; } @@ -209,7 +209,7 @@ public DcRequest cell(final String value) { * @param value Query文字列 * @return DcRequestオブジェクト */ - public DcRequest query(final String value) { + public PersoniumRequest query(final String value) { this.queryStr = value; return this; } @@ -234,8 +234,8 @@ public String makeCellUrl() { * @param url URL文字列 * @return DcRequestオブジェクト */ - public static DcRequest create(final String url) { - return new DcRequest(url); + public static PersoniumRequest create(final String url) { + return new PersoniumRequest(url); } /** @@ -244,7 +244,7 @@ public static DcRequest create(final String url) { * @param value 値 * @return DcRequestオブジェクト */ - public DcRequest header(final String key, final String value) { + public PersoniumRequest header(final String key, final String value) { if (value != null) { this.headers.put(key, value); } @@ -258,7 +258,7 @@ public DcRequest header(final String key, final String value) { * @return DcRequestオブジェクト */ @SuppressWarnings("unchecked") - public DcRequest addJsonBody(final String key, final Object value) { + public PersoniumRequest addJsonBody(final String key, final Object value) { if (this.body == null) { this.body = new JSONObject(); } @@ -274,7 +274,7 @@ public DcRequest addJsonBody(final String key, final Object value) { * @return DcRequestオブジェクト */ @SuppressWarnings("unchecked") - public DcRequest addJsonBody(final String[] key, final String[] value) { + public PersoniumRequest addJsonBody(final String[] key, final String[] value) { if (this.body == null) { this.body = new JSONObject(); } @@ -290,7 +290,7 @@ public DcRequest addJsonBody(final String[] key, final String[] value) { * @param value 値 * @return DcRequestオブジェクト */ - public DcRequest addStringBody(final String value) { + public PersoniumRequest addStringBody(final String value) { if (this.body == null) { this.body = new String(); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/DcResponse.java b/src/test/java/io/personium/test/jersey/PersoniumResponse.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/DcResponse.java rename to src/test/java/io/personium/test/jersey/PersoniumResponse.java index 98d33e6d1..95db0a708 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/DcResponse.java +++ b/src/test/java/io/personium/test/jersey/PersoniumResponse.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey; +package io.personium.test.jersey; import static org.junit.Assert.fail; @@ -41,21 +41,21 @@ /** * DAVのレスポンス型. */ -public class DcResponse { +public class PersoniumResponse { /** レスポンスオブジェクト. */ private HttpResponse response; /** * コンストラクタ. */ - public DcResponse() { + public PersoniumResponse() { } /** * コンストラクタ. * @param resObj レスポンスオブジェクト */ - public DcResponse(final HttpResponse resObj) { + public PersoniumResponse(final HttpResponse resObj) { this.response = resObj; } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/DcRestAdapter.java b/src/test/java/io/personium/test/jersey/PersoniumRestAdapter.java similarity index 80% rename from src/test/java/com/fujitsu/dc/test/jersey/DcRestAdapter.java rename to src/test/java/io/personium/test/jersey/PersoniumRestAdapter.java index 3ea5e0a0d..8c1f22d86 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/DcRestAdapter.java +++ b/src/test/java/io/personium/test/jersey/PersoniumRestAdapter.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey; +package io.personium.test.jersey; import java.io.InputStream; import java.io.UnsupportedEncodingException; @@ -42,12 +42,12 @@ import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.DefaultHttpClient; -import com.fujitsu.dc.test.DcCoreTestConfig; +import io.personium.test.PersoniumCoreTestConfig; /** * RESTアクセスのためのクラス. */ -public class DcRestAdapter { +public class PersoniumRestAdapter { /** ログオブジェクト. */ private Log log; @@ -67,10 +67,10 @@ public class DcRestAdapter { /** * コンストラクタ. */ - public DcRestAdapter() { + public PersoniumRestAdapter() { httpClient = HttpClientFactory.create("insecure", TIMEOUT); HttpClientParams.setRedirecting(httpClient.getParams(), false); - log = LogFactory.getLog(DcRestAdapter.class); + log = LogFactory.getLog(PersoniumRestAdapter.class); } /** @@ -86,18 +86,18 @@ public final void setHttpClient(final HttpClient value) { * @param url リクエスト対象URL * @param headers リクエストヘッダのハッシュマップ * @return DcResponse型 - * @throws DcException DAO例外 + * @throws PersoniumException DAO例外 */ - public final DcResponse get(final String url, final HashMap headers) - throws DcException { + public final PersoniumResponse get(final String url, final HashMap headers) + throws PersoniumException { HttpUriRequest req = new HttpGet(url); for (Map.Entry entry : headers.entrySet()) { req.setHeader(entry.getKey(), entry.getValue()); } - req.addHeader("X-Dc-Version", DcCoreTestConfig.getCoreVersion()); + req.addHeader("X-Personium-Version", PersoniumCoreTestConfig.getCoreVersion()); debugHttpRequest(req, ""); - DcResponse res = this.request(req); + PersoniumResponse res = this.request(req); return res; } @@ -106,19 +106,19 @@ public final DcResponse get(final String url, final HashMap head * @param url リクエスト対象URL * @param headers リクエストヘッダのハッシュマップ * @return DcResponse型 - * @throws DcException DAO例外 + * @throws PersoniumException DAO例外 */ - public final DcResponse getAcceptEncodingGzip(final String url, final HashMap headers) - throws DcException { + public final PersoniumResponse getAcceptEncodingGzip(final String url, final HashMap headers) + throws PersoniumException { HttpUriRequest req = new HttpGet(url); req.addHeader("Accept-Encoding", "gzip"); for (Map.Entry entry : headers.entrySet()) { req.setHeader(entry.getKey(), entry.getValue()); } - req.addHeader("X-Dc-Version", DcCoreTestConfig.getCoreVersion()); + req.addHeader("X-Personium-Version", PersoniumCoreTestConfig.getCoreVersion()); debugHttpRequest(req, ""); - DcResponse res = this.request(req); + PersoniumResponse res = this.request(req); return res; } @@ -128,20 +128,20 @@ public final DcResponse getAcceptEncodingGzip(final String url, final HashMap headers) throws DcException { + final HashMap headers) throws PersoniumException { String contentType = headers.get(HttpHeaders.CONTENT_TYPE); HttpUriRequest req = makePutRequest(url, data, contentType); for (Map.Entry entry : headers.entrySet()) { req.setHeader(entry.getKey(), entry.getValue()); } - req.addHeader("X-Dc-Version", DcCoreTestConfig.getCoreVersion()); + req.addHeader("X-Personium-Version", PersoniumCoreTestConfig.getCoreVersion()); debugHttpRequest(req, data); - DcResponse res = request(req); + PersoniumResponse res = request(req); return res; } @@ -151,19 +151,19 @@ public final DcResponse put(final String url, * @param headers リクエストヘッダのハッシュマップ * @param is PUTするデータストリーム * @return DcResponse型 - * @throws DcException DAO例外 + * @throws PersoniumException DAO例外 */ - public final DcResponse put(final String url, final HashMap headers, final InputStream is) - throws DcException { + public final PersoniumResponse put(final String url, final HashMap headers, final InputStream is) + throws PersoniumException { String contentType = headers.get(HttpHeaders.CONTENT_TYPE); HttpUriRequest req = makePutRequestByStream(url, contentType, is); for (Map.Entry entry : headers.entrySet()) { req.setHeader(entry.getKey(), entry.getValue()); } - req.addHeader("X-Dc-Version", DcCoreTestConfig.getCoreVersion()); + req.addHeader("X-Personium-Version", PersoniumCoreTestConfig.getCoreVersion()); debugHttpRequest(req, "body is InputStream..."); - DcResponse res = request(req); + PersoniumResponse res = request(req); return res; } @@ -173,19 +173,19 @@ public final DcResponse put(final String url, final HashMap head * @param data 書き込むデータ * @param headers リクエストヘッダのハッシュマップ * @return DcResponse型 - * @throws DcException DAO例外 + * @throws PersoniumException DAO例外 */ - public final DcResponse post(final String url, final String data, final HashMap headers) - throws DcException { + public final PersoniumResponse post(final String url, final String data, final HashMap headers) + throws PersoniumException { String contentType = headers.get(HttpHeaders.CONTENT_TYPE); HttpUriRequest req = makePostRequest(url, data, contentType); for (Map.Entry entry : headers.entrySet()) { req.setHeader(entry.getKey(), entry.getValue()); } - req.addHeader("X-Dc-Version", DcCoreTestConfig.getCoreVersion()); + req.addHeader("X-Personium-Version", PersoniumCoreTestConfig.getCoreVersion()); debugHttpRequest(req, data); - DcResponse res = request(req); + PersoniumResponse res = request(req); return res; } @@ -194,14 +194,14 @@ public final DcResponse post(final String url, final String data, final HashMap< * @param url リクエスト対象URL * @param headers リクエストヘッダのハッシュマップ * @return DcResponse型 - * @throws DcException DAO例外 + * @throws PersoniumException DAO例外 */ - public final DcResponse del(final String url, final HashMap headers) throws DcException { + public final PersoniumResponse del(final String url, final HashMap headers) throws PersoniumException { HttpDelete req = new HttpDelete(url); for (Map.Entry entry : headers.entrySet()) { req.setHeader(entry.getKey(), entry.getValue()); } - req.addHeader("X-Dc-Version", DcCoreTestConfig.getCoreVersion()); + req.addHeader("X-Personium-Version", PersoniumCoreTestConfig.getCoreVersion()); debugHttpRequest(req, ""); return this.request(req); @@ -214,10 +214,10 @@ public final DcResponse del(final String url, final HashMap head * @param body リクエストボディ * @param headers リクエストヘッダのハッシュマップ * @return DcResponse型 - * @throws DcException DAO例外 + * @throws PersoniumException DAO例外 */ - public DcResponse request(final String method, String url, String body, - HashMap headers) throws DcException { + public PersoniumResponse request(final String method, String url, String body, + HashMap headers) throws PersoniumException { HttpEntityEnclosingRequestBase req = new HttpEntityEnclosingRequestBase() { @Override public String getMethod() { @@ -228,7 +228,7 @@ public String getMethod() { for (Map.Entry entry : headers.entrySet()) { req.setHeader(entry.getKey(), entry.getValue()); } - req.addHeader("X-Dc-Version", DcCoreTestConfig.getCoreVersion()); + req.addHeader("X-Personium-Version", PersoniumCoreTestConfig.getCoreVersion()); if (body != null) { HttpEntity httpEntity = null; @@ -236,7 +236,7 @@ public String getMethod() { String bodyStr = toUniversalCharacterNames(body); httpEntity = new StringEntity(bodyStr); } catch (UnsupportedEncodingException e) { - throw DcException.create("error while request body encoding : " + e.getMessage(), 0); + throw PersoniumException.create("error while request body encoding : " + e.getMessage(), 0); } req.setEntity(httpEntity); } @@ -263,21 +263,21 @@ protected final HttpUriRequest makeGetRequest(final String url, final String acc * @param data PUTするデータ * @param contentType メディアタイプ * @return HttpPutインスタンス - * @throws DcException DAO例外 + * @throws PersoniumException DAO例外 */ protected final HttpPut makePutRequest(final String url, final String data, final String contentType) - throws DcException { + throws PersoniumException { HttpPut request = new HttpPut(url); HttpEntity body = null; try { - if (DcRestAdapter.CONTENT_TYPE_JSON.equals(contentType)) { + if (PersoniumRestAdapter.CONTENT_TYPE_JSON.equals(contentType)) { String bodyStr = toUniversalCharacterNames(data); body = new StringEntity(bodyStr); } else { - body = new StringEntity(data, DcRestAdapter.ENCODE); + body = new StringEntity(data, PersoniumRestAdapter.ENCODE); } } catch (UnsupportedEncodingException e) { - throw DcException.create("error while request body encoding : " + e.getMessage(), 0); + throw PersoniumException.create("error while request body encoding : " + e.getMessage(), 0); } request.setEntity(body); return request; @@ -289,10 +289,10 @@ protected final HttpPut makePutRequest(final String url, final String data, fina * @param contentType メディアタイプ * @param is PUTするデータストリーム * @return HttpPutクラスインスタンス - * @throws DcException DAO例外 + * @throws PersoniumException DAO例外 */ protected final HttpPut makePutRequestByStream(final String url, final String contentType, final InputStream is) - throws DcException { + throws PersoniumException { HttpPut request = new HttpPut(url); InputStreamEntity body; body = new InputStreamEntity(is, -1); @@ -310,17 +310,17 @@ protected final HttpPut makePutRequestByStream(final String url, final String co * @param data POSTするデータ * @param contentType メディアタイプ * @return POSTされたデータ - * @throws DcException DAO例外 + * @throws PersoniumException DAO例外 */ protected final HttpPost makePostRequest(final String url, final String data, final String contentType) - throws DcException { + throws PersoniumException { HttpPost request = new HttpPost(url); HttpEntity body = null; try { String bodyStr = toUniversalCharacterNames(data); body = new StringEntity(bodyStr); } catch (UnsupportedEncodingException e) { - throw DcException.create("error while request body encoding : " + e.getMessage(), 0); + throw PersoniumException.create("error while request body encoding : " + e.getMessage(), 0); } request.setEntity(body); makeCommonHeaders(request, contentType, contentType, null); @@ -362,13 +362,13 @@ protected final void makeCommonHeaders(final HttpUriRequest req, /** * Reponseボディを受ける場合のHTTPリクエストを行う. * @param httpReq HTTPリクエスト - * @return DCレスポンスオブジェクト - * @throws DcException DAO例外 + * @return Personiumレスポンスオブジェクト + * @throws PersoniumException DAO例外 */ - private DcResponse request(final HttpUriRequest httpReq) throws DcException { + private PersoniumResponse request(final HttpUriRequest httpReq) throws PersoniumException { try { HttpResponse objResponse = httpClient.execute(httpReq); - DcResponse dcRes = new DcResponse(objResponse); + PersoniumResponse dcRes = new PersoniumResponse(objResponse); /* * int statusCode = objResponse.getStatusLine().getStatusCode(); if (statusCode >= STATUS300) { * debugHttpResponse(objResponse); throw DcException.create(dcRes.bodyAsString(), statusCode); } if @@ -378,7 +378,7 @@ private DcResponse request(final HttpUriRequest httpReq) throws DcException { debugHttpResponse(objResponse); return dcRes; } catch (Exception ioe) { - throw DcException.create("io exception : " + ioe.getMessage(), 0); + throw PersoniumException.create("io exception : " + ioe.getMessage(), 0); } } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/ReadDeleteOnlyModeTest.java b/src/test/java/io/personium/test/jersey/ReadDeleteOnlyModeTest.java similarity index 84% rename from src/test/java/com/fujitsu/dc/test/jersey/ReadDeleteOnlyModeTest.java rename to src/test/java/io/personium/test/jersey/ReadDeleteOnlyModeTest.java index ba526ea50..1df4abafe 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/ReadDeleteOnlyModeTest.java +++ b/src/test/java/io/personium/test/jersey/ReadDeleteOnlyModeTest.java @@ -14,20 +14,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey; - -import static com.fujitsu.dc.test.utils.BatchUtils.END_BOUNDARY; -import static com.fujitsu.dc.test.utils.BatchUtils.START_BOUNDARY; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveChangeSetResErrorBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveDeleteBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveDeleteResBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveGetBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveGetResBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveLinksPostBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveListBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveListResBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrievePostBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrievePutBody; +package io.personium.test.jersey; + +import static io.personium.test.utils.BatchUtils.END_BOUNDARY; +import static io.personium.test.utils.BatchUtils.START_BOUNDARY; +import static io.personium.test.utils.BatchUtils.retrieveChangeSetResErrorBody; +import static io.personium.test.utils.BatchUtils.retrieveDeleteBody; +import static io.personium.test.utils.BatchUtils.retrieveDeleteResBody; +import static io.personium.test.utils.BatchUtils.retrieveGetBody; +import static io.personium.test.utils.BatchUtils.retrieveGetResBody; +import static io.personium.test.utils.BatchUtils.retrieveLinksPostBody; +import static io.personium.test.utils.BatchUtils.retrieveListBody; +import static io.personium.test.utils.BatchUtils.retrieveListResBody; +import static io.personium.test.utils.BatchUtils.retrievePostBody; +import static io.personium.test.utils.BatchUtils.retrievePutBody; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -44,34 +44,34 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.model.lock.LockManager; -import com.fujitsu.dc.core.utils.MemcachedClient; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.model.lock.LockManager; +import io.personium.core.utils.MemcachedClient; +import io.personium.test.categories.Integration; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; /** * ReadDeleteOnlyModeに関するテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Integration.class }) public class ReadDeleteOnlyModeTest extends JerseyTest { private static final Map INIT_PARAMS = new HashMap(); static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("javax.ws.rs.Application", - "com.fujitsu.dc.core.rs.DcCoreApplication"); + "io.personium.core.rs.PersoniumCoreApplication"); INIT_PARAMS.put("com.sun.jersey.config.feature.DisableWADL", "true"); } @@ -92,7 +92,7 @@ public ReadDeleteOnlyModeTest() { @Test public void ReadDeleteOnlyモード時にPOSTメソッドが503となること() throws Exception { // InProcessの場合はテスト不可のため終了する - if (LockManager.TYPE_IN_PROCESS.equals(DcCoreConfig.getLockType())) { + if (LockManager.TYPE_IN_PROCESS.equals(PersoniumUnitConfig.getLockType())) { return; } @@ -123,7 +123,7 @@ public ReadDeleteOnlyModeTest() { @Test public void ReadDeleteOnlyモード時に$batchを実行した場合_登録系リクエストが503となること() throws Exception { // InProcessの場合はテスト不可のため終了する - if (LockManager.TYPE_IN_PROCESS.equals(DcCoreConfig.getLockType())) { + if (LockManager.TYPE_IN_PROCESS.equals(PersoniumUnitConfig.getLockType())) { return; } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/ResourcePathTest.java b/src/test/java/io/personium/test/jersey/ResourcePathTest.java similarity index 71% rename from src/test/java/com/fujitsu/dc/test/jersey/ResourcePathTest.java rename to src/test/java/io/personium/test/jersey/ResourcePathTest.java index e7a2806ac..77d376399 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/ResourcePathTest.java +++ b/src/test/java/io/personium/test/jersey/ResourcePathTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey; +package io.personium.test.jersey; import static org.junit.Assert.assertEquals; @@ -23,12 +23,12 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; /** * リソースパスのテスト. @@ -40,7 +40,7 @@ public class ResourcePathTest extends AbstractCase { * コンストラクタ. */ public ResourcePathTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -49,13 +49,13 @@ public ResourcePathTest() { @Test public final void CellルートパスのCell名に空白が指定された場合に404エラーが返却されること() { String url = UrlUtils.cellRoot("cell%20test"); - DcResponse res = ODataCommon.getOdataResource(url); + PersoniumResponse res = ODataCommon.getOdataResource(url); assertEquals(HttpStatus.SC_NOT_FOUND, res.getStatusCode()); JSONObject resBody = res.bodyAsJson(); String message = (String) ((JSONObject) resBody.get("message")).get("value"); String code = (String) resBody.get("code"); - assertEquals(DcCoreException.Dav.CELL_NOT_FOUND.getCode(), code); - assertEquals(DcCoreException.Dav.CELL_NOT_FOUND.getMessage(), message); + assertEquals(PersoniumCoreException.Dav.CELL_NOT_FOUND.getCode(), code); + assertEquals(PersoniumCoreException.Dav.CELL_NOT_FOUND.getMessage(), message); } /** @@ -64,13 +64,13 @@ public ResourcePathTest() { @Test public final void CellルートパスのCell名に改行コードが指定された場合に404エラーが返却されること() { String url = UrlUtils.cellRoot("cell%0atest"); - DcResponse res = ODataCommon.getOdataResource(url); + PersoniumResponse res = ODataCommon.getOdataResource(url); assertEquals(HttpStatus.SC_NOT_FOUND, res.getStatusCode()); JSONObject resBody = res.bodyAsJson(); String message = (String) ((JSONObject) resBody.get("message")).get("value"); String code = (String) resBody.get("code"); - assertEquals(DcCoreException.Dav.CELL_NOT_FOUND.getCode(), code); - assertEquals(DcCoreException.Dav.CELL_NOT_FOUND.getMessage(), message); + assertEquals(PersoniumCoreException.Dav.CELL_NOT_FOUND.getCode(), code); + assertEquals(PersoniumCoreException.Dav.CELL_NOT_FOUND.getMessage(), message); } /** @@ -79,14 +79,14 @@ public ResourcePathTest() { @Test public final void BoxルートパスのBox名に空白が指定された場合に404エラーが返却されること() { String url = UrlUtils.boxRoot(Setup.TEST_CELL1, "box%20test"); - DcResponse res = ODataCommon.getOdataResource(url); + PersoniumResponse res = ODataCommon.getOdataResource(url); assertEquals(HttpStatus.SC_NOT_FOUND, res.getStatusCode()); JSONObject resBody = res.bodyAsJson(); String message = (String) ((JSONObject) resBody.get("message")).get("value"); String code = (String) resBody.get("code"); - assertEquals(DcCoreException.Dav.BOX_NOT_FOUND.getCode(), code); + assertEquals(PersoniumCoreException.Dav.BOX_NOT_FOUND.getCode(), code); String expectedUrl = UrlUtils.boxRoot(Setup.TEST_CELL1, "box test"); - assertEquals(DcCoreException.Dav.BOX_NOT_FOUND.params(expectedUrl).getMessage(), message); + assertEquals(PersoniumCoreException.Dav.BOX_NOT_FOUND.params(expectedUrl).getMessage(), message); } /** @@ -95,14 +95,14 @@ public ResourcePathTest() { @Test public final void BoxルートパスのBox名に改行コードが指定された場合に404エラーが返却されること() { String url = UrlUtils.boxRoot(Setup.TEST_CELL1, "box%0atest"); - DcResponse res = ODataCommon.getOdataResource(url); + PersoniumResponse res = ODataCommon.getOdataResource(url); assertEquals(HttpStatus.SC_NOT_FOUND, res.getStatusCode()); JSONObject resBody = res.bodyAsJson(); String message = (String) ((JSONObject) resBody.get("message")).get("value"); String code = (String) resBody.get("code"); - assertEquals(DcCoreException.Dav.BOX_NOT_FOUND.getCode(), code); + assertEquals(PersoniumCoreException.Dav.BOX_NOT_FOUND.getCode(), code); String expectedUrl = UrlUtils.boxRoot(Setup.TEST_CELL1, "box\ntest"); - assertEquals(DcCoreException.Dav.BOX_NOT_FOUND.params(expectedUrl).getMessage(), message); + assertEquals(PersoniumCoreException.Dav.BOX_NOT_FOUND.params(expectedUrl).getMessage(), message); } /** @@ -111,13 +111,13 @@ public ResourcePathTest() { @Test public final void ユニット制御API一件取得の検索値に空白が指定された場合に404エラーが返却されること() { String url = UrlUtils.unitCtl("Cell", "cell%20test"); - DcResponse res = ODataCommon.getOdataResource(url); + PersoniumResponse res = ODataCommon.getOdataResource(url); assertEquals(HttpStatus.SC_NOT_FOUND, res.getStatusCode()); JSONObject resBody = res.bodyAsJson(); String message = (String) ((JSONObject) resBody.get("message")).get("value"); String code = (String) resBody.get("code"); - assertEquals(DcCoreException.OData.NO_SUCH_ENTITY.getCode(), code); - assertEquals(DcCoreException.OData.NO_SUCH_ENTITY.getMessage(), message); + assertEquals(PersoniumCoreException.OData.NO_SUCH_ENTITY.getCode(), code); + assertEquals(PersoniumCoreException.OData.NO_SUCH_ENTITY.getMessage(), message); } /** @@ -126,13 +126,13 @@ public ResourcePathTest() { @Test public final void ユニット制御API一件取得の検索値に改行コードが指定された場合に404エラーが返却されること() { String url = UrlUtils.unitCtl("Cell", "cell%0atest"); - DcResponse res = ODataCommon.getOdataResource(url); + PersoniumResponse res = ODataCommon.getOdataResource(url); assertEquals(HttpStatus.SC_NOT_FOUND, res.getStatusCode()); JSONObject resBody = res.bodyAsJson(); String message = (String) ((JSONObject) resBody.get("message")).get("value"); String code = (String) resBody.get("code"); - assertEquals(DcCoreException.OData.NO_SUCH_ENTITY.getCode(), code); - assertEquals(DcCoreException.OData.NO_SUCH_ENTITY.getMessage(), message); + assertEquals(PersoniumCoreException.OData.NO_SUCH_ENTITY.getCode(), code); + assertEquals(PersoniumCoreException.OData.NO_SUCH_ENTITY.getMessage(), message); } /** @@ -141,13 +141,13 @@ public ResourcePathTest() { @Test public final void セル制御API一件取得の検索値に空白が指定された場合に404エラーが返却されること() { String url = UrlUtils.cellCtl(Setup.TEST_CELL1, "Box", "box%20test"); - DcResponse res = ODataCommon.getOdataResource(url); + PersoniumResponse res = ODataCommon.getOdataResource(url); assertEquals(HttpStatus.SC_NOT_FOUND, res.getStatusCode()); JSONObject resBody = res.bodyAsJson(); String message = (String) ((JSONObject) resBody.get("message")).get("value"); String code = (String) resBody.get("code"); - assertEquals(DcCoreException.OData.NO_SUCH_ENTITY.getCode(), code); - assertEquals(DcCoreException.OData.NO_SUCH_ENTITY.getMessage(), message); + assertEquals(PersoniumCoreException.OData.NO_SUCH_ENTITY.getCode(), code); + assertEquals(PersoniumCoreException.OData.NO_SUCH_ENTITY.getMessage(), message); } /** @@ -156,12 +156,12 @@ public ResourcePathTest() { @Test public final void セル制御API一件取得の検索値に改行コードが指定された場合に404エラーが返却されること() { String url = UrlUtils.cellCtl(Setup.TEST_CELL1, "Box", "box%0atest"); - DcResponse res = ODataCommon.getOdataResource(url); + PersoniumResponse res = ODataCommon.getOdataResource(url); assertEquals(HttpStatus.SC_NOT_FOUND, res.getStatusCode()); JSONObject resBody = res.bodyAsJson(); String message = (String) ((JSONObject) resBody.get("message")).get("value"); String code = (String) resBody.get("code"); - assertEquals(DcCoreException.OData.NO_SUCH_ENTITY.getCode(), code); - assertEquals(DcCoreException.OData.NO_SUCH_ENTITY.getMessage(), message); + assertEquals(PersoniumCoreException.OData.NO_SUCH_ENTITY.getCode(), code); + assertEquals(PersoniumCoreException.OData.NO_SUCH_ENTITY.getMessage(), message); } } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/StatusTest.java b/src/test/java/io/personium/test/jersey/StatusTest.java similarity index 83% rename from src/test/java/com/fujitsu/dc/test/jersey/StatusTest.java rename to src/test/java/io/personium/test/jersey/StatusTest.java index 552d76a6e..f83987c85 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/StatusTest.java +++ b/src/test/java/io/personium/test/jersey/StatusTest.java @@ -14,14 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey; +package io.personium.test.jersey; import static org.junit.Assert.assertNotNull; import org.json.simple.JSONObject; import org.junit.Test; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.test.unit.core.UrlUtils; /** * __statusのテスト. @@ -34,7 +34,7 @@ public class StatusTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public StatusTest() { - super("com.fujitsu.dc"); + super("io.personium"); } /** @@ -42,8 +42,8 @@ public StatusTest() { */ @Test public void ステータス確認のテスト() { - DcRequest req = DcRequest.get(UrlUtils.status()); - DcResponse res = request(req); + PersoniumRequest req = PersoniumRequest.get(UrlUtils.status()); + PersoniumResponse res = request(req); JSONObject json = res.bodyAsJson(); assertNotNull(json.get("ElasticSearch")); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/bar/AllTests.java b/src/test/java/io/personium/test/jersey/bar/AllTests.java similarity index 93% rename from src/test/java/com/fujitsu/dc/test/jersey/bar/AllTests.java rename to src/test/java/io/personium/test/jersey/bar/AllTests.java index e34e0a17a..c6965f418 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/bar/AllTests.java +++ b/src/test/java/io/personium/test/jersey/bar/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.bar; +package io.personium.test.jersey.bar; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/bar/BarInstallCollectionTest.java b/src/test/java/io/personium/test/jersey/bar/BarInstallCollectionTest.java similarity index 98% rename from src/test/java/com/fujitsu/dc/test/jersey/bar/BarInstallCollectionTest.java rename to src/test/java/io/personium/test/jersey/bar/BarInstallCollectionTest.java index 81baacf07..fb366ea4a 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/bar/BarInstallCollectionTest.java +++ b/src/test/java/io/personium/test/jersey/bar/BarInstallCollectionTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.bar; +package io.personium.test.jersey.bar; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -35,25 +35,25 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.model.progress.ProgressInfo; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.model.progress.ProgressInfo; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; /** * Collection, WebDAVファイル向けのbarファイルインストール用テスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class BarInstallCollectionTest extends JerseyTest { @@ -68,7 +68,7 @@ public class BarInstallCollectionTest extends JerseyTest { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public BarInstallCollectionTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/bar/BarInstallEventLogTest.java b/src/test/java/io/personium/test/jersey/bar/BarInstallEventLogTest.java similarity index 95% rename from src/test/java/com/fujitsu/dc/test/jersey/bar/BarInstallEventLogTest.java rename to src/test/java/io/personium/test/jersey/bar/BarInstallEventLogTest.java index 57e45eb17..94482a1be 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/bar/BarInstallEventLogTest.java +++ b/src/test/java/io/personium/test/jersey/bar/BarInstallEventLogTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.bar; +package io.personium.test.jersey.bar; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -38,22 +38,22 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.core.model.progress.ProgressInfo; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.model.progress.ProgressInfo; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; /** * barファイルインストール用テスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class BarInstallEventLogTest extends JerseyTest { /** @@ -77,7 +77,7 @@ public class BarInstallEventLogTest extends JerseyTest { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public BarInstallEventLogTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/bar/BarInstallTest.java b/src/test/java/io/personium/test/jersey/bar/BarInstallTest.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/bar/BarInstallTest.java rename to src/test/java/io/personium/test/jersey/bar/BarInstallTest.java index 917061f34..248ec20f2 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/bar/BarInstallTest.java +++ b/src/test/java/io/personium/test/jersey/bar/BarInstallTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.bar; +package io.personium.test.jersey.bar; import static org.junit.Assert.assertEquals; @@ -41,50 +41,50 @@ import org.slf4j.LoggerFactory; import org.w3c.dom.Element; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.auth.OAuth2Helper; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.ctl.AssociationEnd; -import com.fujitsu.dc.core.model.ctl.ComplexType; -import com.fujitsu.dc.core.model.ctl.ComplexTypeProperty; -import com.fujitsu.dc.core.model.ctl.EntityType; -import com.fujitsu.dc.core.model.ctl.ExtRole; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.core.model.ctl.Relation; -import com.fujitsu.dc.core.model.ctl.Role; -import com.fujitsu.dc.core.model.progress.ProgressInfo; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.cell.ctl.CellCtlUtils; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.AssociationEndUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.ExtCellUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.RelationUtils; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.TestMethodUtils; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.auth.OAuth2Helper; +import io.personium.core.model.Box; +import io.personium.core.model.ctl.AssociationEnd; +import io.personium.core.model.ctl.ComplexType; +import io.personium.core.model.ctl.ComplexTypeProperty; +import io.personium.core.model.ctl.EntityType; +import io.personium.core.model.ctl.ExtRole; +import io.personium.core.model.ctl.Property; +import io.personium.core.model.ctl.Relation; +import io.personium.core.model.ctl.Role; +import io.personium.core.model.progress.ProgressInfo; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.cell.ctl.CellCtlUtils; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.AssociationEndUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.ExtCellUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.RelationUtils; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.TestMethodUtils; +import io.personium.test.utils.UserDataUtils; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; /** * barファイルインストール用テスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class BarInstallTest extends JerseyTest { /** @@ -134,11 +134,11 @@ public class BarInstallTest extends JerseyTest { static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } /** @@ -263,8 +263,8 @@ private static void cleanup() { res = BarInstallTestUtils.request(REQUEST_NORM_FILE, reqCell, reqPath, headers, body); res.statusCode(HttpStatus.SC_NOT_FOUND); - String code = DcCoreException.Dav.CELL_NOT_FOUND.getCode(); - String message = DcCoreException.Dav.CELL_NOT_FOUND.getMessage(); + String code = PersoniumCoreException.Dav.CELL_NOT_FOUND.getCode(); + String message = PersoniumCoreException.Dav.CELL_NOT_FOUND.getMessage(); res.checkErrorResponse(code, message); } @@ -332,8 +332,8 @@ private static void cleanup() { BoxUtils.createWithSchema(reqCell, "boxInstallTestBox", AbstractCase.MASTER_TOKEN_NAME, SCHEMA_URL); res = BarInstallTestUtils.request(REQUEST_NORM_FILE, reqCell, reqPath, headers, body); res.statusCode(HttpStatus.SC_BAD_REQUEST); - String code = DcCoreException.BarInstall.BAR_FILE_BOX_SCHEMA_ALREADY_EXISTS.getCode(); - String message = DcCoreException.BarInstall.BAR_FILE_BOX_SCHEMA_ALREADY_EXISTS. + String code = PersoniumCoreException.BarInstall.BAR_FILE_BOX_SCHEMA_ALREADY_EXISTS.getCode(); + String message = PersoniumCoreException.BarInstall.BAR_FILE_BOX_SCHEMA_ALREADY_EXISTS. params(SCHEMA_URL).getMessage(); res.checkErrorResponse(code, message); } finally { @@ -360,8 +360,8 @@ private static void cleanup() { try { res = BarInstallTestUtils.request(REQUEST_NORM_FILE, reqCell, reqPath, headers, body); res.statusCode(HttpStatus.SC_METHOD_NOT_ALLOWED); - String code = DcCoreException.BarInstall.BAR_FILE_BOX_ALREADY_EXISTS.getCode(); - String message = DcCoreException.BarInstall.BAR_FILE_BOX_ALREADY_EXISTS. + String code = PersoniumCoreException.BarInstall.BAR_FILE_BOX_ALREADY_EXISTS.getCode(); + String message = PersoniumCoreException.BarInstall.BAR_FILE_BOX_ALREADY_EXISTS. params(reqPath).getMessage(); res.checkErrorResponse(code, message); } finally { @@ -387,8 +387,8 @@ private static void cleanup() { res = BarInstallTestUtils.request(REQUEST_NORM_FILE, reqCell, reqPath, headers, body); res.statusCode(HttpStatus.SC_METHOD_NOT_ALLOWED); - String code = DcCoreException.Misc.METHOD_NOT_ALLOWED.getCode(); - String message = DcCoreException.Misc.METHOD_NOT_ALLOWED. + String code = PersoniumCoreException.Misc.METHOD_NOT_ALLOWED.getCode(); + String message = PersoniumCoreException.Misc.METHOD_NOT_ALLOWED. params("'" + reqPath + "'").getMessage(); res.checkErrorResponse(code, message); } @@ -409,14 +409,14 @@ private static void cleanup() { res = BarInstallTestUtils.request(REQUEST_NOTYPE_FILE, reqCell, reqPath, headers, body); res.statusCode(HttpStatus.SC_BAD_REQUEST); - String code = DcCoreException.BarInstall.REQUEST_HEADER_FORMAT_ERROR.getCode(); - String message = DcCoreException.BarInstall.REQUEST_HEADER_FORMAT_ERROR. + String code = PersoniumCoreException.BarInstall.REQUEST_HEADER_FORMAT_ERROR.getCode(); + String message = PersoniumCoreException.BarInstall.REQUEST_HEADER_FORMAT_ERROR. params(HttpHeaders.CONTENT_TYPE).getMessage(); res.checkErrorResponse(code, message); } /** - * ContentTypeが値なしの場合は400エラーとなること. dc1-coreで処理される前に"Bad Content-Type header value: ''"が返却されるためテスト無効化 + * ContentTypeが値なしの場合は400エラーとなること. personium-coreで処理される前に"Bad Content-Type header value: ''"が返却されるためテスト無効化 */ @Test @Ignore @@ -434,8 +434,8 @@ private static void cleanup() { res = BarInstallTestUtils.request(REQUEST_NORM_FILE, reqCell, reqPath, headers, body); res.statusCode(HttpStatus.SC_BAD_REQUEST); - String code = DcCoreException.BarInstall.REQUEST_HEADER_FORMAT_ERROR.getCode(); - String message = DcCoreException.BarInstall.REQUEST_HEADER_FORMAT_ERROR. + String code = PersoniumCoreException.BarInstall.REQUEST_HEADER_FORMAT_ERROR.getCode(); + String message = PersoniumCoreException.BarInstall.REQUEST_HEADER_FORMAT_ERROR. params(HttpHeaders.CONTENT_TYPE).getMessage(); res.checkErrorResponse(code, message); } @@ -458,8 +458,8 @@ private static void cleanup() { res = BarInstallTestUtils.request(REQUEST_NORM_FILE, reqCell, reqPath, headers, body); res.statusCode(HttpStatus.SC_BAD_REQUEST); - String code = DcCoreException.BarInstall.REQUEST_HEADER_FORMAT_ERROR.getCode(); - String message = DcCoreException.BarInstall.REQUEST_HEADER_FORMAT_ERROR. + String code = PersoniumCoreException.BarInstall.REQUEST_HEADER_FORMAT_ERROR.getCode(); + String message = PersoniumCoreException.BarInstall.REQUEST_HEADER_FORMAT_ERROR. params(HttpHeaders.CONTENT_TYPE).getMessage(); res.checkErrorResponse(code, message); } @@ -480,8 +480,8 @@ private static void cleanup() { res = BarInstallTestUtils.request(REQUEST_NORM_FILE, reqCell, reqPath, headers, body); res.statusCode(HttpStatus.SC_BAD_REQUEST); - String code = DcCoreException.BarInstall.BAR_FILE_CANNOT_OPEN.getCode(); - String message = DcCoreException.BarInstall.BAR_FILE_CANNOT_OPEN. + String code = PersoniumCoreException.BarInstall.BAR_FILE_CANNOT_OPEN.getCode(); + String message = PersoniumCoreException.BarInstall.BAR_FILE_CANNOT_OPEN. params("archive is not a ZIP archive").getMessage(); res.checkErrorResponse(code, message); } @@ -504,8 +504,8 @@ private static void cleanup() { res = BarInstallTestUtils.request(REQUEST_NORM_FILE, reqCell, reqPath, headers, body); res.statusCode(HttpStatus.SC_BAD_REQUEST); - String code = DcCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES.getCode(); - String message = DcCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES. + String code = PersoniumCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES.getCode(); + String message = PersoniumCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES. params("bar/ bar/00_meta/ bar/00_meta/00_manifest.json bar/00_meta/90_rootprops.xml").getMessage(); res.checkErrorResponse(code, message); } @@ -612,8 +612,8 @@ private static void cleanup() { try { res = BarInstallTestUtils.request(REQUEST_METHOD_OVERRIDE_FILE, reqCell, reqPath, headers, body); res.statusCode(HttpStatus.SC_NOT_FOUND); - String code = DcCoreException.Dav.BOX_NOT_FOUND.getCode(); - String message = DcCoreException.Dav.BOX_NOT_FOUND + String code = PersoniumCoreException.Dav.BOX_NOT_FOUND.getCode(); + String message = PersoniumCoreException.Dav.BOX_NOT_FOUND .params(UrlUtils.boxRoot(reqCell, INSTALL_TARGET)).getMessage(); res.checkErrorResponse(code, message); } finally { @@ -673,7 +673,7 @@ private void deleteAllData(final String reqCell, deleteLink(Relation.EDM_TYPE_NAME, "Name='relation1',_Box.Name='" + INSTALL_TARGET + "'", "_" + Role.EDM_TYPE_NAME, role1); // Role <--> ExtRole - String extRole = DcCoreUtils.encodeUrlComp("https://fqdn/cellName/__role/__/role2"); + String extRole = PersoniumCoreUtils.encodeUrlComp("https://fqdn/cellName/__role/__/role2"); deleteLink(Role.EDM_TYPE_NAME, role1, "_" + ExtRole.EDM_TYPE_NAME, "ExtRole='" + extRole + "'" + ",_Relation.Name='relation1',_Relation._Box.Name='" + INSTALL_TARGET + "'"); @@ -841,7 +841,7 @@ private void checkEntityType(String cellName, String boxName, String colName, St */ private void checkComplexType(String cellName, String boxName, String colName, String complexName) { String complex1Url = UrlUtils.complexType(cellName, boxName, colName, complexName); - DcResponse dres = ODataCommon.getOdataResource(complex1Url); + PersoniumResponse dres = ODataCommon.getOdataResource(complex1Url); JSONObject json = dres.bodyAsJson(); JSONObject results = (JSONObject) ((JSONObject) json.get("d")).get("results"); String value = results.get(ComplexType.P_COMPLEXTYPE_NAME.getName()).toString(); @@ -858,7 +858,7 @@ private void checkComplexType(String cellName, String boxName, String colName, S */ private void checkAssocEnd(String cellName, String boxName, String colName, String entityName, String assocName) { String aeUrl = UrlUtils.associationEnd(cellName, boxName, colName, assocName, entityName); - DcResponse res = ODataCommon.getOdataResource(aeUrl); + PersoniumResponse res = ODataCommon.getOdataResource(aeUrl); JSONObject json = res.bodyAsJson(); JSONObject results = (JSONObject) ((JSONObject) json.get("d")).get("results"); String value = results.get(AssociationEnd.P_ASSOCIATION_NAME.getName()).toString(); @@ -872,7 +872,7 @@ private void checkAssocEnd(String cellName, String boxName, String colName, Stri private void checkAssocEndLinks(final String colName) { String path = UrlUtils.associationEnd(Setup.TEST_CELL1, INSTALL_TARGET, colName, "entity1-entity2", "entity1") + "/$links/_AssociationEnd"; - DcResponse dres = ODataCommon.getOdataResource(path); + PersoniumResponse dres = ODataCommon.getOdataResource(path); JSONObject json = dres.bodyAsJson(); JSONArray reses = (JSONArray) ((JSONObject) json.get("d")).get("results"); assertEquals(1, reses.size()); @@ -902,7 +902,7 @@ private void checkProperty(String cellName, String boxName, String colName, typeName = complexName; aeUrl = UrlUtils.complexTypeProperty(cellName, boxName, colName, propName, complexName); } - DcResponse res = ODataCommon.getOdataResource(aeUrl); + PersoniumResponse res = ODataCommon.getOdataResource(aeUrl); JSONObject json = res.bodyAsJson(); JSONObject results = (JSONObject) ((JSONObject) json.get("d")).get("results"); String value = results.get(Property.P_NAME.getName()).toString(); @@ -1179,8 +1179,8 @@ protected void deleteLink(String entitySet, String key, String navProp, String n res = BarInstallTestUtils.request(REQUEST_NORM_FILE, reqCell, reqPath, headers, body); res.statusCode(HttpStatus.SC_BAD_REQUEST); - String code = DcCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES.getCode(); - String message = DcCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES. + String code = PersoniumCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES.getCode(); + String message = PersoniumCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES. params("bar/ bar/00_meta/ bar/00_meta/00_manifest.json bar/00_meta/90_rootprops.xml").getMessage(); res.checkErrorResponse(code, message); } @@ -1238,8 +1238,8 @@ protected void deleteLink(String entitySet, String key, String navProp, String n res = BarInstallTestUtils.request(REQUEST_NORM_FILE, reqCell, reqPath, headers, body); res.statusCode(HttpStatus.SC_BAD_REQUEST); - String code = DcCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES.getCode(); - String message = DcCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES. + String code = PersoniumCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES.getCode(); + String message = PersoniumCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES. params("bar/00_meta/ bar/00_meta/00_manifest.json bar/00_meta/90_rootprops.xml").getMessage(); res.checkErrorResponse(code, message); } @@ -1262,8 +1262,8 @@ protected void deleteLink(String entitySet, String key, String navProp, String n res = BarInstallTestUtils.request(REQUEST_NORM_FILE, reqCell, reqPath, headers, body); res.statusCode(HttpStatus.SC_BAD_REQUEST); - String code = DcCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES.getCode(); - String message = DcCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES. + String code = PersoniumCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES.getCode(); + String message = PersoniumCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES. params("bar/00_meta/00_manifest.json").getMessage(); res.checkErrorResponse(code, message); } @@ -1286,8 +1286,8 @@ protected void deleteLink(String entitySet, String key, String navProp, String n res = BarInstallTestUtils.request(REQUEST_NORM_FILE, reqCell, reqPath, headers, body); res.statusCode(HttpStatus.SC_BAD_REQUEST); - String code = DcCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES.getCode(); - String message = DcCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES. + String code = PersoniumCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES.getCode(); + String message = PersoniumCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES. params("bar/00_meta/90_rootprops.xml").getMessage(); res.checkErrorResponse(code, message); } @@ -1310,8 +1310,8 @@ protected void deleteLink(String entitySet, String key, String navProp, String n res = BarInstallTestUtils.request(REQUEST_NORM_FILE, reqCell, reqPath, headers, body); res.statusCode(HttpStatus.SC_BAD_REQUEST); - String code = DcCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES.getCode(); - String message = DcCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES. + String code = PersoniumCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES.getCode(); + String message = PersoniumCoreException.BarInstall.BAR_FILE_INVALID_STRUCTURES. params("bar/00_meta/").getMessage(); res.checkErrorResponse(code, message); } @@ -1920,8 +1920,8 @@ protected void deleteLink(String entitySet, String key, String navProp, String n res = BarInstallTestUtils.request(token, REQUEST_NORM_FILE, reqCellName, reqBoxName, headers, body); res.statusCode(HttpStatus.SC_FORBIDDEN); - String code = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING.getCode(); - String message = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING.getMessage(); + String code = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING.getCode(); + String message = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING.getMessage(); res.checkErrorResponse(code, message); } finally { Setup.cellBulkDeletion(reqCellName); @@ -1957,8 +1957,8 @@ protected void deleteLink(String entitySet, String key, String navProp, String n res = BarInstallTestUtils.request(token, REQUEST_NORM_FILE, reqCellName, reqBoxName, headers, body); res.statusCode(HttpStatus.SC_BAD_REQUEST); - String code = DcCoreException.BarInstall.BAR_FILE_BOX_SCHEMA_ALREADY_EXISTS.getCode(); - String message = DcCoreException.BarInstall.BAR_FILE_BOX_SCHEMA_ALREADY_EXISTS. + String code = PersoniumCoreException.BarInstall.BAR_FILE_BOX_SCHEMA_ALREADY_EXISTS.getCode(); + String message = PersoniumCoreException.BarInstall.BAR_FILE_BOX_SCHEMA_ALREADY_EXISTS. params(SCHEMA_URL).getMessage(); res.checkErrorResponse(code, message); } finally { @@ -1994,8 +1994,8 @@ protected void deleteLink(String entitySet, String key, String navProp, String n res = BarInstallTestUtils.request(token, REQUEST_NORM_FILE, reqCellName, reqBoxName, headers, body); res.statusCode(HttpStatus.SC_METHOD_NOT_ALLOWED); - String code = DcCoreException.BarInstall.BAR_FILE_BOX_ALREADY_EXISTS.getCode(); - String message = DcCoreException.BarInstall.BAR_FILE_BOX_ALREADY_EXISTS. + String code = PersoniumCoreException.BarInstall.BAR_FILE_BOX_ALREADY_EXISTS.getCode(); + String message = PersoniumCoreException.BarInstall.BAR_FILE_BOX_ALREADY_EXISTS. params(reqBoxName).getMessage(); res.checkErrorResponse(code, message); } finally { @@ -2058,8 +2058,8 @@ protected void deleteLink(String entitySet, String key, String navProp, String n // Boxインストール2回目(既に同じスキーマURLを持つBoxが存在するため400エラー) res = BarInstallTestUtils.request(REQUEST_NORM_FILE, reqCell, "anotherBox", headers, body); res.statusCode(HttpStatus.SC_BAD_REQUEST); - String code = DcCoreException.BarInstall.BAR_FILE_BOX_SCHEMA_ALREADY_EXISTS.getCode(); - String message = DcCoreException.BarInstall.BAR_FILE_BOX_SCHEMA_ALREADY_EXISTS. + String code = PersoniumCoreException.BarInstall.BAR_FILE_BOX_SCHEMA_ALREADY_EXISTS.getCode(); + String message = PersoniumCoreException.BarInstall.BAR_FILE_BOX_SCHEMA_ALREADY_EXISTS. params("https://fqdn/testcell1/").getMessage(); res.checkErrorResponse(code, message); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/bar/BarInstallTestUtils.java b/src/test/java/io/personium/test/jersey/bar/BarInstallTestUtils.java similarity index 93% rename from src/test/java/com/fujitsu/dc/test/jersey/bar/BarInstallTestUtils.java rename to src/test/java/io/personium/test/jersey/bar/BarInstallTestUtils.java index 9ef55c850..57be8991c 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/bar/BarInstallTestUtils.java +++ b/src/test/java/io/personium/test/jersey/bar/BarInstallTestUtils.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.bar; +package io.personium.test.jersey.bar; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -35,13 +35,13 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.core.model.progress.ProgressInfo; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.model.progress.ProgressInfo; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * barファイルインストールテスト用ユーティリティクラス. @@ -244,7 +244,7 @@ public static TResponse propfind(final String cell, final String box, */ public static void assertBarInstallStatus(String location, String schemaUrl, ProgressInfo.STATUS status) { waitBoxInstallCompleted(location); - DcResponse res = ODataCommon.getOdataResource(location); + PersoniumResponse res = ODataCommon.getOdataResource(location); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); JSONObject bodyJson = (JSONObject) ((JSONObject) res.bodyAsJson()); @@ -271,7 +271,7 @@ public static void assertBarInstallStatus(String location, String schemaUrl, Pro * @param location Location */ public static void waitBoxInstallCompleted(String location) { - DcResponse response = null; + PersoniumResponse response = null; JSONObject bodyJson = null; long startTime = System.currentTimeMillis(); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/bar/BarInstallUserDataLinksLimitTest.java b/src/test/java/io/personium/test/jersey/bar/BarInstallUserDataLinksLimitTest.java similarity index 90% rename from src/test/java/com/fujitsu/dc/test/jersey/bar/BarInstallUserDataLinksLimitTest.java rename to src/test/java/io/personium/test/jersey/bar/BarInstallUserDataLinksLimitTest.java index 208ba42c3..fb63dfcbc 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/bar/BarInstallUserDataLinksLimitTest.java +++ b/src/test/java/io/personium/test/jersey/bar/BarInstallUserDataLinksLimitTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.bar; +package io.personium.test.jersey.bar; import static org.junit.Assert.assertEquals; @@ -35,34 +35,34 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreConfig.OData; -import com.fujitsu.dc.core.model.progress.ProgressInfo; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumUnitConfig.OData; +import io.personium.core.model.progress.ProgressInfo; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; /** * ユーザデータの$links制限値チェック向けのbarファイルインストール用テスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class }) public class BarInstallUserDataLinksLimitTest extends JerseyTest { private static final Map INIT_PARAMS = new HashMap(); static { - INIT_PARAMS.put("com.sun.jersey.config.property.packages", "com.fujitsu.dc.core.rs"); + INIT_PARAMS.put("com.sun.jersey.config.property.packages", "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } private static final String INSTALL_TARGET = "installBox"; @@ -74,7 +74,7 @@ public class BarInstallUserDataLinksLimitTest extends JerseyTest { private static int linkNtoNMaxSize = 40; - private static final int DEFAULT_LINKS_NTON_MAX_SIZE = DcCoreConfig.getLinksNtoNMaxSize(); + private static final int DEFAULT_LINKS_NTON_MAX_SIZE = PersoniumUnitConfig.getLinksNtoNMaxSize(); /** * コンストラクタ. @@ -88,7 +88,7 @@ public BarInstallUserDataLinksLimitTest() { */ @BeforeClass public static void beforeClass() { - DcCoreConfig.set(OData.NN_LINKS_MAX_NUM, + PersoniumUnitConfig.set(OData.NN_LINKS_MAX_NUM, String.valueOf(linkNtoNMaxSize)); } @@ -97,7 +97,7 @@ public static void beforeClass() { */ @AfterClass public static void afterClass() { - DcCoreConfig.set(OData.NN_LINKS_MAX_NUM, + PersoniumUnitConfig.set(OData.NN_LINKS_MAX_NUM, String.valueOf(DEFAULT_LINKS_NTON_MAX_SIZE)); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/bar/BarInstallUserDataTest.java b/src/test/java/io/personium/test/jersey/bar/BarInstallUserDataTest.java similarity index 98% rename from src/test/java/com/fujitsu/dc/test/jersey/bar/BarInstallUserDataTest.java rename to src/test/java/io/personium/test/jersey/bar/BarInstallUserDataTest.java index f6033ded8..cea2f7c94 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/bar/BarInstallUserDataTest.java +++ b/src/test/java/io/personium/test/jersey/bar/BarInstallUserDataTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.bar; +package io.personium.test.jersey.bar; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; @@ -37,29 +37,29 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.model.progress.ProgressInfo; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AssociationEndUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.model.progress.ProgressInfo; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AssociationEndUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; import com.sun.jersey.test.framework.JerseyTest; /** * ユーザデータ向けのbarファイルインストール用テスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class BarInstallUserDataTest extends JerseyTest { @@ -82,7 +82,7 @@ public class BarInstallUserDataTest extends JerseyTest { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public BarInstallUserDataTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -1676,7 +1676,7 @@ public void after() { */ private void checkUserData(String cellName, String boxName, String colName, String entityName, String userId) { String url = UrlUtils.userdata(cellName, boxName, colName, entityName, userId); - DcResponse res = ODataCommon.getOdataResource(url); + PersoniumResponse res = ODataCommon.getOdataResource(url); JSONObject json = res.bodyAsJson(); JSONObject results = (JSONObject) ((JSONObject) json.get("d")).get("results"); String value = results.get("__id").toString(); @@ -1703,8 +1703,8 @@ private void checkUserDataForDouble(String cellName, String colName, String entityName) throws Exception { final String query = "?$orderby=__id"; - final String token = DcCoreConfig.getMasterToken(); - DcResponse res = UserDataUtils.listEntities(cellName, boxName, colName, entityName, query, token, + final String token = PersoniumUnitConfig.getMasterToken(); + PersoniumResponse res = UserDataUtils.listEntities(cellName, boxName, colName, entityName, query, token, HttpStatus.SC_OK); String resString = res.bodyAsString(); JSONObject json = (JSONObject) new JSONParser().parse(resString); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/AllTests.java b/src/test/java/io/personium/test/jersey/box/AllTests.java similarity index 93% rename from src/test/java/com/fujitsu/dc/test/jersey/box/AllTests.java rename to src/test/java/io/personium/test/jersey/box/AllTests.java index 34080ce3e..2ab340754 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/AllTests.java +++ b/src/test/java/io/personium/test/jersey/box/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box; +package io.personium.test.jersey.box; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/Association.java b/src/test/java/io/personium/test/jersey/box/Association.java similarity index 95% rename from src/test/java/com/fujitsu/dc/test/jersey/box/Association.java rename to src/test/java/io/personium/test/jersey/box/Association.java index 9809399f1..62408b4f4 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/Association.java +++ b/src/test/java/io/personium/test/jersey/box/Association.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box; +package io.personium.test.jersey.box; import java.util.HashMap; import java.util.List; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/AssociationSet.java b/src/test/java/io/personium/test/jersey/box/AssociationSet.java similarity index 95% rename from src/test/java/com/fujitsu/dc/test/jersey/box/AssociationSet.java rename to src/test/java/io/personium/test/jersey/box/AssociationSet.java index c5269ec44..b74ffad79 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/AssociationSet.java +++ b/src/test/java/io/personium/test/jersey/box/AssociationSet.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box; +package io.personium.test.jersey.box; import java.util.List; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/Collection.java b/src/test/java/io/personium/test/jersey/box/Collection.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/box/Collection.java rename to src/test/java/io/personium/test/jersey/box/Collection.java index 24837f16c..bf26084fa 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/Collection.java +++ b/src/test/java/io/personium/test/jersey/box/Collection.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box; +package io.personium.test.jersey.box; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/CollectionLimitTest.java b/src/test/java/io/personium/test/jersey/box/CollectionLimitTest.java similarity index 93% rename from src/test/java/com/fujitsu/dc/test/jersey/box/CollectionLimitTest.java rename to src/test/java/io/personium/test/jersey/box/CollectionLimitTest.java index cce2be46a..eb39b3376 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/CollectionLimitTest.java +++ b/src/test/java/io/personium/test/jersey/box/CollectionLimitTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box; +package io.personium.test.jersey.box; import static org.junit.Assert.assertEquals; @@ -29,35 +29,35 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.model.progress.ProgressInfo; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.bar.BarInstallTestUtils; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.model.progress.ProgressInfo; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.bar.BarInstallTestUtils; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; /** * MKCOLのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({ Unit.class }) public class CollectionLimitTest extends JerseyTest { private static final Map INIT_PARAMS = new HashMap(); static { - INIT_PARAMS.put("com.sun.jersey.config.property.packages", "com.fujitsu.dc.core.rs"); + INIT_PARAMS.put("com.sun.jersey.config.property.packages", "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } /** @@ -94,7 +94,7 @@ public CollectionLimitTest() { BoxUtils.create(cellName, boxName, TOKEN, HttpStatus.SC_CREATED); // コレクションの階層数の最大値を取得 - int maxCollectionDepth = DcCoreConfig.getMaxCollectionDepth(); + int maxCollectionDepth = PersoniumUnitConfig.getMaxCollectionDepth(); // 最大値階層分のWebDavコレクションを作成 String path = ""; @@ -135,7 +135,7 @@ public CollectionLimitTest() { BoxUtils.create(cellName, boxName, TOKEN, HttpStatus.SC_CREATED); // コレクションの階層数の最大値を取得 - int maxCollectionDepth = DcCoreConfig.getMaxCollectionDepth(); + int maxCollectionDepth = PersoniumUnitConfig.getMaxCollectionDepth(); // 最大値階層分のWebDavコレクションを作成 String path = ""; @@ -178,7 +178,7 @@ public CollectionLimitTest() { BoxUtils.create(cellName, boxName, TOKEN, HttpStatus.SC_CREATED); // コレクションの子要素数の最大値を取得 - int maxChildCount = DcCoreConfig.getMaxChildResourceCount(); + int maxChildCount = PersoniumUnitConfig.getMaxChildResourceCount(); // 基底コレクションの作成 String basePath = "col1"; @@ -222,7 +222,7 @@ public CollectionLimitTest() { BoxUtils.create(cellName, boxName, TOKEN, HttpStatus.SC_CREATED); // コレクションの子要素数の最大値を取得 - int maxChildCount = DcCoreConfig.getMaxChildResourceCount(); + int maxChildCount = PersoniumUnitConfig.getMaxChildResourceCount(); // 基底コレクションの作成 String basePath = "col1"; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/CollectionTest.java b/src/test/java/io/personium/test/jersey/box/CollectionTest.java similarity index 96% rename from src/test/java/com/fujitsu/dc/test/jersey/box/CollectionTest.java rename to src/test/java/io/personium/test/jersey/box/CollectionTest.java index a5c0d00f7..078c8b456 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/CollectionTest.java +++ b/src/test/java/io/personium/test/jersey/box/CollectionTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box; +package io.personium.test.jersey.box; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -39,39 +39,39 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.box.odatacol.schema.complextype.ComplexTypeUtils; -import com.fujitsu.dc.test.jersey.box.odatacol.schema.complextypeproperty.ComplexTypePropertyUtils; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.TestMethodUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.Box; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.box.odatacol.schema.complextype.ComplexTypeUtils; +import io.personium.test.jersey.box.odatacol.schema.complextypeproperty.ComplexTypePropertyUtils; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.TestMethodUtils; import com.sun.jersey.test.framework.JerseyTest; /** * MKCOLのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class CollectionTest extends JerseyTest { /** * コンストラクタ. */ public CollectionTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } static final String ACL_AUTH_TEST_SETTING_FILE = "box/acl-authtest.txt"; @@ -150,17 +150,17 @@ public CollectionTest() { StringBuilder sb; sb = new StringBuilder(); sb.append(""); - sb.append(""); + sb.append(""); sb.append(""); sb.append(""); // Http http = Http.request("box/mkcol-custom.txt").with("path", path).with("token", TOKEN); try { // XML不正 - String code = DcCoreException.Dav.XML_ERROR.getCode(); - String message = DcCoreException.Dav.XML_ERROR.getMessage(); + String code = PersoniumCoreException.Dav.XML_ERROR.getCode(); + String message = PersoniumCoreException.Dav.XML_ERROR.getMessage(); sb = new StringBuilder(); sb.append(""); - sb.append(""); + sb.append(""); sb.append(""); sb.append(""); Http.request("box/mkcol-custom.txt") @@ -174,7 +174,7 @@ public CollectionTest() { // set 要素無し sb = new StringBuilder(); sb.append(""); - sb.append(""); + sb.append(""); sb.append(""); Http.request("box/mkcol-custom.txt") .with("path", path) @@ -186,7 +186,7 @@ public CollectionTest() { // set 要素名ミス sb = new StringBuilder(); sb.append(""); - sb.append(""); + sb.append(""); sb.append(""); sb.append(""); Http.request("box/mkcol-custom.txt") @@ -199,7 +199,7 @@ public CollectionTest() { // props 要素名ミス sb = new StringBuilder(); sb.append(""); - sb.append(""); + sb.append(""); sb.append(""); sb.append(""); Http.request("box/mkcol-custom.txt") @@ -212,7 +212,7 @@ public CollectionTest() { // resourcetype 要素名ミス sb = new StringBuilder(); sb.append(""); - sb.append(""); + sb.append(""); sb.append(""); sb.append(""); Http.request("box/mkcol-custom.txt") @@ -225,7 +225,7 @@ public CollectionTest() { // resourcetype が不正 sb = new StringBuilder(); sb.append(""); - sb.append(""); + sb.append(""); sb.append(""); sb.append(""); Http.request("box/mkcol-custom.txt") @@ -392,8 +392,8 @@ public CollectionTest() { .returns(); tresponseAll.statusCode(HttpStatus.SC_MULTI_STATUS); - // dc:odata の存在チェック - serviceColTypeTest(tresponseAll.bodyAsXml(), "dc:odata"); + // p:odata の存在チェック + serviceColTypeTest(tresponseAll.bodyAsXml(), "p:odata"); } finally { // Boxの削除 @@ -425,8 +425,8 @@ public CollectionTest() { .returns(); tresponseAll.statusCode(HttpStatus.SC_MULTI_STATUS); - // dc:service の存在チェック - serviceColTypeTest(tresponseAll.bodyAsXml(), "dc:service"); + // p:service の存在チェック + serviceColTypeTest(tresponseAll.bodyAsXml(), "p:service"); } finally { // コレクションの削除 deleteTest(path, -1); @@ -708,8 +708,8 @@ public CollectionTest() { // Odataの削除→子供(deleteEntType)があるため削除出来ない TResponse response = deleteTest(odataName, HttpStatus.SC_FORBIDDEN); - String code = DcCoreException.Dav.HAS_CHILDREN.getCode(); - String message = DcCoreException.Dav.HAS_CHILDREN.getMessage(); + String code = PersoniumCoreException.Dav.HAS_CHILDREN.getCode(); + String message = PersoniumCoreException.Dav.HAS_CHILDREN.getMessage(); response.checkErrorResponse(code, message); // EntityTypeの削除 @@ -746,8 +746,8 @@ public CollectionTest() { // Odataの削除→子供(ComplexType)があるため削除出来ない TResponse response = deleteTest(odataName, HttpStatus.SC_FORBIDDEN); - String code = DcCoreException.Dav.HAS_CHILDREN.getCode(); - String message = DcCoreException.Dav.HAS_CHILDREN.getMessage(); + String code = PersoniumCoreException.Dav.HAS_CHILDREN.getCode(); + String message = PersoniumCoreException.Dav.HAS_CHILDREN.getMessage(); response.checkErrorResponse(code, message); // ComplexTypePropertyの作成 @@ -756,8 +756,8 @@ public CollectionTest() { // Odataの削除→子供(ComplexType + ComplexTypeProeprty)があるため削除出来ない response = deleteTest(odataName, HttpStatus.SC_FORBIDDEN); - code = DcCoreException.Dav.HAS_CHILDREN.getCode(); - message = DcCoreException.Dav.HAS_CHILDREN.getMessage(); + code = PersoniumCoreException.Dav.HAS_CHILDREN.getCode(); + message = PersoniumCoreException.Dav.HAS_CHILDREN.getMessage(); response.checkErrorResponse(code, message); // ComplexTypePropertyの削除 @@ -803,8 +803,8 @@ public CollectionTest() { // serviceコレクションの削除→子供(__src/davFile.js)があるため削除出来ない TResponse response = deleteTest(sriveceName, HttpStatus.SC_FORBIDDEN); - String code = DcCoreException.Dav.HAS_CHILDREN.getCode(); - String message = DcCoreException.Dav.HAS_CHILDREN.getMessage(); + String code = PersoniumCoreException.Dav.HAS_CHILDREN.getCode(); + String message = PersoniumCoreException.Dav.HAS_CHILDREN.getMessage(); response.checkErrorResponse(code, message); // ファイルの削除 diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/DataSerevices.java b/src/test/java/io/personium/test/jersey/box/DataSerevices.java similarity index 95% rename from src/test/java/com/fujitsu/dc/test/jersey/box/DataSerevices.java rename to src/test/java/io/personium/test/jersey/box/DataSerevices.java index 0fa647e33..45a9bbbdc 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/DataSerevices.java +++ b/src/test/java/io/personium/test/jersey/box/DataSerevices.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box; +package io.personium.test.jersey.box; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/DavNodePropFindTest.java b/src/test/java/io/personium/test/jersey/box/DavNodePropFindTest.java similarity index 90% rename from src/test/java/com/fujitsu/dc/test/jersey/box/DavNodePropFindTest.java rename to src/test/java/io/personium/test/jersey/box/DavNodePropFindTest.java index e421f5d01..4606b1fd7 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/DavNodePropFindTest.java +++ b/src/test/java/io/personium/test/jersey/box/DavNodePropFindTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box; +package io.personium.test.jersey.box; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -35,23 +35,23 @@ import org.w3c.dom.Element; import org.w3c.dom.NodeList; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.setup.Setup; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; /** * PROPFINDのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class DavNodePropFindTest extends JerseyTest { // セル再帰的削除を使うための設定 @@ -59,11 +59,11 @@ public class DavNodePropFindTest extends JerseyTest { private static final Map INIT_PARAMS = new HashMap(); static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } private static final String TOKEN = AbstractCase.MASTER_TOKEN_NAME; @@ -72,7 +72,7 @@ public class DavNodePropFindTest extends JerseyTest { /** * コンストラクタ. - * DcCoreContainerFilterクラスを設定しておく + * PersoniumCoreContainerFilterクラスを設定しておく */ public DavNodePropFindTest() { super(new WebAppDescriptor.Builder(DavNodePropFindTest.INIT_PARAMS).build()); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/DavValidateTest.java b/src/test/java/io/personium/test/jersey/box/DavValidateTest.java similarity index 87% rename from src/test/java/com/fujitsu/dc/test/jersey/box/DavValidateTest.java rename to src/test/java/io/personium/test/jersey/box/DavValidateTest.java index cc168898b..20a6d5b01 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/DavValidateTest.java +++ b/src/test/java/io/personium/test/jersey/box/DavValidateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box; +package io.personium.test.jersey.box; import java.util.ArrayList; @@ -23,19 +23,19 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.utils.Http; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.setup.Setup; +import io.personium.test.utils.Http; import com.sun.jersey.test.framework.JerseyTest; /** * MKCOLのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class DavValidateTest extends JerseyTest { ArrayList validNames; @@ -46,7 +46,7 @@ public class DavValidateTest extends JerseyTest { * コンストラクタ. */ public DavValidateTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); validNames = new ArrayList(); //validNames.add("a%5c"); // %5C は リクエストを投げる事ができなかったため、手動でのみ確認 validNames.add("a%20"); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/Edmx.java b/src/test/java/io/personium/test/jersey/box/Edmx.java similarity index 95% rename from src/test/java/com/fujitsu/dc/test/jersey/box/Edmx.java rename to src/test/java/io/personium/test/jersey/box/Edmx.java index caeba922c..91d3fe2fb 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/Edmx.java +++ b/src/test/java/io/personium/test/jersey/box/Edmx.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box; +package io.personium.test.jersey.box; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/End.java b/src/test/java/io/personium/test/jersey/box/End.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/box/End.java rename to src/test/java/io/personium/test/jersey/box/End.java index 55af1a7f9..0ccd8dbaf 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/End.java +++ b/src/test/java/io/personium/test/jersey/box/End.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box; +package io.personium.test.jersey.box; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/EndAssociationSet.java b/src/test/java/io/personium/test/jersey/box/EndAssociationSet.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/box/EndAssociationSet.java rename to src/test/java/io/personium/test/jersey/box/EndAssociationSet.java index ae8875713..fa1393953 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/EndAssociationSet.java +++ b/src/test/java/io/personium/test/jersey/box/EndAssociationSet.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box; +package io.personium.test.jersey.box; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/EntityContainer.java b/src/test/java/io/personium/test/jersey/box/EntityContainer.java similarity index 98% rename from src/test/java/com/fujitsu/dc/test/jersey/box/EntityContainer.java rename to src/test/java/io/personium/test/jersey/box/EntityContainer.java index daafb8e1f..17e95892f 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/EntityContainer.java +++ b/src/test/java/io/personium/test/jersey/box/EntityContainer.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box; +package io.personium.test.jersey.box; import static org.junit.Assert.assertEquals; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/EntitySet.java b/src/test/java/io/personium/test/jersey/box/EntitySet.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/box/EntitySet.java rename to src/test/java/io/personium/test/jersey/box/EntitySet.java index c668df7da..0303d76d5 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/EntitySet.java +++ b/src/test/java/io/personium/test/jersey/box/EntitySet.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box; +package io.personium.test.jersey.box; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/EntityType.java b/src/test/java/io/personium/test/jersey/box/EntityType.java similarity index 96% rename from src/test/java/com/fujitsu/dc/test/jersey/box/EntityType.java rename to src/test/java/io/personium/test/jersey/box/EntityType.java index 27911af28..310f5c75a 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/EntityType.java +++ b/src/test/java/io/personium/test/jersey/box/EntityType.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box; +package io.personium.test.jersey.box; import java.util.List; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/Key.java b/src/test/java/io/personium/test/jersey/box/Key.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/box/Key.java rename to src/test/java/io/personium/test/jersey/box/Key.java index a9ab965a5..a692cc231 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/Key.java +++ b/src/test/java/io/personium/test/jersey/box/Key.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box; +package io.personium.test.jersey.box; import java.util.List; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/Link.java b/src/test/java/io/personium/test/jersey/box/Link.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/box/Link.java rename to src/test/java/io/personium/test/jersey/box/Link.java index ed979e8e4..afc17e95a 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/Link.java +++ b/src/test/java/io/personium/test/jersey/box/Link.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box; +package io.personium.test.jersey.box; import java.util.List; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/NavigationProperty.java b/src/test/java/io/personium/test/jersey/box/NavigationProperty.java similarity index 95% rename from src/test/java/com/fujitsu/dc/test/jersey/box/NavigationProperty.java rename to src/test/java/io/personium/test/jersey/box/NavigationProperty.java index d5159114a..316fe09d4 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/NavigationProperty.java +++ b/src/test/java/io/personium/test/jersey/box/NavigationProperty.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box; +package io.personium.test.jersey.box; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/Property.java b/src/test/java/io/personium/test/jersey/box/Property.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/box/Property.java rename to src/test/java/io/personium/test/jersey/box/Property.java index 0b64d3a6b..992a0b329 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/Property.java +++ b/src/test/java/io/personium/test/jersey/box/Property.java @@ -14,14 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box; +package io.personium.test.jersey.box; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlType; -import com.fujitsu.dc.common.utils.DcCoreUtils; +import io.personium.common.utils.PersoniumCoreUtils; /** * Propertyを扱うオブジェクト. @@ -81,7 +81,7 @@ Property setUnique(String uniq) { @XmlAttribute(name = "Precision") String precision; - @XmlAttribute(namespace = DcCoreUtils.XmlConst.NS_DC1, name = "Unique") + @XmlAttribute(namespace = PersoniumCoreUtils.XmlConst.NS_PERSONIUM, name = "Unique") String unique; @Override diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/PropertyRef.java b/src/test/java/io/personium/test/jersey/box/PropertyRef.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/box/PropertyRef.java rename to src/test/java/io/personium/test/jersey/box/PropertyRef.java index 850513437..81ac0fc70 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/PropertyRef.java +++ b/src/test/java/io/personium/test/jersey/box/PropertyRef.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box; +package io.personium.test.jersey.box; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/PropfindContentLengthTest.java b/src/test/java/io/personium/test/jersey/box/PropfindContentLengthTest.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/box/PropfindContentLengthTest.java rename to src/test/java/io/personium/test/jersey/box/PropfindContentLengthTest.java index c80001795..8c2467848 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/PropfindContentLengthTest.java +++ b/src/test/java/io/personium/test/jersey/box/PropfindContentLengthTest.java @@ -14,28 +14,28 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box; +package io.personium.test.jersey.box; import org.apache.http.HttpStatus; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.setup.Setup; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; import com.sun.jersey.test.framework.JerseyTest; /** * PROPFINDのContent-Lengthの有無に関するテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class PropfindContentLengthTest extends JerseyTest { @@ -52,7 +52,7 @@ public class PropfindContentLengthTest extends JerseyTest { * コンストラクタ. */ public PropfindContentLengthTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/Schema.java b/src/test/java/io/personium/test/jersey/box/Schema.java similarity index 99% rename from src/test/java/com/fujitsu/dc/test/jersey/box/Schema.java rename to src/test/java/io/personium/test/jersey/box/Schema.java index d030943cc..f730e8c18 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/Schema.java +++ b/src/test/java/io/personium/test/jersey/box/Schema.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box; +package io.personium.test.jersey.box; import java.util.List; import java.util.Map; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/Service.java b/src/test/java/io/personium/test/jersey/box/Service.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/box/Service.java rename to src/test/java/io/personium/test/jersey/box/Service.java index 494d52af5..bab811281 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/Service.java +++ b/src/test/java/io/personium/test/jersey/box/Service.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box; +package io.personium.test.jersey.box; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/ServiceRelayTest.java b/src/test/java/io/personium/test/jersey/box/ServiceRelayTest.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/box/ServiceRelayTest.java rename to src/test/java/io/personium/test/jersey/box/ServiceRelayTest.java index 4839e9756..4c0791138 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/ServiceRelayTest.java +++ b/src/test/java/io/personium/test/jersey/box/ServiceRelayTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box; +package io.personium.test.jersey.box; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -29,26 +29,26 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.utils.Http; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; /** * サービス実行のリレーテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Integration.class, Regression.class }) public class ServiceRelayTest extends JerseyTest { /** * コンストラクタ. */ public ServiceRelayTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** リクエスト情報をそのままJSON文字列で返却するJSソース. */ diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/ServiceSchmaTest.java b/src/test/java/io/personium/test/jersey/box/ServiceSchmaTest.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/box/ServiceSchmaTest.java rename to src/test/java/io/personium/test/jersey/box/ServiceSchmaTest.java index b634ef603..8dbec927b 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/ServiceSchmaTest.java +++ b/src/test/java/io/personium/test/jersey/box/ServiceSchmaTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box; +package io.personium.test.jersey.box; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -45,28 +45,28 @@ import org.w3c.dom.NodeList; import org.xml.sax.SAXException; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.utils.AssociationEndUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.setup.Setup; +import io.personium.test.utils.AssociationEndUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; /** * $metadata/$metadataのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class ServiceSchmaTest extends JerseyTest { @@ -74,11 +74,11 @@ public class ServiceSchmaTest extends JerseyTest { static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } /** @@ -98,7 +98,7 @@ public ServiceSchmaTest() { .with("path", "\\$metadata") .with("col", "setodata") .with("accept", "application/atomsvc+xml") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -129,7 +129,7 @@ public ServiceSchmaTest() { .with("path", "\\$metadata\\?\\$format=atomsvc") .with("col", "setodata") .with("accept", "application/xml") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -165,7 +165,7 @@ public ServiceSchmaTest() { .with("path", "\\$metadata") .with("col", "setodata") .with("accept", "application/xml") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -239,7 +239,7 @@ public ServiceSchmaTest() { .with("box", boxName) .with("col", colName) .with("accept", "application/xml") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -346,7 +346,7 @@ public ServiceSchmaTest() { String multiplicity = "1"; try { // EntityTypeの作成 - EntityTypeUtils.create(Setup.TEST_CELL1, DcCoreConfig.getMasterToken(), + EntityTypeUtils.create(Setup.TEST_CELL1, PersoniumUnitConfig.getMasterToken(), odataSvcName, entityTypeName, HttpStatus.SC_CREATED); // 上のEntityTypeと結びつくAssociationEnd作成 @@ -422,7 +422,7 @@ private TResponse associationEndPost(final String cellName, final String path, f .with("path", "\\$metadata/\\$metadata") .with("col", "setodata") .with("accept", "application/xml") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/ServiceSourceTest.java b/src/test/java/io/personium/test/jersey/box/ServiceSourceTest.java similarity index 95% rename from src/test/java/com/fujitsu/dc/test/jersey/box/ServiceSourceTest.java rename to src/test/java/io/personium/test/jersey/box/ServiceSourceTest.java index ae7652b55..dd03db356 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/ServiceSourceTest.java +++ b/src/test/java/io/personium/test/jersey/box/ServiceSourceTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box; +package io.personium.test.jersey.box; import static org.junit.Assert.assertEquals; @@ -31,22 +31,22 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; /** * MKCOLのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class ServiceSourceTest extends JerseyTest { @@ -63,7 +63,7 @@ public class ServiceSourceTest extends JerseyTest { * コンストラクタ. */ public ServiceSourceTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/Workspace.java b/src/test/java/io/personium/test/jersey/box/Workspace.java similarity index 95% rename from src/test/java/com/fujitsu/dc/test/jersey/box/Workspace.java rename to src/test/java/io/personium/test/jersey/box/Workspace.java index d76c4b95c..8369218a6 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/Workspace.java +++ b/src/test/java/io/personium/test/jersey/box/Workspace.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box; +package io.personium.test.jersey.box; import static org.junit.Assert.assertEquals; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/acl/AclAlterSchemaTest.java b/src/test/java/io/personium/test/jersey/box/acl/AclAlterSchemaTest.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/box/acl/AclAlterSchemaTest.java rename to src/test/java/io/personium/test/jersey/box/acl/AclAlterSchemaTest.java index 5e6346e87..43077f2f9 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/acl/AclAlterSchemaTest.java +++ b/src/test/java/io/personium/test/jersey/box/acl/AclAlterSchemaTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.acl; +package io.personium.test.jersey.box.acl; import static org.fest.assertions.Assertions.assertThat; @@ -36,29 +36,29 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.auth.OAuth2Helper; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.box.acl.jaxb.Acl; -import com.fujitsu.dc.test.jersey.box.odatacol.schema.complextype.ComplexTypeUtils; -import com.fujitsu.dc.test.jersey.box.odatacol.schema.complextypeproperty.ComplexTypePropertyUtils; -import com.fujitsu.dc.test.jersey.box.odatacol.schema.property.PropertyUtils; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.AssociationEndUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.ODataSchemaUtils; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.auth.OAuth2Helper; +import io.personium.core.model.Box; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.box.acl.jaxb.Acl; +import io.personium.test.jersey.box.odatacol.schema.complextype.ComplexTypeUtils; +import io.personium.test.jersey.box.odatacol.schema.complextypeproperty.ComplexTypePropertyUtils; +import io.personium.test.jersey.box.odatacol.schema.property.PropertyUtils; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.AssociationEndUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.ODataSchemaUtils; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.UserDataUtils; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; @@ -66,7 +66,7 @@ * BOXレベル-スキーマ変更に関するACLのテスト.
* ※データの存在チェックよりも権限チェックの方が先に行われるため、事前にデータを作成せずに行っている. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class AclAlterSchemaTest extends JerseyTest { @@ -86,11 +86,11 @@ public class AclAlterSchemaTest extends JerseyTest { private static final Map INIT_PARAMS = new HashMap(); static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } /** @@ -316,7 +316,7 @@ public void after() { PropertyUtils.create(OAuth2Helper.Scheme.BEARER + " " + token, CELL_NAME, BOX_NAME, COL_NAME, entityTypeName, propertyName, "Edm.Int32", true, null, "None", false, null, HttpStatus.SC_FORBIDDEN); - DcResponse res = PropertyUtils.get(token, CELL_NAME, BOX_NAME, COL_NAME, propertyName, entityTypeName); + PersoniumResponse res = PropertyUtils.get(token, CELL_NAME, BOX_NAME, COL_NAME, propertyName, entityTypeName); assertThat(res.getStatusCode()).isEqualTo(HttpStatus.SC_NOT_FOUND); res = PropertyUtils.list(token, CELL_NAME, BOX_NAME, COL_NAME); assertThat(res.getStatusCode()).isEqualTo(HttpStatus.SC_OK); @@ -451,7 +451,7 @@ public void after() { // 参照系: OK 更新系: NG ComplexTypePropertyUtils.createWithToken(token, CELL_NAME, BOX_NAME, COL_NAME, complexTypePropertyName, complexTypeName, "Edm.Int32", HttpStatus.SC_FORBIDDEN); - DcResponse res = ComplexTypePropertyUtils.get(token, CELL_NAME, BOX_NAME, COL_NAME, + PersoniumResponse res = ComplexTypePropertyUtils.get(token, CELL_NAME, BOX_NAME, COL_NAME, complexTypePropertyName, complexTypeName); assertThat(res.getStatusCode()).isEqualTo(HttpStatus.SC_NOT_FOUND); ComplexTypePropertyUtils.list(token, CELL_NAME, BOX_NAME, COL_NAME, HttpStatus.SC_OK); @@ -657,7 +657,7 @@ public void after() { UserDataUtils.create(MASTER_TOKEN, HttpStatus.SC_CREATED, body, CELL_NAME, BOX_NAME, COL_NAME, entityTypeName); // ダイナミックプロパティに対する確認 - DcResponse res = PropertyUtils.get(token, CELL_NAME, BOX_NAME, COL_NAME, propertyName, entityTypeName); + PersoniumResponse res = PropertyUtils.get(token, CELL_NAME, BOX_NAME, COL_NAME, propertyName, entityTypeName); assertThat(res.getStatusCode()).isEqualTo(HttpStatus.SC_OK); res = PropertyUtils.list(token, CELL_NAME, BOX_NAME, COL_NAME); assertThat(res.getStatusCode()).isEqualTo(HttpStatus.SC_OK); @@ -679,7 +679,7 @@ public void after() { UserDataUtils.create(MASTER_TOKEN, HttpStatus.SC_CREATED, body, CELL_NAME, BOX_NAME, COL_NAME, entityTypeName); // ダイナミックプロパティに対する確認 - DcResponse res = PropertyUtils.get(token, CELL_NAME, BOX_NAME, COL_NAME, propertyName, entityTypeName); + PersoniumResponse res = PropertyUtils.get(token, CELL_NAME, BOX_NAME, COL_NAME, propertyName, entityTypeName); assertThat(res.getStatusCode()).isEqualTo(HttpStatus.SC_FORBIDDEN); res = PropertyUtils.list(token, CELL_NAME, BOX_NAME, COL_NAME); assertThat(res.getStatusCode()).isEqualTo(HttpStatus.SC_FORBIDDEN); @@ -701,7 +701,7 @@ public void after() { UserDataUtils.create(MASTER_TOKEN, HttpStatus.SC_CREATED, body, CELL_NAME, BOX_NAME, COL_NAME, entityTypeName); // ダイナミックプロパティに対する確認 - DcResponse res = PropertyUtils.get(token, CELL_NAME, BOX_NAME, COL_NAME, propertyName, entityTypeName); + PersoniumResponse res = PropertyUtils.get(token, CELL_NAME, BOX_NAME, COL_NAME, propertyName, entityTypeName); assertThat(res.getStatusCode()).isEqualTo(HttpStatus.SC_FORBIDDEN); res = PropertyUtils.list(token, CELL_NAME, BOX_NAME, COL_NAME); assertThat(res.getStatusCode()).isEqualTo(HttpStatus.SC_FORBIDDEN); @@ -723,7 +723,7 @@ public void after() { UserDataUtils.create(MASTER_TOKEN, HttpStatus.SC_CREATED, body, CELL_NAME, BOX_NAME, COL_NAME, entityTypeName); // ダイナミックプロパティに対する確認 - DcResponse res = PropertyUtils.get(token, CELL_NAME, BOX_NAME, COL_NAME, propertyName, entityTypeName); + PersoniumResponse res = PropertyUtils.get(token, CELL_NAME, BOX_NAME, COL_NAME, propertyName, entityTypeName); assertThat(res.getStatusCode()).isEqualTo(HttpStatus.SC_FORBIDDEN); res = PropertyUtils.list(token, CELL_NAME, BOX_NAME, COL_NAME); assertThat(res.getStatusCode()).isEqualTo(HttpStatus.SC_FORBIDDEN); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/acl/AclTest.java b/src/test/java/io/personium/test/jersey/box/acl/AclTest.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/box/acl/AclTest.java rename to src/test/java/io/personium/test/jersey/box/acl/AclTest.java index 7421715e0..1ef627063 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/acl/AclTest.java +++ b/src/test/java/io/personium/test/jersey/box/acl/AclTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.acl; +package io.personium.test.jersey.box.acl; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -32,44 +32,44 @@ import org.w3c.dom.Element; import org.w3c.dom.NodeList; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.auth.OAuth2Helper; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.TestMethodUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.auth.OAuth2Helper; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.TestMethodUtils; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; /** * BOXレベルACLのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class AclTest extends JerseyTest { private static final Map INIT_PARAMS = new HashMap(); static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } static final String TEST_CELL1 = "testcell1"; @@ -609,7 +609,7 @@ public AclTest() { TResponse res = DavResourceUtils.setACLwithBox(TEST_CELL1, TOKEN, HttpStatus.SC_NOT_FOUND, "noneExistBox", "", ACL_SETTING_TEST, "role", "noneExistBox", "", ""); String boxUrl = UrlUtils.boxRoot(TEST_CELL1, "noneExistBox"); - DcCoreException expectedException = DcCoreException.Dav.BOX_NOT_FOUND.params(boxUrl); + PersoniumCoreException expectedException = PersoniumCoreException.Dav.BOX_NOT_FOUND.params(boxUrl); ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -720,8 +720,8 @@ public AclTest() { .with("body", body) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.Dav.XML_VALIDATE_ERROR.getCode(), - DcCoreException.Dav.XML_VALIDATE_ERROR.getMessage()); + res.checkErrorResponse(PersoniumCoreException.Dav.XML_VALIDATE_ERROR.getCode(), + PersoniumCoreException.Dav.XML_VALIDATE_ERROR.getMessage()); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/acl/AllTests.java b/src/test/java/io/personium/test/jersey/box/acl/AllTests.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/box/acl/AllTests.java rename to src/test/java/io/personium/test/jersey/box/acl/AllTests.java index b367b2839..64914fc6c 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/acl/AllTests.java +++ b/src/test/java/io/personium/test/jersey/box/acl/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.acl; +package io.personium.test.jersey.box.acl; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/acl/jaxb/Ace.java b/src/test/java/io/personium/test/jersey/box/acl/jaxb/Ace.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/box/acl/jaxb/Ace.java rename to src/test/java/io/personium/test/jersey/box/acl/jaxb/Ace.java index cda7b4f71..38e24d7a4 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/acl/jaxb/Ace.java +++ b/src/test/java/io/personium/test/jersey/box/acl/jaxb/Ace.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.acl.jaxb; +package io.personium.test.jersey.box.acl.jaxb; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/acl/jaxb/Acl.java b/src/test/java/io/personium/test/jersey/box/acl/jaxb/Acl.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/box/acl/jaxb/Acl.java rename to src/test/java/io/personium/test/jersey/box/acl/jaxb/Acl.java index ea7d3337e..ac367dbf6 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/acl/jaxb/Acl.java +++ b/src/test/java/io/personium/test/jersey/box/acl/jaxb/Acl.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.acl.jaxb; +package io.personium.test.jersey.box.acl.jaxb; import java.util.ArrayList; import java.util.List; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/acl/jaxb/Grant.java b/src/test/java/io/personium/test/jersey/box/acl/jaxb/Grant.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/box/acl/jaxb/Grant.java rename to src/test/java/io/personium/test/jersey/box/acl/jaxb/Grant.java index b23c76f5b..42f2e1bfe 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/acl/jaxb/Grant.java +++ b/src/test/java/io/personium/test/jersey/box/acl/jaxb/Grant.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.acl.jaxb; +package io.personium.test.jersey.box.acl.jaxb; import java.util.ArrayList; import java.util.List; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/acl/jaxb/Principal.java b/src/test/java/io/personium/test/jersey/box/acl/jaxb/Principal.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/box/acl/jaxb/Principal.java rename to src/test/java/io/personium/test/jersey/box/acl/jaxb/Principal.java index f968cbd12..c6716c773 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/acl/jaxb/Principal.java +++ b/src/test/java/io/personium/test/jersey/box/acl/jaxb/Principal.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.acl.jaxb; +package io.personium.test.jersey.box.acl.jaxb; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/acl/jaxb/Privilege.java b/src/test/java/io/personium/test/jersey/box/acl/jaxb/Privilege.java similarity index 95% rename from src/test/java/com/fujitsu/dc/test/jersey/box/acl/jaxb/Privilege.java rename to src/test/java/io/personium/test/jersey/box/acl/jaxb/Privilege.java index d249bd422..655e6234b 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/acl/jaxb/Privilege.java +++ b/src/test/java/io/personium/test/jersey/box/acl/jaxb/Privilege.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.acl.jaxb; +package io.personium.test.jersey.box.acl.jaxb; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/acl/jaxb/package-info.java b/src/test/java/io/personium/test/jersey/box/acl/jaxb/package-info.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/box/acl/jaxb/package-info.java rename to src/test/java/io/personium/test/jersey/box/acl/jaxb/package-info.java index 55d7c7934..1f69d2fdf 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/acl/jaxb/package-info.java +++ b/src/test/java/io/personium/test/jersey/box/acl/jaxb/package-info.java @@ -20,7 +20,7 @@ @XmlNs(namespaceURI = "DAV:", prefix = "D") }, elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) -package com.fujitsu.dc.test.jersey.box.acl.jaxb; +package io.personium.test.jersey.box.acl.jaxb; import javax.xml.bind.annotation.XmlNs; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/AllTests.java b/src/test/java/io/personium/test/jersey/box/dav/AllTests.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/box/dav/AllTests.java rename to src/test/java/io/personium/test/jersey/box/dav/AllTests.java index 9d1a552e7..7dc0caef6 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/AllTests.java +++ b/src/test/java/io/personium/test/jersey/box/dav/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.dav; +package io.personium.test.jersey.box.dav; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/MoveLimitTest.java b/src/test/java/io/personium/test/jersey/box/dav/MoveLimitTest.java similarity index 88% rename from src/test/java/com/fujitsu/dc/test/jersey/box/dav/MoveLimitTest.java rename to src/test/java/io/personium/test/jersey/box/dav/MoveLimitTest.java index 825332bc9..840672c6e 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/MoveLimitTest.java +++ b/src/test/java/io/personium/test/jersey/box/dav/MoveLimitTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.dav; +package io.personium.test.jersey.box.dav; import java.util.HashMap; import java.util.Map; @@ -27,21 +27,21 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; @@ -50,7 +50,7 @@ /** * MOVEの最大値に関するテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class MoveLimitTest extends JerseyTest { private static final String TOKEN = AbstractCase.MASTER_TOKEN_NAME; @@ -64,11 +64,11 @@ public class MoveLimitTest extends JerseyTest { private static final Map INIT_PARAMS = new HashMap(); static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } /** @@ -110,7 +110,7 @@ public MoveLimitTest() { BOX_NAME + "/" + SRC_COL_NAME + "/" + moveFileNameOverLimitCount, FILE_BODY, MediaType.TEXT_PLAIN, HttpStatus.SC_CREATED); // 移動先のCollectionに子要素数の最大値 - 2までファイル作成 - for (int i = 0; i < DcCoreConfig.getMaxChildResourceCount() - 2; i++) { + for (int i = 0; i < PersoniumUnitConfig.getMaxChildResourceCount() - 2; i++) { String fileName = String.format("%s_%05d", DST_RESOURCE_PREFIX, i); DavResourceUtils.createWebDavFile(TOKEN, CELL_NAME, BOX_NAME + "/" + DST_COL_NAME + "/" + fileName, FILE_BODY, MediaType.TEXT_PLAIN, @@ -132,12 +132,12 @@ public MoveLimitTest() { // Fileの移動(最大値, 上書き) → 204 destination = UrlUtils.box(CELL_NAME, BOX_NAME, DST_COL_NAME, moveFileNameEqualLimitCount); String url = UrlUtils.box(CELL_NAME, BOX_NAME, SRC_COL_NAME, moveOverwriteFileNameEqualLimitCount); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "T"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_NO_CONTENT); // Fileの移動(最大値 + 1) → 400 @@ -145,7 +145,7 @@ public MoveLimitTest() { TResponse res = DavResourceUtils.moveWebDav(TOKEN, CELL_NAME, BOX_NAME + "/" + SRC_COL_NAME + "/" + moveFileNameOverLimitCount, destination, HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.COLLECTION_CHILDRESOURCE_ERROR; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.COLLECTION_CHILDRESOURCE_ERROR; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); // 移動したファイルを取得できること @@ -203,7 +203,7 @@ public MoveLimitTest() { BOX_NAME, SRC_COL_NAME + "/" + moveCollectionNameOverLimitCount); // 移動先のCollectionに子要素数の最大値 - 2までコレクション作成 - for (int i = 0; i < DcCoreConfig.getMaxChildResourceCount() - 2; i++) { + for (int i = 0; i < PersoniumUnitConfig.getMaxChildResourceCount() - 2; i++) { String collectionName = String.format("%s_%05d", DST_RESOURCE_PREFIX, i); DavResourceUtils.createWebDavCollection(TOKEN, HttpStatus.SC_CREATED, CELL_NAME, BOX_NAME, DST_COL_NAME + "/" + collectionName); @@ -225,12 +225,12 @@ public MoveLimitTest() { // TODO 現状は上書き指定に対応していないため、400としているが、上書き指定に対応した際は204に変更する destination = UrlUtils.box(CELL_NAME, BOX_NAME, DST_COL_NAME, moveCollectionNameEqualLimitCount); String url = UrlUtils.box(CELL_NAME, BOX_NAME, SRC_COL_NAME, moveOverwriteCollectionNameEqualLimitCount); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "T"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); // Collectionの移動(最大値 + 1) → 400 @@ -238,7 +238,7 @@ public MoveLimitTest() { TResponse res = DavResourceUtils.moveWebDav(TOKEN, CELL_NAME, BOX_NAME + "/" + SRC_COL_NAME + "/" + moveCollectionNameOverLimitCount, destination, HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.COLLECTION_CHILDRESOURCE_ERROR; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.COLLECTION_CHILDRESOURCE_ERROR; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); // 移動したコレクションを取得できること @@ -276,7 +276,7 @@ public MoveLimitTest() { // 移動先のCollectionに階層の深さの最大値 - 2までコレクション作成 String destPath = ""; int index; - for (index = 0; index < DcCoreConfig.getMaxCollectionDepth() - 2; index++) { + for (index = 0; index < PersoniumUnitConfig.getMaxCollectionDepth() - 2; index++) { destPath = String.format("%s%s_%03d/", destPath, DST_RESOURCE_PREFIX, index); DavResourceUtils.createWebDavCollection(TOKEN, HttpStatus.SC_CREATED, CELL_NAME, BOX_NAME, destPath); @@ -302,14 +302,14 @@ public MoveLimitTest() { // 移動(最大値, 上書き) → 204 // TODO 現状は上書き指定に対応していないため、400としているが、上書き指定に対応した際は204に変更する DavResourceUtils.createWebDavCollection(TOKEN, HttpStatus.SC_CREATED, CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(UrlUtils.box(CELL_NAME, BOX_NAME, srcCol)); + PersoniumRequest req = PersoniumRequest.move(UrlUtils.box(CELL_NAME, BOX_NAME, srcCol)); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "T"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); // エラーコード確認 - DcCoreException expectedException = DcCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -325,7 +325,7 @@ public MoveLimitTest() { // TResponse res = DavResourceUtils.moveWebDav(TOKEN, CELL_NAME, BOX_NAME + "/" + srcCol, destUrl, // HttpStatus.SC_BAD_REQUEST); // // エラーコード確認 - // expectedException = DcCoreException.Dav.COLLECTION_DEPTH_ERROR; + // expectedException = PersoniumCoreException.Dav.COLLECTION_DEPTH_ERROR; // ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -346,7 +346,7 @@ public MoveLimitTest() { // 移動先のCollectionに階層の深さの最大値 - 2までコレクション作成 String destPath = ""; int index; - for (index = 0; index < DcCoreConfig.getMaxCollectionDepth() - 2; index++) { + for (index = 0; index < PersoniumUnitConfig.getMaxCollectionDepth() - 2; index++) { destPath = String.format("%s%s_%03d/", destPath, DST_RESOURCE_PREFIX, index); DavResourceUtils.createWebDavCollection(TOKEN, HttpStatus.SC_CREATED, CELL_NAME, BOX_NAME, destPath); @@ -376,7 +376,7 @@ public MoveLimitTest() { // TResponse res = DavResourceUtils.moveWebDav(TOKEN, CELL_NAME, BOX_NAME + "/" + srcCol, destUrl, // HttpStatus.SC_BAD_REQUEST); // // エラーコード確認 - // DcCoreException expectedException = DcCoreException.Dav.COLLECTION_DEPTH_ERROR; + // PersoniumCoreException expectedException = PersoniumCoreException.Dav.COLLECTION_DEPTH_ERROR; // ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } finally { diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/AllTests.java b/src/test/java/io/personium/test/jersey/box/dav/col/AllTests.java similarity index 93% rename from src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/AllTests.java rename to src/test/java/io/personium/test/jersey/box/dav/col/AllTests.java index 57b16ff2a..5642d6c63 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/AllTests.java +++ b/src/test/java/io/personium/test/jersey/box/dav/col/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.dav.col; +package io.personium.test.jersey.box.dav.col; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/MoveCollectionAccessControlTest.java b/src/test/java/io/personium/test/jersey/box/dav/col/MoveCollectionAccessControlTest.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/MoveCollectionAccessControlTest.java rename to src/test/java/io/personium/test/jersey/box/dav/col/MoveCollectionAccessControlTest.java index 421b91209..3d48298fd 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/MoveCollectionAccessControlTest.java +++ b/src/test/java/io/personium/test/jersey/box/dav/col/MoveCollectionAccessControlTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.dav.col; +package io.personium.test.jersey.box.dav.col; import java.util.ArrayList; import java.util.HashMap; @@ -30,32 +30,32 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreAuthzException; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.acl.jaxb.Acl; -import com.fujitsu.dc.test.jersey.cell.auth.AuthTestCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumCoreAuthzException; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.Box; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.acl.jaxb.Acl; +import io.personium.test.jersey.cell.auth.AuthTestCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; /** * ファイルのMOVEに対するアクセス制御のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class MoveCollectionAccessControlTest extends JerseyTest { @@ -82,11 +82,11 @@ public class MoveCollectionAccessControlTest extends JerseyTest { private static final Map INIT_PARAMS = new HashMap(); static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } /** @@ -160,7 +160,7 @@ public void after() { token = "invalid_token"; TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_UNAUTHORIZED); - DcCoreException expectedException = DcCoreAuthzException.TOKEN_PARSE_ERROR; + PersoniumCoreException expectedException = PersoniumCoreAuthzException.TOKEN_PARSE_ERROR; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); AuthTestCommon.waitForAccountLock(); } finally { @@ -190,7 +190,7 @@ public void after() { token = getToken(ACCOUNT_READ); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -301,7 +301,7 @@ public void after() { token = getToken(ACCOUNT_NO_PRIVILEGE); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -331,7 +331,7 @@ public void after() { token = getToken(ACCOUNT_READ); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -442,7 +442,7 @@ public void after() { token = getToken(ACCOUNT_NO_PRIVILEGE); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -506,7 +506,7 @@ public void after() { token = getToken(ACCOUNT_NO_PRIVILEGE); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -573,7 +573,7 @@ public void after() { token = getToken(ACCOUNT_NO_PRIVILEGE); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -634,7 +634,7 @@ public void after() { // 自身にwrite権限があるが、親がread権限→403 token = getToken(ACCOUNT_READ); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -665,7 +665,7 @@ public void after() { // 自身と親にread権限→403 token = getToken(ACCOUNT_READ); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } finally { DavResourceUtils.deleteCollection(CELL_NAME, BOX_NAME, SRC_COL_NAME + "/" + COL_NAME, MASTER_TOKEN, -1); @@ -730,7 +730,7 @@ public void after() { // write権限→201 token = getToken(ACCOUNT_WRITE); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } finally { DavResourceUtils.deleteCollection(CELL_NAME, BOX_NAME, DST_COL_NAME + "/" + COL_NAME, MASTER_TOKEN, -1); @@ -830,7 +830,7 @@ private void setAcl(String collection, String role, String privilege) throws JAX } /** - * 指定されたコレクションに対しPrincipal ALL Privilege ALLを設定. + * 指定されたコレクションに対しPrincipal ROOT Privilege ALLを設定. * @param collection コレクション名 * @throws JAXBException ACLのパースに失敗 */ diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/MoveCollectionHeaderValidateTest.java b/src/test/java/io/personium/test/jersey/box/dav/col/MoveCollectionHeaderValidateTest.java similarity index 85% rename from src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/MoveCollectionHeaderValidateTest.java rename to src/test/java/io/personium/test/jersey/box/dav/col/MoveCollectionHeaderValidateTest.java index 11baa5348..57266d98a 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/MoveCollectionHeaderValidateTest.java +++ b/src/test/java/io/personium/test/jersey/box/dav/col/MoveCollectionHeaderValidateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.dav.col; +package io.personium.test.jersey.box.dav.col; import static org.fest.assertions.Assertions.assertThat; import static org.junit.Assert.assertEquals; @@ -25,18 +25,18 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; /** @@ -47,9 +47,9 @@ *
  • エラー時:エラーコード
  • *
  • エラー時:エラーメッセージ
  • * - * @see com.fujitsu.dc.test.jersey.box.dav.file.MoveFileTest + * @see io.personium.test.jersey.box.dav.file.MoveFileTest */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class MoveCollectionHeaderValidateTest extends JerseyTest { private static final String TOKEN = AbstractCase.MASTER_TOKEN_NAME; @@ -60,7 +60,7 @@ public class MoveCollectionHeaderValidateTest extends JerseyTest { * コンストラクタ. */ public MoveCollectionHeaderValidateTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -75,12 +75,12 @@ public MoveCollectionHeaderValidateTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.REQUIRED_REQUEST_HEADER_NOT_EXIST.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.REQUIRED_REQUEST_HEADER_NOT_EXIST.params( HttpHeaders.DESTINATION); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -101,13 +101,13 @@ public MoveCollectionHeaderValidateTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.REQUIRED_REQUEST_HEADER_NOT_EXIST.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.REQUIRED_REQUEST_HEADER_NOT_EXIST.params( HttpHeaders.DESTINATION, destUrl); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -132,13 +132,13 @@ public MoveCollectionHeaderValidateTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destUrl); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -164,13 +164,13 @@ public MoveCollectionHeaderValidateTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destUrl); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -196,10 +196,10 @@ public MoveCollectionHeaderValidateTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CREATED); // 移動元のコレクションが存在しないこと @@ -226,14 +226,14 @@ public MoveCollectionHeaderValidateTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, ""); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.OVERWRITE, ""); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -261,14 +261,14 @@ public MoveCollectionHeaderValidateTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "Y"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.OVERWRITE, "Y"); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -296,11 +296,11 @@ public MoveCollectionHeaderValidateTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "T"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CREATED); // 移動元のコレクションが存在しないこと @@ -328,14 +328,14 @@ public MoveCollectionHeaderValidateTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.DEPTH, depth); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - DcCoreException expectedException = DcCoreException.Dav.INVALID_DEPTH_HEADER.params(depth); + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_DEPTH_HEADER.params(depth); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 移動元のコレクションが存在すること @@ -363,11 +363,11 @@ public MoveCollectionHeaderValidateTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.DEPTH, depth); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // 移動元のコレクションが存在しないこと @@ -395,11 +395,11 @@ public MoveCollectionHeaderValidateTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.DEPTH, depth); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // 移動元のコレクションが存在しないこと @@ -427,14 +427,14 @@ public MoveCollectionHeaderValidateTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.DEPTH, depth); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - DcCoreException expectedException = DcCoreException.Dav.INVALID_DEPTH_HEADER.params(depth); + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_DEPTH_HEADER.params(depth); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 移動元のコレクションが存在すること @@ -461,12 +461,12 @@ public MoveCollectionHeaderValidateTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "T"); req.header(HttpHeaders.DEPTH, "infinity"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // 移動元のコレクションが存在しないこと @@ -493,16 +493,16 @@ public MoveCollectionHeaderValidateTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.DEPTH, "infinity"); req.header(HttpHeaders.OVERWRITE, "T"); req.header(HttpHeaders.IF_MATCH, ""); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertEquals(HttpStatus.SC_PRECONDITION_FAILED, response.getStatusCode()); - DcCoreException expectedException = DcCoreException.Dav.ETAG_NOT_MATCH; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.ETAG_NOT_MATCH; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 移動元のコレクションが存在すること @@ -529,13 +529,13 @@ public MoveCollectionHeaderValidateTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "T"); req.header(HttpHeaders.DEPTH, "infinity"); req.header(HttpHeaders.IF_MATCH, "*"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // 移動元のコレクションが存在しないこと @@ -564,16 +564,16 @@ public MoveCollectionHeaderValidateTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.DEPTH, "infinity"); req.header(HttpHeaders.OVERWRITE, "T"); req.header(HttpHeaders.IF_MATCH, etag + "dummy"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertEquals(HttpStatus.SC_PRECONDITION_FAILED, response.getStatusCode()); - DcCoreException expectedException = DcCoreException.Dav.ETAG_NOT_MATCH; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.ETAG_NOT_MATCH; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 移動元のコレクションが存在すること @@ -602,13 +602,13 @@ public MoveCollectionHeaderValidateTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.DEPTH, "infinity"); req.header(HttpHeaders.OVERWRITE, "T"); req.header(HttpHeaders.IF_MATCH, etag); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // 移動元のコレクションが存在しないこと diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/MoveCollectionMethodNotAllowedTest.java b/src/test/java/io/personium/test/jersey/box/dav/col/MoveCollectionMethodNotAllowedTest.java similarity index 76% rename from src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/MoveCollectionMethodNotAllowedTest.java rename to src/test/java/io/personium/test/jersey/box/dav/col/MoveCollectionMethodNotAllowedTest.java index f6a2e18b5..fe3ed0225 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/MoveCollectionMethodNotAllowedTest.java +++ b/src/test/java/io/personium/test/jersey/box/dav/col/MoveCollectionMethodNotAllowedTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.dav.col; +package io.personium.test.jersey.box.dav.col; import static org.fest.assertions.Assertions.assertThat; @@ -24,25 +24,25 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.EntityType; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.EntityType; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.DavResourceUtils; import com.sun.jersey.test.framework.JerseyTest; /** * MOVEメソッドに対応していないリソースへのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class MoveCollectionMethodNotAllowedTest extends JerseyTest { private static final String TOKEN = AbstractCase.MASTER_TOKEN_NAME; @@ -53,7 +53,7 @@ public class MoveCollectionMethodNotAllowedTest extends JerseyTest { * コンストラクタ. */ public MoveCollectionMethodNotAllowedTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -65,14 +65,14 @@ public MoveCollectionMethodNotAllowedTest() { final String destUrl = UrlUtils.box(CELL_NAME, BOX_NAME, destColName); // 移動 String srcUrl = UrlUtils.box(CELL_NAME, BOX_NAME, Setup.TEST_ODATA, "$metadata"); - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "F"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_METHOD_NOT_ALLOWED); - DcCoreException expectedException = DcCoreException.Misc.METHOD_NOT_ALLOWED; + PersoniumCoreException expectedException = PersoniumCoreException.Misc.METHOD_NOT_ALLOWED; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } @@ -85,14 +85,14 @@ public MoveCollectionMethodNotAllowedTest() { final String destUrl = UrlUtils.box(CELL_NAME, BOX_NAME, destColName); // 移動 String srcUrl = UrlUtils.box(CELL_NAME, BOX_NAME, Setup.TEST_ODATA, "$metadata/$metadata"); - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "F"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_METHOD_NOT_ALLOWED); - DcCoreException expectedException = DcCoreException.Misc.METHOD_NOT_ALLOWED; + PersoniumCoreException expectedException = PersoniumCoreException.Misc.METHOD_NOT_ALLOWED; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } @@ -105,14 +105,14 @@ public MoveCollectionMethodNotAllowedTest() { final String destUrl = UrlUtils.box(CELL_NAME, BOX_NAME, destColName); // 移動 String srcUrl = UrlUtils.box(CELL_NAME, BOX_NAME, Setup.TEST_ODATA, "$metadata", EntityType.EDM_TYPE_NAME); - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "F"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_METHOD_NOT_ALLOWED); - DcCoreException expectedException = DcCoreException.Misc.METHOD_NOT_ALLOWED; + PersoniumCoreException expectedException = PersoniumCoreException.Misc.METHOD_NOT_ALLOWED; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } @@ -126,14 +126,14 @@ public MoveCollectionMethodNotAllowedTest() { // 移動 String srcUrl = UrlUtils.box(CELL_NAME, BOX_NAME, Setup.TEST_ODATA, "$metadata", EntityType.EDM_TYPE_NAME + "('SalesDetail')"); - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "F"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_METHOD_NOT_ALLOWED); - DcCoreException expectedException = DcCoreException.Misc.METHOD_NOT_ALLOWED; + PersoniumCoreException expectedException = PersoniumCoreException.Misc.METHOD_NOT_ALLOWED; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } @@ -146,14 +146,14 @@ public MoveCollectionMethodNotAllowedTest() { final String destUrl = UrlUtils.box(CELL_NAME, BOX_NAME, destColName); // 移動 String srcUrl = UrlUtils.box(CELL_NAME, BOX_NAME, Setup.TEST_ODATA, "SalesDetail"); - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "F"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_METHOD_NOT_ALLOWED); - DcCoreException expectedException = DcCoreException.Misc.METHOD_NOT_ALLOWED; + PersoniumCoreException expectedException = PersoniumCoreException.Misc.METHOD_NOT_ALLOWED; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } @@ -166,14 +166,14 @@ public MoveCollectionMethodNotAllowedTest() { final String destUrl = UrlUtils.box(CELL_NAME, BOX_NAME, destColName); // 移動 String srcUrl = UrlUtils.box(CELL_NAME, BOX_NAME, Setup.TEST_ODATA, "SalesDetail('userdata001')"); - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "F"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_METHOD_NOT_ALLOWED); - DcCoreException expectedException = DcCoreException.Misc.METHOD_NOT_ALLOWED; + PersoniumCoreException expectedException = PersoniumCoreException.Misc.METHOD_NOT_ALLOWED; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } @@ -186,14 +186,14 @@ public MoveCollectionMethodNotAllowedTest() { final String destUrl = UrlUtils.box(CELL_NAME, BOX_NAME, destColName); // 移動 String srcUrl = UrlUtils.box(CELL_NAME, BOX_NAME, Setup.TEST_ODATA, "$batch"); - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "F"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_METHOD_NOT_ALLOWED); - DcCoreException expectedException = DcCoreException.Misc.METHOD_NOT_ALLOWED; + PersoniumCoreException expectedException = PersoniumCoreException.Misc.METHOD_NOT_ALLOWED; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } @@ -206,14 +206,14 @@ public MoveCollectionMethodNotAllowedTest() { final String destUrl = UrlUtils.box(CELL_NAME, BOX_NAME, destColName); // 移動 String srcUrl = UrlUtils.box(CELL_NAME, BOX_NAME, Setup.TEST_ODATA, "SalesDetail('userdata001')/_Sales"); - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "F"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_METHOD_NOT_ALLOWED); - DcCoreException expectedException = DcCoreException.Misc.METHOD_NOT_ALLOWED; + PersoniumCoreException expectedException = PersoniumCoreException.Misc.METHOD_NOT_ALLOWED; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } @@ -226,14 +226,14 @@ public MoveCollectionMethodNotAllowedTest() { final String destUrl = UrlUtils.box(CELL_NAME, BOX_NAME, destColName); // 移動 String srcUrl = UrlUtils.box(CELL_NAME, BOX_NAME, Setup.TEST_ODATA, "SalesDetail('userdata001')/$links/_Sales"); - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "F"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_METHOD_NOT_ALLOWED); - DcCoreException expectedException = DcCoreException.Misc.METHOD_NOT_ALLOWED; + PersoniumCoreException expectedException = PersoniumCoreException.Misc.METHOD_NOT_ALLOWED; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } @@ -253,14 +253,14 @@ public MoveCollectionMethodNotAllowedTest() { // 移動 // このリソースはサービス実行用であるが、MOVEメソッドは実行対象外としているため405が返却される。 String srcUrl = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol, "dummyResource"); - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "F"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_METHOD_NOT_ALLOWED); - DcCoreException expectedException = DcCoreException.Misc.METHOD_NOT_ALLOWED; + PersoniumCoreException expectedException = PersoniumCoreException.Misc.METHOD_NOT_ALLOWED; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { DavResourceUtils.deleteCollection(CELL_NAME, BOX_NAME, srcCol, TOKEN, -1); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/MoveCollectionTest.java b/src/test/java/io/personium/test/jersey/box/dav/col/MoveCollectionTest.java similarity index 86% rename from src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/MoveCollectionTest.java rename to src/test/java/io/personium/test/jersey/box/dav/col/MoveCollectionTest.java index 045ca84bd..554e828f3 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/MoveCollectionTest.java +++ b/src/test/java/io/personium/test/jersey/box/dav/col/MoveCollectionTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.dav.col; +package io.personium.test.jersey.box.dav.col; import static org.fest.assertions.Assertions.assertThat; @@ -26,28 +26,28 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; /** * MOVEのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class MoveCollectionTest extends JerseyTest { private static final String TOKEN = AbstractCase.MASTER_TOKEN_NAME; @@ -60,7 +60,7 @@ public class MoveCollectionTest extends JerseyTest { * コンストラクタ. */ public MoveCollectionTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -80,11 +80,11 @@ public MoveCollectionTest() { // 移動 String srcUrl = UrlUtils.box(CELL_NAME, BOX_NAME, srcColName); - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "F"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CREATED); // 存在確認 @@ -111,7 +111,7 @@ public MoveCollectionTest() { HttpStatus.SC_CREATED); // 元の場所に移動 - req = DcRequest.move(destUrl); + req = PersoniumRequest.move(destUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, srcUrl); req.header(HttpHeaders.OVERWRITE, "F"); @@ -150,11 +150,11 @@ public MoveCollectionTest() { // 移動 String srcUrl = UrlUtils.box(CELL_NAME, BOX_NAME, srcColName); - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "F"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CREATED); // 存在確認 @@ -192,13 +192,13 @@ public MoveCollectionTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Dav.DESTINATION_EQUALS_SOURCE_URL.params(destUrl); + PersoniumCoreException expectedException = PersoniumCoreException.Dav.DESTINATION_EQUALS_SOURCE_URL.params(destUrl); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -214,20 +214,20 @@ public MoveCollectionTest() { final String srcCol = "srcCol"; final String destCol = "destCol"; final String destUrl = String.format("%s://%s/%s/%s/%s", - DcCoreConfig.getUnitScheme(), "fqdn", CELL_NAME, BOX_NAME, destCol); + PersoniumUnitConfig.getUnitScheme(), "fqdn", CELL_NAME, BOX_NAME, destCol); try { // 事前準備 DavResourceUtils.createWebDavCollection(TOKEN, HttpStatus.SC_CREATED, CELL_NAME, BOX_NAME, srcCol); // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destUrl); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -249,13 +249,13 @@ public MoveCollectionTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destUrl); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -276,13 +276,13 @@ public MoveCollectionTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destUrl); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -307,7 +307,7 @@ public MoveCollectionTest() { // Fileの移動 TResponse response = DavResourceUtils.moveWebDav(TOKEN, CELL_NAME, BOX_NAME + "/" + srcColName, destUrl, HttpStatus.SC_CONFLICT); - DcCoreException expectedException = DcCoreException.Dav.HAS_NOT_PARENT.params(notExistColName); + PersoniumCoreException expectedException = PersoniumCoreException.Dav.HAS_NOT_PARENT.params(notExistColName); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { DavResourceUtils.deleteCollection(CELL_NAME, BOX_NAME, srcColName, TOKEN, -1); @@ -332,7 +332,7 @@ public MoveCollectionTest() { // 移動 TResponse response = DavResourceUtils.moveWebDav(TOKEN, CELL_NAME, BOX_NAME + "/" + srcColName, destUrl, HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.RESOURCE_PROHIBITED_TO_MOVE_SERVICE_COLLECTION; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.RESOURCE_PROHIBITED_TO_MOVE_SERVICE_COLLECTION; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -359,8 +359,8 @@ public MoveCollectionTest() { // 移動 TResponse response = DavResourceUtils.moveWebDav(TOKEN, CELL_NAME, BOX_NAME + "/" + srcColName, destUrl, HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = - DcCoreException.Dav.SERVICE_SOURCE_COLLECTION_PROHIBITED_TO_CONTAIN_COLLECTION; + PersoniumCoreException expectedException = + PersoniumCoreException.Dav.SERVICE_SOURCE_COLLECTION_PROHIBITED_TO_CONTAIN_COLLECTION; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -383,7 +383,7 @@ public MoveCollectionTest() { // 移動 TResponse response = DavResourceUtils.moveWebDav(TOKEN, CELL_NAME, BOX_NAME + "/" + srcColName, destUrl, HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destUrl); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -406,14 +406,14 @@ public MoveCollectionTest() { DavResourceUtils.createWebDavCollection(TOKEN, HttpStatus.SC_CREATED, CELL_NAME, BOX_NAME, destColName); // 移動 - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "F"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_PRECONDITION_FAILED); - DcCoreException expectedException = DcCoreException.Dav.DESTINATION_ALREADY_EXISTS; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.DESTINATION_ALREADY_EXISTS; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 存在確認 @@ -442,14 +442,14 @@ public MoveCollectionTest() { DavResourceUtils.createWebDavCollection(TOKEN, HttpStatus.SC_CREATED, CELL_NAME, BOX_NAME, destColName); // 移動 - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "T"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 存在確認 @@ -478,14 +478,14 @@ public MoveCollectionTest() { DavResourceUtils.createODataCollection(TOKEN, HttpStatus.SC_CREATED, CELL_NAME, BOX_NAME, destColName); // 移動 - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "T"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 存在確認 @@ -515,14 +515,14 @@ public MoveCollectionTest() { CELL_NAME, BOX_NAME, destColName); // 移動 - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "T"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 存在確認 @@ -551,14 +551,14 @@ public MoveCollectionTest() { CELL_NAME, BOX_NAME, destColName); // 移動 - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "T"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.SERVICE_SOURCE_COLLECTION_PROHIBITED_TO_OVERWRITE; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.SERVICE_SOURCE_COLLECTION_PROHIBITED_TO_OVERWRITE; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -586,15 +586,15 @@ public MoveCollectionTest() { HttpStatus.SC_CREATED); // 移動 - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "T"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = - DcCoreException.Dav.SERVICE_SOURCE_COLLECTION_PROHIBITED_TO_CONTAIN_COLLECTION; + PersoniumCoreException expectedException = + PersoniumCoreException.Dav.SERVICE_SOURCE_COLLECTION_PROHIBITED_TO_CONTAIN_COLLECTION; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -620,14 +620,14 @@ public MoveCollectionTest() { MediaType.TEXT_PLAIN, HttpStatus.SC_CREATED); // 移動 - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "F"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_PRECONDITION_FAILED); - DcCoreException expectedException = DcCoreException.Dav.DESTINATION_ALREADY_EXISTS; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.DESTINATION_ALREADY_EXISTS; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 存在確認 @@ -656,11 +656,11 @@ public MoveCollectionTest() { MediaType.TEXT_PLAIN, HttpStatus.SC_CREATED); // 移動 - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "T"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_NO_CONTENT); @@ -691,13 +691,13 @@ public MoveCollectionTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.RESOURCE_PROHIBITED_TO_MOVE_FILE; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.RESOURCE_PROHIBITED_TO_MOVE_FILE; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 移動元のコレクションが存在すること @@ -723,13 +723,13 @@ public MoveCollectionTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.RESOURCE_PROHIBITED_TO_MOVE_ODATA_COLLECTION; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.RESOURCE_PROHIBITED_TO_MOVE_ODATA_COLLECTION; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 移動元のコレクションが存在すること @@ -753,13 +753,13 @@ public MoveCollectionTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destUrl); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -787,13 +787,13 @@ public MoveCollectionTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destUrl); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -822,10 +822,10 @@ public MoveCollectionTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CREATED); @@ -867,10 +867,10 @@ public MoveCollectionTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CREATED); @@ -910,11 +910,11 @@ public MoveCollectionTest() { // 移動 String srcUrl = UrlUtils.box(CELL_NAME, BOX_NAME, srcColName); - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "F"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CREATED); // 存在確認 @@ -954,13 +954,13 @@ public MoveCollectionTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Dav.DESTINATION_EQUALS_SOURCE_URL.params(destUrl); + PersoniumCoreException expectedException = PersoniumCoreException.Dav.DESTINATION_EQUALS_SOURCE_URL.params(destUrl); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -976,20 +976,20 @@ public MoveCollectionTest() { final String srcCol = "srcCol"; final String destCol = "destCol"; final String destUrl = String.format("%s://%s/%s/%s/%s", - DcCoreConfig.getUnitScheme(), "fqdn", CELL_NAME, BOX_NAME, destCol); + PersoniumUnitConfig.getUnitScheme(), "fqdn", CELL_NAME, BOX_NAME, destCol); try { // 事前準備 DavResourceUtils.createODataCollection(TOKEN, HttpStatus.SC_CREATED, CELL_NAME, BOX_NAME, srcCol); // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destUrl); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -1011,13 +1011,13 @@ public MoveCollectionTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destUrl); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -1038,13 +1038,13 @@ public MoveCollectionTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destUrl); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -1069,7 +1069,7 @@ public MoveCollectionTest() { // Fileの移動 TResponse response = DavResourceUtils.moveWebDav(TOKEN, CELL_NAME, BOX_NAME + "/" + srcColName, destUrl, HttpStatus.SC_CONFLICT); - DcCoreException expectedException = DcCoreException.Dav.HAS_NOT_PARENT.params(notExistColName); + PersoniumCoreException expectedException = PersoniumCoreException.Dav.HAS_NOT_PARENT.params(notExistColName); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { DavResourceUtils.deleteCollection(CELL_NAME, BOX_NAME, srcColName, TOKEN, -1); @@ -1090,7 +1090,7 @@ public MoveCollectionTest() { // 移動 TResponse response = DavResourceUtils.moveWebDav(TOKEN, CELL_NAME, BOX_NAME + "/" + srcColName, destUrl, HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destUrl); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -1113,14 +1113,14 @@ public MoveCollectionTest() { DavResourceUtils.createWebDavCollection(TOKEN, HttpStatus.SC_CREATED, CELL_NAME, BOX_NAME, destColName); // 移動 - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "F"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_PRECONDITION_FAILED); - DcCoreException expectedException = DcCoreException.Dav.DESTINATION_ALREADY_EXISTS; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.DESTINATION_ALREADY_EXISTS; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 存在確認 @@ -1149,14 +1149,14 @@ public MoveCollectionTest() { DavResourceUtils.createWebDavCollection(TOKEN, HttpStatus.SC_CREATED, CELL_NAME, BOX_NAME, destColName); // 移動 - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "T"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 存在確認 @@ -1185,14 +1185,14 @@ public MoveCollectionTest() { DavResourceUtils.createODataCollection(TOKEN, HttpStatus.SC_CREATED, CELL_NAME, BOX_NAME, destColName); // 移動 - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "T"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 存在確認 @@ -1222,14 +1222,14 @@ public MoveCollectionTest() { CELL_NAME, BOX_NAME, destColName); // 移動 - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "T"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 存在確認 @@ -1258,14 +1258,14 @@ public MoveCollectionTest() { CELL_NAME, BOX_NAME, destColName); // 移動 - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "T"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.SERVICE_SOURCE_COLLECTION_PROHIBITED_TO_OVERWRITE; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.SERVICE_SOURCE_COLLECTION_PROHIBITED_TO_OVERWRITE; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -1293,15 +1293,15 @@ public MoveCollectionTest() { HttpStatus.SC_CREATED); // 移動 - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "T"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); // TODO Serviceコレクション配下への移動の制限追加時にエラーコードのチェックをする - // DcCoreException expectedException = DcCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; + // PersoniumCoreException expectedException = PersoniumCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; // ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), // expectedException.getMessage()); } finally { @@ -1327,14 +1327,14 @@ public MoveCollectionTest() { MediaType.TEXT_PLAIN, HttpStatus.SC_CREATED); // 移動 - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "F"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_PRECONDITION_FAILED); - DcCoreException expectedException = DcCoreException.Dav.DESTINATION_ALREADY_EXISTS; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.DESTINATION_ALREADY_EXISTS; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 存在確認 @@ -1364,11 +1364,11 @@ public MoveCollectionTest() { MediaType.TEXT_PLAIN, HttpStatus.SC_CREATED); // 移動 - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "T"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_NO_CONTENT); @@ -1417,11 +1417,11 @@ public MoveCollectionTest() { // 移動 String srcUrl = UrlUtils.box(CELL_NAME, BOX_NAME, srcColName); - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "T"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CREATED); // 存在確認 @@ -1464,13 +1464,13 @@ public MoveCollectionTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Dav.DESTINATION_EQUALS_SOURCE_URL.params(destUrl); + PersoniumCoreException expectedException = PersoniumCoreException.Dav.DESTINATION_EQUALS_SOURCE_URL.params(destUrl); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -1486,7 +1486,7 @@ public MoveCollectionTest() { final String srcCol = "srcCol"; final String destCol = "destCol"; final String destUrl = String.format("%s://%s/%s/%s/%s", - DcCoreConfig.getUnitScheme(), "fqdn", CELL_NAME, BOX_NAME, destCol); + PersoniumUnitConfig.getUnitScheme(), "fqdn", CELL_NAME, BOX_NAME, destCol); try { // 事前準備 DavResourceUtils.createServiceCollection(AbstractCase.BEARER_MASTER_TOKEN, HttpStatus.SC_CREATED, @@ -1494,13 +1494,13 @@ public MoveCollectionTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destUrl); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -1523,13 +1523,13 @@ public MoveCollectionTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destUrl); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -1551,13 +1551,13 @@ public MoveCollectionTest() { // 移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcCol); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destUrl); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -1583,7 +1583,7 @@ public MoveCollectionTest() { // コレクションの移動 TResponse response = DavResourceUtils.moveWebDav(TOKEN, CELL_NAME, BOX_NAME + "/" + srcColName, destUrl, HttpStatus.SC_CONFLICT); - DcCoreException expectedException = DcCoreException.Dav.HAS_NOT_PARENT.params(notExistColName); + PersoniumCoreException expectedException = PersoniumCoreException.Dav.HAS_NOT_PARENT.params(notExistColName); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { DavResourceUtils.deleteCollection(CELL_NAME, BOX_NAME, srcColName, TOKEN, -1); @@ -1605,7 +1605,7 @@ public MoveCollectionTest() { // 移動 TResponse response = DavResourceUtils.moveWebDav(TOKEN, CELL_NAME, BOX_NAME + "/" + srcColName, destUrl, HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destUrl); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -1629,14 +1629,14 @@ public MoveCollectionTest() { DavResourceUtils.createWebDavCollection(TOKEN, HttpStatus.SC_CREATED, CELL_NAME, BOX_NAME, destColName); // 移動 - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "F"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_PRECONDITION_FAILED); - DcCoreException expectedException = DcCoreException.Dav.DESTINATION_ALREADY_EXISTS; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.DESTINATION_ALREADY_EXISTS; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 存在確認 @@ -1666,14 +1666,14 @@ public MoveCollectionTest() { DavResourceUtils.createWebDavCollection(TOKEN, HttpStatus.SC_CREATED, CELL_NAME, BOX_NAME, destColName); // 移動 - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "T"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 存在確認 @@ -1703,14 +1703,14 @@ public MoveCollectionTest() { DavResourceUtils.createODataCollection(TOKEN, HttpStatus.SC_CREATED, CELL_NAME, BOX_NAME, destColName); // 移動 - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "T"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 存在確認 @@ -1741,14 +1741,14 @@ public MoveCollectionTest() { CELL_NAME, BOX_NAME, destColName); // 移動 - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "T"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 存在確認 @@ -1778,14 +1778,14 @@ public MoveCollectionTest() { CELL_NAME, BOX_NAME, destColName); // 移動 - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "T"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.SERVICE_SOURCE_COLLECTION_PROHIBITED_TO_OVERWRITE; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.SERVICE_SOURCE_COLLECTION_PROHIBITED_TO_OVERWRITE; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -1814,15 +1814,15 @@ public MoveCollectionTest() { HttpStatus.SC_CREATED); // 移動 - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "T"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); // TODO Serviceコレクション配下への移動の制限追加時にエラーコードのチェックをする - // DcCoreException expectedException = DcCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; + // PersoniumCoreException expectedException = PersoniumCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; // ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), // expectedException.getMessage()); } finally { @@ -1849,14 +1849,14 @@ public MoveCollectionTest() { MediaType.TEXT_PLAIN, HttpStatus.SC_CREATED); // 移動 - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "F"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_PRECONDITION_FAILED); - DcCoreException expectedException = DcCoreException.Dav.DESTINATION_ALREADY_EXISTS; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.DESTINATION_ALREADY_EXISTS; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 存在確認 @@ -1886,11 +1886,11 @@ public MoveCollectionTest() { MediaType.TEXT_PLAIN, HttpStatus.SC_CREATED); // 移動 - DcRequest req = DcRequest.move(srcUrl); + PersoniumRequest req = PersoniumRequest.move(srcUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destUrl); req.header(HttpHeaders.OVERWRITE, "T"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_NO_CONTENT); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/MoveODataCollectionAclTest.java b/src/test/java/io/personium/test/jersey/box/dav/col/MoveODataCollectionAclTest.java similarity index 90% rename from src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/MoveODataCollectionAclTest.java rename to src/test/java/io/personium/test/jersey/box/dav/col/MoveODataCollectionAclTest.java index 9b943a274..3f159b45a 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/MoveODataCollectionAclTest.java +++ b/src/test/java/io/personium/test/jersey/box/dav/col/MoveODataCollectionAclTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.dav.col; +package io.personium.test.jersey.box.dav.col; import java.util.ArrayList; import java.util.HashMap; @@ -30,32 +30,32 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreAuthzException; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.acl.jaxb.Acl; -import com.fujitsu.dc.test.jersey.cell.auth.AuthTestCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumCoreAuthzException; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.Box; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.acl.jaxb.Acl; +import io.personium.test.jersey.cell.auth.AuthTestCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; /** * ODataコレクションリソースに対するのMOVEメソッドのアクセス制御テストを実装したクラス. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class MoveODataCollectionAclTest extends JerseyTest { @@ -82,11 +82,11 @@ public class MoveODataCollectionAclTest extends JerseyTest { private static final Map INIT_PARAMS = new HashMap(); static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } /** @@ -157,7 +157,7 @@ public void after() { token = "invalid_token"; TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_UNAUTHORIZED); - DcCoreException expectedException = DcCoreAuthzException.TOKEN_PARSE_ERROR; + PersoniumCoreException expectedException = PersoniumCoreAuthzException.TOKEN_PARSE_ERROR; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); AuthTestCommon.waitForAccountLock(); } @@ -182,7 +182,7 @@ public void after() { // read権限→403 token = getToken(ACCOUNT_READ); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -277,7 +277,7 @@ public void after() { token = getToken(ACCOUNT_NO_PRIVILEGE); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -332,7 +332,7 @@ public void after() { token = getToken(ACCOUNT_NO_PRIVILEGE); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -384,7 +384,7 @@ public void after() { // 自身にwrite権限があるが、親がread権限→403 token = getToken(ACCOUNT_READ); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -411,7 +411,7 @@ public void after() { // 自身と親にread権限→403 token = getToken(ACCOUNT_READ); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -437,7 +437,7 @@ public void after() { // 親にwrite権限+移動先の親にread権限→403 token = getToken(ACCOUNT_WRITE); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -487,7 +487,7 @@ public void after() { // 親にread権限+移動先の親にread権限→403 token = getToken(ACCOUNT_READ); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -513,7 +513,7 @@ public void after() { // 親にread権限+移動先の親にwrite権限→403 token = getToken(ACCOUNT_READ); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -610,7 +610,7 @@ private void setAcl(String collection, String role, String privilege) throws JAX } /** - * 指定されたコレクションに対しPrincipal ALL Privilege ALLを設定. + * 指定されたコレクションに対しPrincipal ROOT Privilege ALLを設定. * @param collection コレクション名 * @throws JAXBException ACLのパースに失敗 */ diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/MoveServiceCollectionAclTest.java b/src/test/java/io/personium/test/jersey/box/dav/col/MoveServiceCollectionAclTest.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/MoveServiceCollectionAclTest.java rename to src/test/java/io/personium/test/jersey/box/dav/col/MoveServiceCollectionAclTest.java index 487dec1f7..d71396a90 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/MoveServiceCollectionAclTest.java +++ b/src/test/java/io/personium/test/jersey/box/dav/col/MoveServiceCollectionAclTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.dav.col; +package io.personium.test.jersey.box.dav.col; import java.util.ArrayList; import java.util.HashMap; @@ -30,32 +30,32 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreAuthzException; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.acl.jaxb.Acl; -import com.fujitsu.dc.test.jersey.cell.auth.AuthTestCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumCoreAuthzException; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.Box; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.acl.jaxb.Acl; +import io.personium.test.jersey.cell.auth.AuthTestCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; /** * Serviceコレクションリソースに対するのMOVEメソッドのアクセス制御テストを実装したクラス. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class MoveServiceCollectionAclTest extends JerseyTest { @@ -83,11 +83,11 @@ public class MoveServiceCollectionAclTest extends JerseyTest { private static final Map INIT_PARAMS = new HashMap(); static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } /** @@ -158,7 +158,7 @@ public void after() { token = "invalid_token"; TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_UNAUTHORIZED); - DcCoreException expectedException = DcCoreAuthzException.TOKEN_PARSE_ERROR; + PersoniumCoreException expectedException = PersoniumCoreAuthzException.TOKEN_PARSE_ERROR; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); AuthTestCommon.waitForAccountLock(); } @@ -183,7 +183,7 @@ public void after() { // read権限→403 token = getToken(ACCOUNT_READ); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -278,7 +278,7 @@ public void after() { token = getToken(ACCOUNT_NO_PRIVILEGE); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -333,7 +333,7 @@ public void after() { token = getToken(ACCOUNT_NO_PRIVILEGE); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -385,7 +385,7 @@ public void after() { // 自身にwrite権限があるが、親がread権限→403 token = getToken(ACCOUNT_READ); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -412,7 +412,7 @@ public void after() { // 自身と親にread権限→403 token = getToken(ACCOUNT_READ); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -438,7 +438,7 @@ public void after() { // 親にwrite権限+移動先の親にread権限→403 token = getToken(ACCOUNT_WRITE); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -488,7 +488,7 @@ public void after() { // 親にread権限+移動先の親にread権限→403 token = getToken(ACCOUNT_READ); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -514,7 +514,7 @@ public void after() { // 親にread権限+移動先の親にwrite権限→403 token = getToken(ACCOUNT_READ); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -611,7 +611,7 @@ private void setAcl(String collection, String role, String privilege) throws JAX } /** - * 指定されたコレクションに対しPrincipal ALL Privilege ALLを設定. + * 指定されたコレクションに対しPrincipal ROOT Privilege ALLを設定. * @param collection コレクション名 * @throws JAXBException ACLのパースに失敗 */ diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/ODataCollectionAccessControlTest.java b/src/test/java/io/personium/test/jersey/box/dav/col/ODataCollectionAccessControlTest.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/ODataCollectionAccessControlTest.java rename to src/test/java/io/personium/test/jersey/box/dav/col/ODataCollectionAccessControlTest.java index 6002dd2d5..70d7a56ca 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/ODataCollectionAccessControlTest.java +++ b/src/test/java/io/personium/test/jersey/box/dav/col/ODataCollectionAccessControlTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.dav.col; +package io.personium.test.jersey.box.dav.col; import java.util.HashMap; import java.util.Map; @@ -28,23 +28,23 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.acl.jaxb.Acl; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.Box; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.acl.jaxb.Acl; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; @@ -52,7 +52,7 @@ * ODataコレクションに対する親子関係のアクセス制御のテスト.
    * MOVEメソッドはMoveODataCollectionAclTestクラスでテストしているため、本クラスではテストを省略している。 */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class ODataCollectionAccessControlTest extends JerseyTest { @@ -70,11 +70,11 @@ public class ODataCollectionAccessControlTest extends JerseyTest { private static final Map INIT_PARAMS = new HashMap(); static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } /** @@ -116,7 +116,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.deleteCollection(CELL_NAME, BOX_NAME, path, token, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -138,7 +138,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.deleteCollection(CELL_NAME, BOX_NAME, path, token, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -196,7 +196,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.createODataCollection(token, HttpStatus.SC_FORBIDDEN, CELL_NAME, BOX_NAME, path); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -233,7 +233,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.propfind(token, CELL_NAME, path, "1", HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -280,7 +280,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.propfind(token, CELL_NAME, pathForPropfind, "1", HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -425,7 +425,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.propfind(token, CELL_NAME, path, "1", HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -474,7 +474,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.propfind(token, CELL_NAME, pathForPropfind, "1", HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -517,7 +517,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.setProppatch(token, HttpStatus.SC_FORBIDDEN, CELL_NAME, BOX_NAME, path); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -596,7 +596,7 @@ public void after() { // リクエスト実行 TResponse res = setAcl(token, HttpStatus.SC_FORBIDDEN, path, ROLE, "write"); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/ServiceCollectionAccessControlTest.java b/src/test/java/io/personium/test/jersey/box/dav/col/ServiceCollectionAccessControlTest.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/ServiceCollectionAccessControlTest.java rename to src/test/java/io/personium/test/jersey/box/dav/col/ServiceCollectionAccessControlTest.java index 380335fe6..ef9340a85 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/ServiceCollectionAccessControlTest.java +++ b/src/test/java/io/personium/test/jersey/box/dav/col/ServiceCollectionAccessControlTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.dav.col; +package io.personium.test.jersey.box.dav.col; import java.util.HashMap; import java.util.Map; @@ -28,23 +28,23 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.acl.jaxb.Acl; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.Box; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.acl.jaxb.Acl; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; @@ -52,7 +52,7 @@ * Serviceコレクションに対する親子関係のアクセス制御のテスト.
    * MOVEメソッドはMoveServiceCollectionAclTestクラスでテストしているため、本クラスではテストを省略している。 */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class ServiceCollectionAccessControlTest extends JerseyTest { @@ -70,11 +70,11 @@ public class ServiceCollectionAccessControlTest extends JerseyTest { private static final Map INIT_PARAMS = new HashMap(); static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } /** @@ -116,7 +116,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.deleteCollection(CELL_NAME, BOX_NAME, path, token, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -138,7 +138,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.deleteCollection(CELL_NAME, BOX_NAME, path, token, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -196,7 +196,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.createODataCollection(token, HttpStatus.SC_FORBIDDEN, CELL_NAME, BOX_NAME, path); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -233,7 +233,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.propfind(token, CELL_NAME, path, "1", HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -280,7 +280,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.propfind(token, CELL_NAME, pathForPropfind, "1", HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -425,7 +425,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.propfind(token, CELL_NAME, path, "1", HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -474,7 +474,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.propfind(token, CELL_NAME, pathForPropfind, "1", HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -517,7 +517,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.setProppatch(token, HttpStatus.SC_FORBIDDEN, CELL_NAME, BOX_NAME, path); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -596,7 +596,7 @@ public void after() { // リクエスト実行 TResponse res = setAcl(token, HttpStatus.SC_FORBIDDEN, path, ROLE, "write"); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -672,7 +672,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.propfind(token, CELL_NAME, path, "1", HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -719,7 +719,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.propfind(token, CELL_NAME, path, "1", HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/WebDAVCollectionAccessControlTest.java b/src/test/java/io/personium/test/jersey/box/dav/col/WebDAVCollectionAccessControlTest.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/WebDAVCollectionAccessControlTest.java rename to src/test/java/io/personium/test/jersey/box/dav/col/WebDAVCollectionAccessControlTest.java index 2938c2216..497602f45 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/WebDAVCollectionAccessControlTest.java +++ b/src/test/java/io/personium/test/jersey/box/dav/col/WebDAVCollectionAccessControlTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.dav.col; +package io.personium.test.jersey.box.dav.col; import java.util.HashMap; import java.util.Map; @@ -28,23 +28,23 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.acl.jaxb.Acl; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.Box; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.acl.jaxb.Acl; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; @@ -52,7 +52,7 @@ * コレクションに対する親子関係のアクセス制御のテスト.
    * MOVEメソッドはMoveCollectionAccessControlTestクラスでテストしているため、本クラスではテストを省略している。 */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class WebDAVCollectionAccessControlTest extends JerseyTest { @@ -70,11 +70,11 @@ public class WebDAVCollectionAccessControlTest extends JerseyTest { private static final Map INIT_PARAMS = new HashMap(); static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } /** @@ -111,7 +111,7 @@ public void after() { HttpStatus.SC_NOT_FOUND, "noneExistBox", "noneExistCollection", "box/acl-setting.txt", "role", "noneExistBox", "", ""); String boxUrl = UrlUtils.boxRoot(CELL_NAME, "noneExistBox"); - DcCoreException expectedException = DcCoreException.Dav.BOX_NOT_FOUND.params(boxUrl); + PersoniumCoreException expectedException = PersoniumCoreException.Dav.BOX_NOT_FOUND.params(boxUrl); ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -130,7 +130,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.deleteCollection(CELL_NAME, BOX_NAME, path, token, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -152,7 +152,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.deleteCollection(CELL_NAME, BOX_NAME, path, token, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -210,7 +210,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.createWebDavCollection(token, HttpStatus.SC_FORBIDDEN, CELL_NAME, BOX_NAME, path); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -247,7 +247,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.propfind(token, CELL_NAME, path, "1", HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -294,7 +294,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.propfind(token, CELL_NAME, pathForPropfind, "1", HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -439,7 +439,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.propfind(token, CELL_NAME, path, "1", HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -488,7 +488,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.propfind(token, CELL_NAME, pathForPropfind, "1", HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -531,7 +531,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.setProppatch(token, HttpStatus.SC_FORBIDDEN, CELL_NAME, BOX_NAME, path); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -610,7 +610,7 @@ public void after() { // リクエスト実行 TResponse res = setAcl(token, HttpStatus.SC_FORBIDDEN, path, ROLE, "write"); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/package-info.java b/src/test/java/io/personium/test/jersey/box/dav/col/package-info.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/package-info.java rename to src/test/java/io/personium/test/jersey/box/dav/col/package-info.java index 1a5e91813..36e38bd26 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/col/package-info.java +++ b/src/test/java/io/personium/test/jersey/box/dav/col/package-info.java @@ -17,5 +17,5 @@ @javax.xml.bind.annotation.XmlSchema( elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) -package com.fujitsu.dc.test.jersey.box.dav.col; +package io.personium.test.jersey.box.dav.col; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/AllTests.java b/src/test/java/io/personium/test/jersey/box/dav/file/AllTests.java similarity index 93% rename from src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/AllTests.java rename to src/test/java/io/personium/test/jersey/box/dav/file/AllTests.java index 0c7debf5e..27a669bfa 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/AllTests.java +++ b/src/test/java/io/personium/test/jersey/box/dav/file/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.dav.file; +package io.personium.test.jersey.box.dav.file; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/DavFileTest.java b/src/test/java/io/personium/test/jersey/box/dav/file/DavFileTest.java similarity index 96% rename from src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/DavFileTest.java rename to src/test/java/io/personium/test/jersey/box/dav/file/DavFileTest.java index f2e5061af..9c788c523 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/DavFileTest.java +++ b/src/test/java/io/personium/test/jersey/box/dav/file/DavFileTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.dav.file; +package io.personium.test.jersey.box.dav.file; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -30,23 +30,23 @@ import org.w3c.dom.Element; import org.w3c.dom.NodeList; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreConfig.BinaryData; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumUnitConfig.BinaryData; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.setup.Setup; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; /** * DAV File related tests. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class DavFileTest extends JerseyTest { private static final String CELL_NAME = "testcell1"; @@ -59,7 +59,7 @@ public class DavFileTest extends JerseyTest { * constructor. */ public DavFileTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -305,13 +305,13 @@ public final void returns_200_on_GET_with_invalid_value_in_IfNoneMatch_header() .statusCode(HttpStatus.SC_OK); int cl1 = Integer.parseInt(getRes.getHeader(HttpHeaders.CONTENT_LENGTH)); assertEquals(FILE_BODY.length(), cl1); - // PUT + // PUT TResponse resp2 = this.putFileRequest(FILE_NAME, FILE_BODY2, null, Setup.TEST_BOX1) .returns() .statusCode(HttpStatus.SC_NO_CONTENT); String etag2 = resp2.getHeader(HttpHeaders.ETAG); assertNotNull(etag2); - // GET + // GET getRes = this.getFileRequest(FILE_NAME, TEST_BOX1, null) .returns() .statusCode(HttpStatus.SC_OK); @@ -323,7 +323,6 @@ public final void returns_200_on_GET_with_invalid_value_in_IfNoneMatch_header() } } - /** * FileをETAGつきPUTで更新してDELETEする. */ @@ -386,8 +385,8 @@ public final void returns_200_on_GET_with_invalid_value_in_IfNoneMatch_header() @Test public final void FileをfsyncでPUTする() { // fsyncを有効にする - boolean fsyncEnabled = DcCoreConfig.getFsyncEnabled(); - DcCoreConfig.set(BinaryData.FSYNC_ENABLED, "true"); + boolean fsyncEnabled = PersoniumUnitConfig.getFsyncEnabled(); + PersoniumUnitConfig.set(BinaryData.FSYNC_ENABLED, "true"); try { final Http theReq = this.putFileRequest(FILE_NAME, FILE_BODY, null, Setup.TEST_BOX1); TResponse resp = theReq.returns() @@ -430,7 +429,7 @@ public final void returns_200_on_GET_with_invalid_value_in_IfNoneMatch_header() } finally { this.deleteFileRequest(FILE_NAME, null, Setup.TEST_BOX1).returns() .statusCode(HttpStatus.SC_NO_CONTENT); - DcCoreConfig.set(BinaryData.FSYNC_ENABLED, String.valueOf(fsyncEnabled)); + PersoniumUnitConfig.set(BinaryData.FSYNC_ENABLED, String.valueOf(fsyncEnabled)); } } @@ -456,7 +455,7 @@ public final void returns_200_on_GET_with_invalid_value_in_IfNoneMatch_header() getResp.statusCode(HttpStatus.SC_PARTIAL_CONTENT); assertEquals(String.format("bytes %s-%s/%s", first, last, body.length()), - getResp.getHeader(DcCoreUtils.HttpHeaders.CONTENT_RANGE)); + getResp.getHeader(PersoniumCoreUtils.HttpHeaders.CONTENT_RANGE)); assertEquals(body.substring(first, last + 1), getResp.getBody()); } finally { diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/FileAccessControlTest.java b/src/test/java/io/personium/test/jersey/box/dav/file/FileAccessControlTest.java similarity index 93% rename from src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/FileAccessControlTest.java rename to src/test/java/io/personium/test/jersey/box/dav/file/FileAccessControlTest.java index a9fb72159..8e398a8af 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/FileAccessControlTest.java +++ b/src/test/java/io/personium/test/jersey/box/dav/file/FileAccessControlTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.dav.file; +package io.personium.test.jersey.box.dav.file; import static org.fest.assertions.Assertions.assertThat; @@ -31,30 +31,30 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.acl.jaxb.Acl; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.Box; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.acl.jaxb.Acl; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; /** * ファイルに対する親子関係のアクセス制御のテスト.
    */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class FileAccessControlTest extends JerseyTest { @@ -71,11 +71,11 @@ public class FileAccessControlTest extends JerseyTest { private static final Map INIT_PARAMS = new HashMap(); static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } /** @@ -117,7 +117,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.deleteWebDavFile(CELL_NAME, token, BOX_NAME, path); assertThat(res.getStatusCode()).isEqualTo(HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -139,7 +139,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.deleteWebDavFile(CELL_NAME, token, BOX_NAME, path); assertThat(res.getStatusCode()).isEqualTo(HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -199,7 +199,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.createWebDavFile(token, CELL_NAME, BOX_NAME + "/" + path, "testFileBody", MediaType.TEXT_PLAIN, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -238,7 +238,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.createWebDavFile(token, CELL_NAME, BOX_NAME + "/" + path, "testFileBody", MediaType.TEXT_PLAIN, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -317,7 +317,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.getWebDav(CELL_NAME, token, BOX_NAME, path, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -401,7 +401,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, BOX_NAME + "/" + path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -430,7 +430,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, BOX_NAME + "/" + path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -513,7 +513,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, BOX_NAME + "/" + path, destination, "*", "T", "infinity", HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -545,7 +545,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, BOX_NAME + "/" + path, destination, "*", "T", "infinity", HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -637,7 +637,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, BOX_NAME + "/" + path, destination, "*", "T", "infinity", HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -671,7 +671,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, BOX_NAME + "/" + path, destination, "*", "T", "infinity", HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -764,7 +764,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, BOX_NAME + "/" + path, destination, "*", "T", "infinity", HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -811,7 +811,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.propfind(token, CELL_NAME, path, "1", HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -858,7 +858,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.propfind(token, CELL_NAME, pathForPropfind, "1", HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -1003,7 +1003,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.propfind(token, CELL_NAME, path, "1", HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -1052,7 +1052,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.propfind(token, CELL_NAME, pathForPropfind, "1", HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -1095,7 +1095,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.setProppatch(token, HttpStatus.SC_FORBIDDEN, CELL_NAME, BOX_NAME, path); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -1174,7 +1174,7 @@ public void after() { // リクエスト実行 TResponse res = setAcl(token, HttpStatus.SC_FORBIDDEN, path, ROLE, "write"); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/MoveFileAccessControlTest.java b/src/test/java/io/personium/test/jersey/box/dav/file/MoveFileAccessControlTest.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/MoveFileAccessControlTest.java rename to src/test/java/io/personium/test/jersey/box/dav/file/MoveFileAccessControlTest.java index 29ca5d887..d8b97b963 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/MoveFileAccessControlTest.java +++ b/src/test/java/io/personium/test/jersey/box/dav/file/MoveFileAccessControlTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.dav.file; +package io.personium.test.jersey.box.dav.file; import java.util.ArrayList; import java.util.HashMap; @@ -31,32 +31,32 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreAuthzException; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.acl.jaxb.Acl; -import com.fujitsu.dc.test.jersey.cell.auth.AuthTestCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumCoreAuthzException; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.Box; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.acl.jaxb.Acl; +import io.personium.test.jersey.cell.auth.AuthTestCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; /** * ファイルのMOVEに対するアクセス制御のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class MoveFileAccessControlTest extends JerseyTest { @@ -84,11 +84,11 @@ public class MoveFileAccessControlTest extends JerseyTest { private static final Map INIT_PARAMS = new HashMap(); static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } /** @@ -162,7 +162,7 @@ public void after() { token = "invalid_token"; TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_UNAUTHORIZED); - DcCoreException expectedException = DcCoreAuthzException.TOKEN_PARSE_ERROR; + PersoniumCoreException expectedException = PersoniumCoreAuthzException.TOKEN_PARSE_ERROR; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); AuthTestCommon.waitForAccountLock(); } finally { @@ -192,7 +192,7 @@ public void after() { token = getToken(ACCOUNT_READ); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -303,7 +303,7 @@ public void after() { token = getToken(ACCOUNT_NO_PRIVILEGE); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -333,7 +333,7 @@ public void after() { token = getToken(ACCOUNT_READ); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -444,7 +444,7 @@ public void after() { token = getToken(ACCOUNT_NO_PRIVILEGE); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -508,7 +508,7 @@ public void after() { token = getToken(ACCOUNT_NO_PRIVILEGE); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -575,7 +575,7 @@ public void after() { token = getToken(ACCOUNT_NO_PRIVILEGE); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -650,7 +650,7 @@ private void setDefaultAcl(String collection) throws JAXBException { } /** - * 指定されたコレクションに対しPrincipal ALL Privilege ALLを設定. + * 指定されたコレクションに対しPrincipal ROOT Privilege ALLを設定. * @param collection コレクション名 * @throws JAXBException ACLのパースに失敗 */ diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/MoveFileHeaderValidateTest.java b/src/test/java/io/personium/test/jersey/box/dav/file/MoveFileHeaderValidateTest.java similarity index 88% rename from src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/MoveFileHeaderValidateTest.java rename to src/test/java/io/personium/test/jersey/box/dav/file/MoveFileHeaderValidateTest.java index daaa7b8fe..a1077b204 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/MoveFileHeaderValidateTest.java +++ b/src/test/java/io/personium/test/jersey/box/dav/file/MoveFileHeaderValidateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.dav.file; +package io.personium.test.jersey.box.dav.file; import static org.fest.assertions.Assertions.assertThat; import static org.junit.Assert.assertEquals; @@ -30,18 +30,18 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; /** @@ -52,9 +52,9 @@ *
  • エラー時:エラーコード
  • *
  • エラー時:エラーメッセージ
  • * - * @see com.fujitsu.dc.test.jersey.box.dav.file.MoveFileTest + * @see io.personium.test.jersey.box.dav.file.MoveFileTest */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class MoveFileHeaderValidateTest extends JerseyTest { private static final String TOKEN = AbstractCase.MASTER_TOKEN_NAME; @@ -67,7 +67,7 @@ public class MoveFileHeaderValidateTest extends JerseyTest { * コンストラクタ. */ public MoveFileHeaderValidateTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -82,13 +82,13 @@ public MoveFileHeaderValidateTest() { // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.REQUIRED_REQUEST_HEADER_NOT_EXIST.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.REQUIRED_REQUEST_HEADER_NOT_EXIST.params( HttpHeaders.DESTINATION); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -110,14 +110,14 @@ public MoveFileHeaderValidateTest() { // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.REQUIRED_REQUEST_HEADER_NOT_EXIST.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.REQUIRED_REQUEST_HEADER_NOT_EXIST.params( HttpHeaders.DESTINATION, destination); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -142,14 +142,14 @@ public MoveFileHeaderValidateTest() { // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destination); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -174,14 +174,14 @@ public MoveFileHeaderValidateTest() { // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destination); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -206,12 +206,12 @@ public MoveFileHeaderValidateTest() { // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CREATED); // 移動元のファイルが存在しないこと @@ -238,15 +238,15 @@ public MoveFileHeaderValidateTest() { // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, ""); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.OVERWRITE, ""); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -274,13 +274,13 @@ public MoveFileHeaderValidateTest() { // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "T"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CREATED); // 移動元のファイルが存在しないこと @@ -307,13 +307,13 @@ public MoveFileHeaderValidateTest() { // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "F"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CREATED); // 移動元のファイルが存在しないこと @@ -340,15 +340,15 @@ public MoveFileHeaderValidateTest() { // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "Y"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.OVERWRITE, "Y"); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -376,13 +376,13 @@ public MoveFileHeaderValidateTest() { // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "T"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CREATED); // 移動元のファイルが存在しないこと @@ -411,15 +411,15 @@ public MoveFileHeaderValidateTest() { // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.DEPTH, depth); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - DcCoreException expectedException = DcCoreException.Dav.INVALID_DEPTH_HEADER.params(depth); + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_DEPTH_HEADER.params(depth); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 移動元のファイルが存在すること @@ -447,13 +447,13 @@ public MoveFileHeaderValidateTest() { // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.DEPTH, depth); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // 移動元のファイルが存在しないこと @@ -481,13 +481,13 @@ public MoveFileHeaderValidateTest() { // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.DEPTH, depth); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // 移動元のファイルが存在しないこと @@ -515,15 +515,15 @@ public MoveFileHeaderValidateTest() { // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.DEPTH, depth); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - DcCoreException expectedException = DcCoreException.Dav.INVALID_DEPTH_HEADER.params(depth); + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_DEPTH_HEADER.params(depth); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 移動元のファイルが存在すること @@ -551,14 +551,14 @@ public MoveFileHeaderValidateTest() { // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.DEPTH, depth); req.header(HttpHeaders.OVERWRITE, "T"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // 移動元のファイルが存在しないこと @@ -586,7 +586,7 @@ public MoveFileHeaderValidateTest() { // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.DEPTH, depth); @@ -594,9 +594,9 @@ public MoveFileHeaderValidateTest() { req.header(HttpHeaders.IF_MATCH, ""); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertEquals(HttpStatus.SC_PRECONDITION_FAILED, response.getStatusCode()); - DcCoreException expectedException = DcCoreException.Dav.ETAG_NOT_MATCH; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.ETAG_NOT_MATCH; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 移動元のファイルが存在すること @@ -624,7 +624,7 @@ public MoveFileHeaderValidateTest() { // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.DEPTH, depth); @@ -632,7 +632,7 @@ public MoveFileHeaderValidateTest() { req.header(HttpHeaders.IF_MATCH, "*"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // 移動元のファイルが存在しないこと @@ -664,7 +664,7 @@ public MoveFileHeaderValidateTest() { // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.DEPTH, depth); @@ -672,9 +672,9 @@ public MoveFileHeaderValidateTest() { req.header(HttpHeaders.IF_MATCH, etag + "dummy"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertEquals(HttpStatus.SC_PRECONDITION_FAILED, response.getStatusCode()); - DcCoreException expectedException = DcCoreException.Dav.ETAG_NOT_MATCH; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.ETAG_NOT_MATCH; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 移動元のファイルが存在すること @@ -707,7 +707,7 @@ public MoveFileHeaderValidateTest() { // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.DEPTH, depth); @@ -715,7 +715,7 @@ public MoveFileHeaderValidateTest() { req.header(HttpHeaders.IF_MATCH, etag); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // 移動元のファイルが存在しないこと diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/MoveFileTest.java b/src/test/java/io/personium/test/jersey/box/dav/file/MoveFileTest.java similarity index 88% rename from src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/MoveFileTest.java rename to src/test/java/io/personium/test/jersey/box/dav/file/MoveFileTest.java index 120b1165e..4a9d22cee 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/MoveFileTest.java +++ b/src/test/java/io/personium/test/jersey/box/dav/file/MoveFileTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.dav.file; +package io.personium.test.jersey.box.dav.file; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -30,20 +30,20 @@ import org.w3c.dom.NodeList; import org.w3c.dom.Text; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; import static org.fest.assertions.Assertions.assertThat; @@ -52,7 +52,7 @@ /** * MOVEのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class MoveFileTest extends JerseyTest { private static final String TOKEN = AbstractCase.MASTER_TOKEN_NAME; @@ -65,7 +65,7 @@ public class MoveFileTest extends JerseyTest { * コンストラクタ. */ public MoveFileTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } private void checkPropfindResponse(final String expectedUrl, TResponse res, boolean isExists) { @@ -102,7 +102,7 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 TResponse response = DavResourceUtils.moveWebDav(TOKEN, CELL_NAME, BOX_NAME + "/" + svcColName + "/__src", destination, HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.SERVICE_SOURCE_COLLECTION_PROHIBITED_TO_MOVE; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.SERVICE_SOURCE_COLLECTION_PROHIBITED_TO_MOVE; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -120,12 +120,12 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool try { // Fileの移動 String url = UrlUtils.entityType(CELL_NAME, BOX_NAME, "dummyCollection", "entity"); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_NOT_FOUND); } finally { @@ -142,12 +142,12 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool try { // Fileの移動 String url = UrlUtils.entityType(CELL_NAME, BOX_NAME, Setup.TEST_ODATA, "entity"); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_METHOD_NOT_ALLOWED); } finally { @@ -164,12 +164,12 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool try { // Fileの移動 String url = UrlUtils.userdata(CELL_NAME, BOX_NAME, Setup.TEST_ODATA, "entity", "key"); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_NOT_FOUND); } finally { @@ -186,12 +186,12 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool try { // Fileの移動 String url = UrlUtils.userdata(CELL_NAME, BOX_NAME, Setup.TEST_ODATA, "SalesDetail", "userdata100"); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_METHOD_NOT_ALLOWED); } finally { @@ -208,14 +208,14 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool try { // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_NOT_FOUND); - DcCoreException expectedException = DcCoreException.Dav.RESOURCE_NOT_FOUND; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.RESOURCE_NOT_FOUND; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -233,14 +233,14 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool try { // 移動 String url = UrlUtils.boxRoot(CELL_NAME, BOX_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.RESOURCE_PROHIBITED_TO_MOVE_BOX; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.RESOURCE_PROHIBITED_TO_MOVE_BOX; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -266,14 +266,14 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, colName, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "F"); req.addJsonBody(HttpHeaders.DESTINATION, destination); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CREATED); // 移動元のファイルが存在しないこと @@ -309,13 +309,13 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, colName, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination + "/"); req.header(HttpHeaders.OVERWRITE, "F"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CREATED); // 移動元のファイルが存在しないこと @@ -347,14 +347,14 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Dav.DESTINATION_EQUALS_SOURCE_URL.params(destination); + PersoniumCoreException expectedException = PersoniumCoreException.Dav.DESTINATION_EQUALS_SOURCE_URL.params(destination); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -369,7 +369,7 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool public final void FileのMOVEでDestinationヘッダに移動元とホスト名が異なる文字列を指定した場合に400エラーとなること() { final String destFileName = "destFile.txt"; final String destination = String.format("%s://%s/%s/%s/%s", - DcCoreConfig.getUnitScheme(), "fqdn", CELL_NAME, BOX_NAME, destFileName); + PersoniumUnitConfig.getUnitScheme(), "fqdn", CELL_NAME, BOX_NAME, destFileName); try { // 事前準備 DavResourceUtils.createWebDavFile(TOKEN, CELL_NAME, @@ -377,14 +377,14 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destination); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -406,14 +406,14 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destination); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -436,14 +436,14 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destination); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -466,14 +466,14 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destination); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -498,15 +498,15 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "T"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.RESOURCE_PROHIBITED_TO_MOVE_SERVICE_COLLECTION; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.RESOURCE_PROHIBITED_TO_MOVE_SERVICE_COLLECTION; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { DavResourceUtils.deleteWebDavFile(CELL_NAME, TOKEN, BOX_NAME + "/" + colName, FILE_NAME); @@ -531,13 +531,13 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "T"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CREATED); } finally { DavResourceUtils.deleteWebDavFile(CELL_NAME, TOKEN, BOX_NAME + "/" + colName + "/__src", FILE_NAME); @@ -560,15 +560,15 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "T"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CONFLICT); - DcCoreException expectedException = DcCoreException.Dav.HAS_NOT_PARENT.params(invalidColName); + PersoniumCoreException expectedException = PersoniumCoreException.Dav.HAS_NOT_PARENT.params(invalidColName); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { DavResourceUtils.deleteWebDavFile(CELL_NAME, TOKEN, BOX_NAME, FILE_NAME); @@ -592,15 +592,15 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "T"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CONFLICT); - DcCoreException expectedException = DcCoreException.Dav.HAS_NOT_PARENT.params(invalidColName); + PersoniumCoreException expectedException = PersoniumCoreException.Dav.HAS_NOT_PARENT.params(invalidColName); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { DavResourceUtils.deleteWebDavFile(CELL_NAME, TOKEN, BOX_NAME, FILE_NAME); @@ -621,14 +621,14 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destination); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -650,14 +650,14 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destination); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -693,13 +693,13 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, colName, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "F"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CREATED); String etag = response.getFirstHeader(HttpHeaders.ETAG); @@ -733,14 +733,14 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destination); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -762,14 +762,14 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destination); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -795,15 +795,15 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "T"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { DavResourceUtils.deleteCollection(CELL_NAME, BOX_NAME, colName, TOKEN, -1); @@ -827,15 +827,15 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "F"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_PRECONDITION_FAILED); - DcCoreException expectedException = DcCoreException.Dav.DESTINATION_ALREADY_EXISTS; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.DESTINATION_ALREADY_EXISTS; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { DavResourceUtils.deleteWebDavFile(CELL_NAME, TOKEN, BOX_NAME, FILE_NAME); @@ -859,15 +859,15 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "T"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.RESOURCE_PROHIBITED_TO_MOVE_FILE; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.RESOURCE_PROHIBITED_TO_MOVE_FILE; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { DavResourceUtils.deleteWebDavFile(CELL_NAME, TOKEN, BOX_NAME, FILE_NAME); @@ -892,15 +892,15 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "T"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { DavResourceUtils.deleteCollection(CELL_NAME, BOX_NAME, colName, TOKEN, -1); @@ -924,15 +924,15 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "T"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.SERVICE_SOURCE_COLLECTION_PROHIBITED_TO_OVERWRITE; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.SERVICE_SOURCE_COLLECTION_PROHIBITED_TO_OVERWRITE; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { DavResourceUtils.deleteCollection(CELL_NAME, BOX_NAME, colName, TOKEN, -1); @@ -954,15 +954,15 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "T"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { DavResourceUtils.deleteWebDavFile(CELL_NAME, TOKEN, BOX_NAME, FILE_NAME); @@ -982,15 +982,15 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "T"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.RESOURCE_PROHIBITED_TO_MOVE_ODATA_COLLECTION; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.RESOURCE_PROHIBITED_TO_MOVE_ODATA_COLLECTION; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { DavResourceUtils.deleteWebDavFile(CELL_NAME, TOKEN, BOX_NAME, FILE_NAME); @@ -1011,13 +1011,13 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "F"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CREATED); String etag = response.getFirstHeader(HttpHeaders.ETAG); @@ -1054,13 +1054,13 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "T"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CREATED); String etag = response.getFirstHeader(HttpHeaders.ETAG); @@ -1100,7 +1100,7 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 TResponse res = DavResourceUtils.moveWebDav(TOKEN, CELL_NAME, BOX_NAME + "/" + FILE_NAME, destination, HttpStatus.SC_PRECONDITION_FAILED); - DcCoreException expectedException = DcCoreException.Dav.DESTINATION_ALREADY_EXISTS; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.DESTINATION_ALREADY_EXISTS; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); // 移動元ファイルが取得できること @@ -1131,12 +1131,12 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "T"); - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_NO_CONTENT); String etag = response.getFirstHeader(HttpHeaders.ETAG); // 移動元ファイルが取得できないこと @@ -1172,13 +1172,13 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, colName, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "F"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CREATED); String etag = response.getFirstHeader(HttpHeaders.ETAG); @@ -1219,13 +1219,13 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, colName, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "T"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CREATED); String etag = response.getFirstHeader(HttpHeaders.ETAG); @@ -1267,15 +1267,15 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, colName, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "F"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_PRECONDITION_FAILED); - DcCoreException expectedException = DcCoreException.Dav.DESTINATION_ALREADY_EXISTS; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.DESTINATION_ALREADY_EXISTS; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 移動元ファイルを取得できること @@ -1312,13 +1312,13 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, colName, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "T"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_NO_CONTENT); String etag = response.getFirstHeader(HttpHeaders.ETAG); @@ -1367,13 +1367,13 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動(上書き禁止モード) String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcColName1 + "/" + srcColName2, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "F"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CREATED); String etag = response.getFirstHeader(HttpHeaders.ETAG); @@ -1443,13 +1443,13 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動(上書きモード) String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcColName1 + "/" + srcColName2, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination2); req.header(HttpHeaders.OVERWRITE, "T"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CREATED); String etag = response.getFirstHeader(HttpHeaders.ETAG); @@ -1522,15 +1522,15 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動(上書き禁止モード) String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcColName1 + "/" + srcColName2, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination1); req.header(HttpHeaders.OVERWRITE, "F"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_PRECONDITION_FAILED); - DcCoreException expectedException = DcCoreException.Dav.DESTINATION_ALREADY_EXISTS; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.DESTINATION_ALREADY_EXISTS; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 移動元ファイルを取得できること @@ -1603,13 +1603,13 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動(上書きモード) String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcColName1 + "/" + srcColName2, FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "T"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_NO_CONTENT); String etag = response.getFirstHeader(HttpHeaders.ETAG); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/MoveServiceSourceAccessControlTest.java b/src/test/java/io/personium/test/jersey/box/dav/file/MoveServiceSourceAccessControlTest.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/MoveServiceSourceAccessControlTest.java rename to src/test/java/io/personium/test/jersey/box/dav/file/MoveServiceSourceAccessControlTest.java index a4f57bd38..6045bbf7f 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/MoveServiceSourceAccessControlTest.java +++ b/src/test/java/io/personium/test/jersey/box/dav/file/MoveServiceSourceAccessControlTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.dav.file; +package io.personium.test.jersey.box.dav.file; import java.util.ArrayList; import java.util.HashMap; @@ -31,32 +31,32 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreAuthzException; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.acl.jaxb.Acl; -import com.fujitsu.dc.test.jersey.cell.auth.AuthTestCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumCoreAuthzException; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.Box; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.acl.jaxb.Acl; +import io.personium.test.jersey.cell.auth.AuthTestCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; /** * ServiceSourceのMOVEに対するアクセス制御のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class MoveServiceSourceAccessControlTest extends JerseyTest { @@ -84,11 +84,11 @@ public class MoveServiceSourceAccessControlTest extends JerseyTest { private static final Map INIT_PARAMS = new HashMap(); static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } /** @@ -162,7 +162,7 @@ public void after() { token = "invalid_token"; TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_UNAUTHORIZED); - DcCoreException expectedException = DcCoreAuthzException.TOKEN_PARSE_ERROR; + PersoniumCoreException expectedException = PersoniumCoreAuthzException.TOKEN_PARSE_ERROR; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); AuthTestCommon.waitForAccountLock(); } finally { @@ -192,7 +192,7 @@ public void after() { token = getToken(ACCOUNT_READ); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -303,7 +303,7 @@ public void after() { token = getToken(ACCOUNT_NO_PRIVILEGE); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -333,7 +333,7 @@ public void after() { token = getToken(ACCOUNT_READ); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -444,7 +444,7 @@ public void after() { token = getToken(ACCOUNT_NO_PRIVILEGE); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -513,7 +513,7 @@ public void after() { token = getToken(ACCOUNT_NO_PRIVILEGE); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -586,7 +586,7 @@ public void after() { token = getToken(ACCOUNT_NO_PRIVILEGE); TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -664,7 +664,7 @@ private void setDefaultAcl(String collection) throws JAXBException { } /** - * 指定されたコレクションに対しPrincipal ALL Privilege ALLを設定. + * 指定されたコレクションに対しPrincipal ROOT Privilege ALLを設定. * @param collection コレクション名 * @throws JAXBException ACLのパースに失敗 */ diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/MoveServiceSourceHeaderValidateTest.java b/src/test/java/io/personium/test/jersey/box/dav/file/MoveServiceSourceHeaderValidateTest.java similarity index 84% rename from src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/MoveServiceSourceHeaderValidateTest.java rename to src/test/java/io/personium/test/jersey/box/dav/file/MoveServiceSourceHeaderValidateTest.java index 6fe08b05a..4017b5d4b 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/MoveServiceSourceHeaderValidateTest.java +++ b/src/test/java/io/personium/test/jersey/box/dav/file/MoveServiceSourceHeaderValidateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.dav.file; +package io.personium.test.jersey.box.dav.file; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -27,18 +27,18 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; import static org.fest.assertions.Assertions.assertThat; @@ -53,9 +53,9 @@ *
  • エラー時:エラーメッセージ
  • * * なお、現状では、サービスソースとWebDAVファイルで実装が同じため、一部のエラー系のチェックのみ実施している. - * @see com.fujitsu.dc.test.jersey.box.dav.file.MoveFileTest + * @see io.personium.test.jersey.box.dav.file.MoveFileTest */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class MoveServiceSourceHeaderValidateTest extends JerseyTest { private static final String TOKEN = AbstractCase.MASTER_TOKEN_NAME; @@ -68,7 +68,7 @@ public class MoveServiceSourceHeaderValidateTest extends JerseyTest { * コンストラクタ. */ public MoveServiceSourceHeaderValidateTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -87,13 +87,13 @@ public MoveServiceSourceHeaderValidateTest() { // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, svcCol, "__src", FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.REQUIRED_REQUEST_HEADER_NOT_EXIST.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.REQUIRED_REQUEST_HEADER_NOT_EXIST.params( HttpHeaders.DESTINATION); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -121,15 +121,15 @@ public MoveServiceSourceHeaderValidateTest() { // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, svcCol, "__src", FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "Y"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.OVERWRITE, "Y"); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -163,15 +163,15 @@ public MoveServiceSourceHeaderValidateTest() { // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, svcCol, "__src", FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.DEPTH, depth); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - DcCoreException expectedException = DcCoreException.Dav.INVALID_DEPTH_HEADER.params(depth); + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_DEPTH_HEADER.params(depth); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 移動元のファイルが存在すること @@ -209,7 +209,7 @@ public MoveServiceSourceHeaderValidateTest() { // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, svcCol, "__src", FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.DEPTH, depth); @@ -217,9 +217,9 @@ public MoveServiceSourceHeaderValidateTest() { req.header(HttpHeaders.IF_MATCH, etag + "dummy"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertEquals(HttpStatus.SC_PRECONDITION_FAILED, response.getStatusCode()); - DcCoreException expectedException = DcCoreException.Dav.ETAG_NOT_MATCH; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.ETAG_NOT_MATCH; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 移動元のファイルが存在すること diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/MoveServiceSourceTest.java b/src/test/java/io/personium/test/jersey/box/dav/file/MoveServiceSourceTest.java similarity index 89% rename from src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/MoveServiceSourceTest.java rename to src/test/java/io/personium/test/jersey/box/dav/file/MoveServiceSourceTest.java index 3f7f2783a..3a2f9e52a 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/MoveServiceSourceTest.java +++ b/src/test/java/io/personium/test/jersey/box/dav/file/MoveServiceSourceTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.dav.file; +package io.personium.test.jersey.box.dav.file; import javax.ws.rs.core.MediaType; @@ -27,19 +27,19 @@ import org.w3c.dom.NodeList; import org.w3c.dom.Text; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; import static org.fest.assertions.Assertions.assertThat; @@ -48,7 +48,7 @@ /** * ServiceSourceのMOVEのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class MoveServiceSourceTest extends JerseyTest { private static final String TOKEN = AbstractCase.MASTER_TOKEN_NAME; @@ -61,7 +61,7 @@ public class MoveServiceSourceTest extends JerseyTest { * コンストラクタ. */ public MoveServiceSourceTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } private void checkPropfindResponse(final String expectedUrl, TResponse res, boolean isExists) { @@ -100,13 +100,13 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, colName, "__src", FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "F"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CREATED); String etag = response.getFirstHeader(HttpHeaders.ETAG); @@ -141,14 +141,14 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool CELL_NAME, BOX_NAME, colName); // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, colName, "__src", FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_NOT_FOUND); - DcCoreException expectedException = DcCoreException.Dav.RESOURCE_NOT_FOUND; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.RESOURCE_NOT_FOUND; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -173,14 +173,14 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, colName, "__src", FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Dav.DESTINATION_EQUALS_SOURCE_URL.params(destination); + PersoniumCoreException expectedException = PersoniumCoreException.Dav.DESTINATION_EQUALS_SOURCE_URL.params(destination); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { @@ -197,7 +197,7 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool final String colName = "serviceColforMOVE"; final String destFileName = "destFile.txt"; final String destination = String.format("%s://%s/%s/%s/%s", - DcCoreConfig.getUnitScheme(), "fqdn", CELL_NAME, BOX_NAME, destFileName); + PersoniumUnitConfig.getUnitScheme(), "fqdn", CELL_NAME, BOX_NAME, destFileName); try { // 事前準備 DavResourceUtils.createServiceCollection(AbstractCase.BEARER_MASTER_TOKEN, HttpStatus.SC_CREATED, @@ -207,14 +207,14 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool HttpStatus.SC_CREATED); // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, colName + "/__src/" + FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destination); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -242,14 +242,14 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, colName + "/__src/" + FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destination); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -277,15 +277,15 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, colName + "/__src/" + FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "T"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CONFLICT); - DcCoreException expectedException = DcCoreException.Dav.HAS_NOT_PARENT.params(invalidColName); + PersoniumCoreException expectedException = PersoniumCoreException.Dav.HAS_NOT_PARENT.params(invalidColName); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { DavResourceUtils.deleteWebDavFile(CELL_NAME, TOKEN, BOX_NAME, colName + "/__src/" + FILE_NAME); @@ -310,14 +310,14 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, colName + "/__src/" + FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destination); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -344,14 +344,14 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, colName + "/__src/" + FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.INVALID_REQUEST_HEADER.params( + PersoniumCoreException expectedException = PersoniumCoreException.Dav.INVALID_REQUEST_HEADER.params( HttpHeaders.DESTINATION, destination); ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); @@ -382,15 +382,15 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, svcColName + "/__src/" + FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "T"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.RESOURCE_PROHIBITED_TO_OVERWRITE; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { DavResourceUtils.deleteWebDavFile(CELL_NAME, TOKEN, BOX_NAME, svcColName + "/__src/" + FILE_NAME); @@ -419,15 +419,15 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, svcColName + "/__src/" + FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "F"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_PRECONDITION_FAILED); - DcCoreException expectedException = DcCoreException.Dav.DESTINATION_ALREADY_EXISTS; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.DESTINATION_ALREADY_EXISTS; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { DavResourceUtils.deleteWebDavFile(CELL_NAME, TOKEN, BOX_NAME, svcColName + "/__src/" + FILE_NAME); @@ -456,15 +456,15 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, svcColName + "/__src/" + FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "T"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); - DcCoreException expectedException = DcCoreException.Dav.RESOURCE_PROHIBITED_TO_MOVE_FILE; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.RESOURCE_PROHIBITED_TO_MOVE_FILE; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); } finally { DavResourceUtils.deleteWebDavFile(CELL_NAME, TOKEN, BOX_NAME, parentFileName); @@ -491,13 +491,13 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, svcColName, "__src", FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "F"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CREATED); String etag = response.getFirstHeader(HttpHeaders.ETAG); @@ -539,13 +539,13 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, svcColName, "__src", FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "T"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CREATED); String etag = response.getFirstHeader(HttpHeaders.ETAG); @@ -589,15 +589,15 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, svcColName, "__src", FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "F"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_PRECONDITION_FAILED); - DcCoreException expectedException = DcCoreException.Dav.DESTINATION_ALREADY_EXISTS; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.DESTINATION_ALREADY_EXISTS; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 移動元ファイルを取得できること @@ -636,13 +636,13 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, svcColName, "__src", FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "T"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_NO_CONTENT); String etag = response.getFirstHeader(HttpHeaders.ETAG); @@ -687,13 +687,13 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動(上書き禁止モード) String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcSvcColName, "__src", FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "F"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CREATED); String etag = response.getFirstHeader(HttpHeaders.ETAG); @@ -747,13 +747,13 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動(上書きモード) String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcSvcColName, "__src", FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "T"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_CREATED); String etag = response.getFirstHeader(HttpHeaders.ETAG); @@ -810,15 +810,15 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動(上書き禁止モード) String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcSvcColName, "__src", FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "F"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_PRECONDITION_FAILED); - DcCoreException expectedException = DcCoreException.Dav.DESTINATION_ALREADY_EXISTS; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.DESTINATION_ALREADY_EXISTS; ODataCommon.checkErrorResponseBody(response, expectedException.getCode(), expectedException.getMessage()); // 移動元ファイルを取得できること @@ -877,13 +877,13 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動(上書きモード) String url = UrlUtils.box(CELL_NAME, BOX_NAME, srcSvcColName, "__src", FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "T"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_NO_CONTENT); String etag = response.getFirstHeader(HttpHeaders.ETAG); @@ -939,13 +939,13 @@ private void checkPropfindResponse(final String expectedUrl, TResponse res, bool // Fileの移動 String url = UrlUtils.box(CELL_NAME, BOX_NAME, svcColName, "__src", FILE_NAME); - DcRequest req = DcRequest.move(url); + PersoniumRequest req = PersoniumRequest.move(url); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.DESTINATION, destination); req.header(HttpHeaders.OVERWRITE, "T"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SC_NO_CONTENT); String etag = response.getFirstHeader(HttpHeaders.ETAG); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/ServiceSourceAccessControlTest.java b/src/test/java/io/personium/test/jersey/box/dav/file/ServiceSourceAccessControlTest.java similarity index 90% rename from src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/ServiceSourceAccessControlTest.java rename to src/test/java/io/personium/test/jersey/box/dav/file/ServiceSourceAccessControlTest.java index aadb397f1..329e6e8d3 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/ServiceSourceAccessControlTest.java +++ b/src/test/java/io/personium/test/jersey/box/dav/file/ServiceSourceAccessControlTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.dav.file; +package io.personium.test.jersey.box.dav.file; import java.util.HashMap; import java.util.Map; @@ -29,23 +29,23 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.acl.jaxb.Acl; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.Box; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.acl.jaxb.Acl; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; @@ -54,7 +54,7 @@ /** * サービスソースに対する親子関係のアクセス制御のテスト.
    */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class ServiceSourceAccessControlTest extends JerseyTest { @@ -71,11 +71,11 @@ public class ServiceSourceAccessControlTest extends JerseyTest { private static final Map INIT_PARAMS = new HashMap(); static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } /** @@ -117,7 +117,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.deleteWebDavFile(CELL_NAME, token, BOX_NAME, path); assertThat(res.getStatusCode()).isEqualTo(HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -156,7 +156,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.createWebDavFile(token, CELL_NAME, BOX_NAME + "/" + path, "testFileBody", MediaType.TEXT_PLAIN, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -195,7 +195,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.createWebDavFile(token, CELL_NAME, BOX_NAME + "/" + path, "testFileBody", MediaType.TEXT_PLAIN, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -233,7 +233,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.getWebDav(CELL_NAME, token, BOX_NAME, path, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -278,7 +278,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, BOX_NAME + "/" + path, destination, HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -334,7 +334,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, BOX_NAME + "/" + path, destination, "*", "T", "infinity", HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -397,7 +397,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, BOX_NAME + "/" + path, destination, "*", "T", "infinity", HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -432,7 +432,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, BOX_NAME + "/" + path, destination, "*", "T", "infinity", HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -527,7 +527,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.moveWebDav(token, CELL_NAME, BOX_NAME + "/" + path, destination, "*", "T", "infinity", HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -574,7 +574,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.propfind(token, CELL_NAME, path, "1", HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -620,7 +620,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.propfind(token, CELL_NAME, path, "1", HttpStatus.SC_FORBIDDEN); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -638,7 +638,7 @@ public void after() { // リクエスト実行 TResponse res = DavResourceUtils.setProppatch(token, HttpStatus.SC_FORBIDDEN, CELL_NAME, BOX_NAME, path); - DcCoreException expectedException = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException expectedException = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/package-info.java b/src/test/java/io/personium/test/jersey/box/dav/file/package-info.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/package-info.java rename to src/test/java/io/personium/test/jersey/box/dav/file/package-info.java index 8d75e33f0..cdfabe52b 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/file/package-info.java +++ b/src/test/java/io/personium/test/jersey/box/dav/file/package-info.java @@ -18,4 +18,4 @@ elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED ) -package com.fujitsu.dc.test.jersey.box.dav.file; +package io.personium.test.jersey.box.dav.file; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/package-info.java b/src/test/java/io/personium/test/jersey/box/dav/package-info.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/box/dav/package-info.java rename to src/test/java/io/personium/test/jersey/box/dav/package-info.java index dab6d7524..aa1ef8097 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/dav/package-info.java +++ b/src/test/java/io/personium/test/jersey/box/dav/package-info.java @@ -18,4 +18,4 @@ elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED ) -package com.fujitsu.dc.test.jersey.box.dav; +package io.personium.test.jersey.box.dav; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/AbstractUserDataTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/AbstractUserDataTest.java similarity index 90% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/AbstractUserDataTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/AbstractUserDataTest.java index 5ffd467d8..d58efcf26 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/AbstractUserDataTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/AbstractUserDataTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.fail; @@ -32,17 +32,17 @@ import org.json.simple.JSONObject; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRestAdapter; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumRestAdapter; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; import com.sun.jersey.test.framework.WebAppDescriptor; /** @@ -60,7 +60,7 @@ public abstract class AbstractUserDataTest extends AbstractCase { * コンストラクタ. */ public AbstractUserDataTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -85,7 +85,7 @@ protected TResponse createUserData(JSONObject body, int sc) { .with("entityType", entityTypeName) .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) - .with("token", "Bearer " + DcCoreConfig.getMasterToken()) + .with("token", "Bearer " + PersoniumUnitConfig.getMasterToken()) .with("body", body.toJSONString()) .returns() .statusCode(sc) @@ -173,7 +173,7 @@ protected TResponse createUserData(JSONObject body, .with("entityType", entityType) .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) - .with("token", "Bearer " + DcCoreConfig.getMasterToken()) + .with("token", "Bearer " + PersoniumUnitConfig.getMasterToken()) .with("body", body.toJSONString()) .returns() .statusCode(sc) @@ -201,7 +201,7 @@ protected TResponse getUserDataList(String cell, .with("entityType", entityType) .with("query", "") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -229,7 +229,7 @@ protected TResponse getUserDataList(String cell, .with("entityType", entityType) .with("query", query) .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -245,17 +245,17 @@ protected TResponse getUserDataList(String cell, * @param query リクエストクエリ * @return ユーザーデータ取得時のレスポンスオブジェクト */ - protected static DcResponse getUserDataWithDcClient(String cell, + protected static PersoniumResponse getUserDataWithDcClient(String cell, String box, String col, String targetEntityTypeName, String query) { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); - requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + DcCoreConfig.getMasterToken()); + requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + PersoniumUnitConfig.getMasterToken()); requestheaders.put(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); // リクエストを実行する @@ -335,7 +335,7 @@ protected TResponse updateUserData(String cell, String box, String col, String e .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", "*") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body.toJSONString()) .returns() .statusCode(HttpStatus.SC_NO_CONTENT) @@ -352,13 +352,13 @@ protected TResponse updateUserData(String cell, String box, String col, String e * @param body リクエストボディ * @return ユーザーデータ作成時のレスポンスオブジェクト */ - protected DcResponse createUserDataWithDcClient(String cell, + protected PersoniumResponse createUserDataWithDcClient(String cell, String box, String col, String entityType, JSONObject body) { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -392,7 +392,7 @@ protected TResponse createUserDataWithNP(String id, JSONObject body, int sc) { .with("navPropName", "_" + navPropName) .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body.toJSONString()) .returns() .statusCode(sc) @@ -407,12 +407,12 @@ protected TResponse createUserDataWithNP(String id, JSONObject body, int sc) { * @param reqBody リクエストボディ * @return レスポンス */ - protected DcResponse createComplexTypeUserDataWithNP(String id, HashMap reqBody) { + protected PersoniumResponse createComplexTypeUserDataWithNP(String id, HashMap reqBody) { // UserData作成 String requestUrl = UrlUtils.userdataNP(Setup.TEST_CELL1, Setup.TEST_BOX1, UserDataListWithNPTest.ODATA_COLLECTION, entityTypeName, id, navPropName); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); for (String key : reqBody.keySet()) { req.addJsonBody(key, reqBody.get(key)); @@ -433,7 +433,7 @@ protected void deleteUserData(String userDataId) { .with("collection", colName) .with("entityType", entityTypeName) .with("id", userDataId) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("ifMatch", "*") .returns() .statusCode(-1); @@ -507,7 +507,7 @@ protected void deleteUserDataLinks(String userDataId, String navPropId) { .with("navProp", "_" + navPropName) .with("navKey", navPropId) .with("contentType", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("ifMatch", "*") .returns() .statusCode(HttpStatus.SC_NO_CONTENT); @@ -535,7 +535,7 @@ protected String getNameSpace(String entityType, String col) { .with("path", "\\$metadata") .with("col", col) .with("accept", "application/xml") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/AbstractUserDataWithNP.java b/src/test/java/io/personium/test/jersey/box/odatacol/AbstractUserDataWithNP.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/AbstractUserDataWithNP.java rename to src/test/java/io/personium/test/jersey/box/odatacol/AbstractUserDataWithNP.java index 50af650ef..5815bd5e0 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/AbstractUserDataWithNP.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/AbstractUserDataWithNP.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; @@ -29,21 +29,21 @@ import org.junit.Ignore; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.TResponse; /** * UserDataのNavigationProperty経由一覧のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Ignore public class AbstractUserDataWithNP extends AbstractUserDataTest { @@ -116,7 +116,7 @@ void deleteUserDataForAST(String parentEntityType, String childEnitityType) { ODATA_COLLECTION, parentEntityType, -1); ResourceUtils.deleteUserDataLinks("parent", "userdataNP2", childEnitityType, Setup.TEST_CELL1, Setup.TEST_BOX1, ODATA_COLLECTION, parentEntityType, -1); - deleteUserData(cellName, boxName, colName, childEnitityType, "userdataNP2", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, childEnitityType, "userdataNP2", PersoniumUnitConfig.getMasterToken(), -1); deleteUserDataForONE(parentEntityType, childEnitityType); } @@ -126,9 +126,9 @@ void deleteUserDataForAST(String parentEntityType, String childEnitityType) { * @param childEnitityType 子EntityType */ void deleteUserDataForONE(String parentEntityType, String childEnitityType) { - deleteUserData(cellName, boxName, colName, childEnitityType, "userdata", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, childEnitityType, "userdataNP", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, parentEntityType, "parent", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, childEnitityType, "userdata", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, childEnitityType, "userdataNP", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, parentEntityType, "parent", PersoniumUnitConfig.getMasterToken(), -1); } /** @@ -378,7 +378,7 @@ void createComplexTypeUserDataForAST(String parentEntityType, String childEnitit reqBody.put("__id", "userdataNP2"); reqBody.put(UserDataComplexTypeUtils.ET_STRING_PROP, "etStrPropValue1"); reqBody.put(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); - DcResponse resPost = createComplexTypeUserDataWithNP("parent", reqBody); + PersoniumResponse resPost = createComplexTypeUserDataWithNP("parent", reqBody); assertEquals(HttpStatus.SC_CREATED, resPost.getStatusCode()); } @@ -427,7 +427,7 @@ void createUserDataForONE(String parentEntityType, String childEnitityType, Map< */ @SuppressWarnings("unchecked") void createComplexTypeUserDataForONE(String parentEntityType, String childEnitityType) { - DcResponse resPost = null; + PersoniumResponse resPost = null; JSONObject ct1stProp = new JSONObject(); ct1stProp.put("ct1stStrProp", "ct1stStrPropValue1"); @@ -487,7 +487,7 @@ void createComplexTypeUserDataParent(String parentEntityType) { reqBody.put("__id", "parent"); reqBody.put(UserDataComplexTypeUtils.ET_STRING_PROP, "etStrPropValue1"); reqBody.put(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); - DcResponse resPost = createUserDataComplexType(reqBody); + PersoniumResponse resPost = createUserDataComplexType(reqBody); assertEquals(HttpStatus.SC_CREATED, resPost.getStatusCode()); } @@ -495,12 +495,12 @@ void createComplexTypeUserDataParent(String parentEntityType) { * ComplexTypeユーザデータの登録を行う. * @param reqBody リクエストボディ */ - private DcResponse createUserDataComplexType(HashMap reqBody) { + private PersoniumResponse createUserDataComplexType(HashMap reqBody) { // UserData作成 String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, UserDataListWithNPTest.ODATA_COLLECTION, entityTypeName, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); for (String key : reqBody.keySet()) { req.addJsonBody(key, reqBody.get(key)); @@ -528,7 +528,7 @@ TResponse execNpListWithQuery(String parentEntityType, .with("entityType", "_" + childEntityType) .with("query", query) .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/AllTests.java b/src/test/java/io/personium/test/jersey/box/odatacol/AllTests.java similarity index 95% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/AllTests.java rename to src/test/java/io/personium/test/jersey/box/odatacol/AllTests.java index c972f8b80..56f4e5b9b 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/AllTests.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/JSONRequestObject.java b/src/test/java/io/personium/test/jersey/box/odatacol/JSONRequestObject.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/JSONRequestObject.java rename to src/test/java/io/personium/test/jersey/box/odatacol/JSONRequestObject.java index 29091cc42..630af648e 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/JSONRequestObject.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/JSONRequestObject.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import java.util.List; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataAssociationTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataAssociationTest.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataAssociationTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataAssociationTest.java index 9e7034dd9..bbc70cc48 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataAssociationTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataAssociationTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; @@ -34,40 +34,40 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.model.impl.es.odata.UserDataODataProducer; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AssociationEndUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.model.impl.es.odata.UserDataODataProducer; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AssociationEndUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; /** * UserDataの同一名AssociationEndが定義されている場合の動作テスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataAssociationTest extends JerseyTest { private static final Map INIT_PARAMS = new HashMap(); static { - INIT_PARAMS.put("com.sun.jersey.config.property.packages", "com.fujitsu.dc.core.rs"); + INIT_PARAMS.put("com.sun.jersey.config.property.packages", "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } String masterToken = Setup.MASTER_TOKEN_NAME; @@ -84,7 +84,7 @@ public class UserDataAssociationTest extends JerseyTest { String targetNameSpace = UserDataODataProducer.USER_ODATA_NAMESPACE + "." + targetEntityTypeName; // 登録するユーザODataの件数(N:Nの$linksで登録可能な上限値) - int registUserDataCount = DcCoreConfig.getLinksNtoNMaxSize(); + int registUserDataCount = PersoniumUnitConfig.getLinksNtoNMaxSize(); /** * コンストラクタ. @@ -325,7 +325,7 @@ public final void after() { .with("entityType", srcEntityTypeName + "('" + userDataId + "')") .with("query", "?\\$expand=" + "_" + targetEntityTypeName) .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -354,7 +354,7 @@ public final void after() { .with("entityType", targetEntityTypeName + "('" + userDataNpId + "')") .with("query", "?\\$expand=" + "_" + srcEntityTypeName) .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataComplexPropertyDateTimeTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataComplexPropertyDateTimeTest.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataComplexPropertyDateTimeTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataComplexPropertyDateTimeTest.java index 48e4b8fd5..a53baac34 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataComplexPropertyDateTimeTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataComplexPropertyDateTimeTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -29,30 +29,30 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.utils.ODataUtils; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.odatacol.schema.property.PropertyUtils; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.Common; +import io.personium.core.utils.ODataUtils; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.odatacol.schema.property.PropertyUtils; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; /** * UserDataComplexType登録のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataComplexPropertyDateTimeTest extends AbstractUserDataTest { @@ -177,8 +177,8 @@ public UserDataComplexPropertyDateTimeTest() { // ユーザデータ作成 TResponse response = createUserData(body, HttpStatus.SC_BAD_REQUEST, cellName, boxName, COL_NAME, ENTITY_TYPE_NAME); - String code = DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(); - String message = DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PROP_NAME).getMessage(); + String code = PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(); + String message = PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PROP_NAME).getMessage(); checkErrorResponse(response.bodyAsJson(), code, message); } finally { @@ -294,8 +294,8 @@ public UserDataComplexPropertyDateTimeTest() { TResponse response = createUserData(body, HttpStatus.SC_BAD_REQUEST, cellName, boxName, COL_NAME, ENTITY_TYPE_NAME); - String code = DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(); - String message = DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PROP_NAME).getMessage(); + String code = PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(); + String message = PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PROP_NAME).getMessage(); checkErrorResponse(response.bodyAsJson(), code, message); } finally { @@ -562,7 +562,7 @@ protected TResponse createEntityType(String name, String odataName) { .with("boxPath", boxName) .with("odataSvcPath", odataName) .with("accept", MediaType.APPLICATION_JSON) - .with("token", "Bearer " + DcCoreConfig.getMasterToken()) + .with("token", "Bearer " + PersoniumUnitConfig.getMasterToken()) .with("Name", name) .returns() .debug(); @@ -576,7 +576,7 @@ protected TResponse createEntityType(String name, String odataName) { protected void createProperty(String type, String defValue) { // リクエストパラメータ設定 String locationUrl = UrlUtils.property(cellName, boxName, COL_NAME, null, null); - DcRequest req = DcRequest.post(locationUrl); + PersoniumRequest req = PersoniumRequest.post(locationUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, PROP_NAME); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, ENTITY_TYPE_NAME); @@ -588,7 +588,7 @@ protected void createProperty(String type, String defValue) { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); @@ -606,7 +606,7 @@ protected void deleteUserData(String userDataId) { .with("collection", COL_NAME) .with("entityType", ENTITY_TYPE_NAME) .with("id", userDataId) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("ifMatch", "*") .returns() .debug(); @@ -636,7 +636,7 @@ private void createEntities(String type) { */ private void createEntities(String type, String defaultcomplexTypeProperty) { // Collection作成 - DavResourceUtils.createODataCollection(DcCoreConfig.getMasterToken(), HttpStatus.SC_CREATED, cellName, boxName, + DavResourceUtils.createODataCollection(PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_CREATED, cellName, boxName, COL_NAME); // EntityType作成 @@ -673,6 +673,6 @@ protected void deleteEntities() { "application/json", ENTITY_TYPE_NAME, cellName, -1); // コレクションを削除 - DavResourceUtils.deleteCollection(cellName, boxName, COL_NAME, DcCoreConfig.getMasterToken(), -1); + DavResourceUtils.deleteCollection(cellName, boxName, COL_NAME, PersoniumUnitConfig.getMasterToken(), -1); } } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataComplexTypeCreateTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataComplexTypeCreateTest.java similarity index 90% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataComplexTypeCreateTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataComplexTypeCreateTest.java index 26f396d7f..9a1e94d62 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataComplexTypeCreateTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataComplexTypeCreateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; @@ -32,41 +32,41 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; import com.sun.jersey.test.framework.WebAppDescriptor; /** * UserDataComplexType登録のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataComplexTypeCreateTest extends AbstractUserDataTest { private static final Map INIT_PARAMS = new HashMap(); static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } /** @@ -96,14 +96,14 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -144,14 +144,14 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -203,7 +203,7 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); @@ -214,7 +214,7 @@ public UserDataComplexTypeCreateTest() { req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -270,7 +270,7 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); @@ -281,7 +281,7 @@ public UserDataComplexTypeCreateTest() { req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -340,7 +340,7 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); @@ -348,7 +348,7 @@ public UserDataComplexTypeCreateTest() { req.addJsonBody("listComplexType", etListPropStr); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -406,14 +406,14 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -456,14 +456,14 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -494,19 +494,19 @@ public UserDataComplexTypeCreateTest() { // リクエストパラメータ設定 String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params( + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params( UserDataComplexTypeUtils.ET_CT1ST_PROP).getMessage()); } finally { // 作成したPropertyを削除 @@ -530,20 +530,20 @@ public UserDataComplexTypeCreateTest() { // リクエストパラメータ設定 String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params(UserDataComplexTypeUtils.ET_CT1ST_PROP) + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params(UserDataComplexTypeUtils.ET_CT1ST_PROP) .getMessage()); } finally { // 作成したPropertyを削除 @@ -577,20 +577,20 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("requiredEntry").getMessage()); + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("requiredEntry").getMessage()); } finally { // 作成したユーザデータを削除 ODataCommon.deleteOdataResource(userdatalocationUrl); @@ -632,7 +632,7 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); @@ -642,13 +642,13 @@ public UserDataComplexTypeCreateTest() { req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("etListPropSingle").getMessage()); + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("etListPropSingle").getMessage()); } finally { ODataCommon.deleteOdataResource(userdatalocationUrl); UserDataComplexTypeUtils.deleteSimpleArraySchema(); @@ -687,7 +687,7 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); @@ -695,13 +695,13 @@ public UserDataComplexTypeCreateTest() { req.addJsonBody("listComplexType", etListPropStr); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("requiredStringEntry").getMessage()); + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("requiredStringEntry").getMessage()); } finally { ODataCommon.deleteOdataResource(userdatalocationUrl); ODataCommon.deleteOdataResource(UrlUtils.complexTypeProperty( @@ -743,7 +743,7 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); @@ -751,13 +751,13 @@ public UserDataComplexTypeCreateTest() { req.addJsonBody("listComplexType", etListPropStr); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("requiredStringEntry").getMessage()); + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("requiredStringEntry").getMessage()); } finally { ODataCommon.deleteOdataResource(userdatalocationUrl); ODataCommon.deleteOdataResource(UrlUtils.complexTypeProperty( @@ -799,7 +799,7 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); @@ -807,7 +807,7 @@ public UserDataComplexTypeCreateTest() { req.addJsonBody("listComplexType", etListPropStr); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック listComplexType2.put("requiredStringEntry", "test"); @@ -821,7 +821,7 @@ public UserDataComplexTypeCreateTest() { ODataCommon.checkResponseBody(response.bodyAsJson(), userdatalocationUrl, nameSpace, expected); // 取得リクエスト実行 - req = DcRequest.get(userdatalocationUrl); + req = PersoniumRequest.get(userdatalocationUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); response = request(req); @@ -862,14 +862,14 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -882,7 +882,7 @@ public UserDataComplexTypeCreateTest() { ODataCommon.checkResponseBody(response.bodyAsJson(), userdatalocationUrl, nameSpace, expected); // 取得リクエスト実行 - req = DcRequest.get(userdatalocationUrl); + req = PersoniumRequest.get(userdatalocationUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); response = request(req); @@ -927,14 +927,14 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -947,7 +947,7 @@ public UserDataComplexTypeCreateTest() { ODataCommon.checkResponseBody(response.bodyAsJson(), userdatalocationUrl, nameSpace, expected); // 取得リクエスト実行 - req = DcRequest.get(userdatalocationUrl); + req = PersoniumRequest.get(userdatalocationUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); response = request(req); @@ -992,14 +992,14 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -1012,7 +1012,7 @@ public UserDataComplexTypeCreateTest() { ODataCommon.checkResponseBody(response.bodyAsJson(), userdatalocationUrl, nameSpace, expected); // 取得リクエスト実行 - req = DcRequest.get(userdatalocationUrl); + req = PersoniumRequest.get(userdatalocationUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); response = request(req); @@ -1057,14 +1057,14 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -1077,7 +1077,7 @@ public UserDataComplexTypeCreateTest() { ODataCommon.checkResponseBody(response.bodyAsJson(), userdatalocationUrl, nameSpace, expected); // 取得リクエスト実行 - req = DcRequest.get(userdatalocationUrl); + req = PersoniumRequest.get(userdatalocationUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); response = request(req); @@ -1123,20 +1123,20 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(checkPropName).getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(checkPropName).getMessage()); } finally { // 作成したユーザデータを削除 ODataCommon.deleteOdataResource(userdatalocationUrl); @@ -1174,20 +1174,20 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(checkPropName).getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(checkPropName).getMessage()); } finally { // 作成したユーザデータを削除 ODataCommon.deleteOdataResource(userdatalocationUrl); @@ -1225,20 +1225,20 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(checkPropName).getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(checkPropName).getMessage()); } finally { // 作成したユーザデータを削除 ODataCommon.deleteOdataResource(userdatalocationUrl); @@ -1269,25 +1269,25 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); // 最大要素数+1までデータを追加する。 - for (int i = 0; i <= DcCoreConfig.getMaxPropertyCountInEntityType() - 3; i++) { + for (int i = 0; i <= PersoniumUnitConfig.getMaxPropertyCountInEntityType() - 3; i++) { req.addJsonBody(String.valueOf(i), i); } // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.ENTITYTYPE_STRUCTUAL_LIMITATION_EXCEEDED.getCode(), - DcCoreException.OData.ENTITYTYPE_STRUCTUAL_LIMITATION_EXCEEDED.getMessage()); + PersoniumCoreException.OData.ENTITYTYPE_STRUCTUAL_LIMITATION_EXCEEDED.getCode(), + PersoniumCoreException.OData.ENTITYTYPE_STRUCTUAL_LIMITATION_EXCEEDED.getMessage()); } finally { // 作成したユーザデータを削除 ODataCommon.deleteOdataResource(userdatalocationUrl); @@ -1318,7 +1318,7 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); @@ -1326,13 +1326,13 @@ public UserDataComplexTypeCreateTest() { Map expected = new HashMap(); // 最大要素数までデータを追加する。 - for (int i = 0; i <= DcCoreConfig.getMaxPropertyCountInEntityType() - 4; i++) { + for (int i = 0; i <= PersoniumUnitConfig.getMaxPropertyCountInEntityType() - 4; i++) { req.addJsonBody(String.valueOf(i), String.valueOf(i)); expected.put(String.valueOf(i), String.valueOf(i)); } // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック expected.put("__id", "test000"); @@ -1343,7 +1343,7 @@ public UserDataComplexTypeCreateTest() { ODataCommon.checkResponseBody(response.bodyAsJson(), userdatalocationUrl, nameSpace, expected); // 取得リクエスト実行 - req = DcRequest.get(userdatalocationUrl); + req = PersoniumRequest.get(userdatalocationUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); response = request(req); @@ -1396,7 +1396,7 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); @@ -1407,13 +1407,13 @@ public UserDataComplexTypeCreateTest() { req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("etListPropBoolean").getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("etListPropBoolean").getMessage()); } finally { UserDataComplexTypeUtils.deleteSimpleArraySchema(); } @@ -1453,7 +1453,7 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); @@ -1464,13 +1464,13 @@ public UserDataComplexTypeCreateTest() { req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("etListPropSingle").getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("etListPropSingle").getMessage()); } finally { UserDataComplexTypeUtils.deleteSimpleArraySchema(); } @@ -1510,7 +1510,7 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); @@ -1521,13 +1521,13 @@ public UserDataComplexTypeCreateTest() { req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("etListPropInt").getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("etListPropInt").getMessage()); } finally { UserDataComplexTypeUtils.deleteSimpleArraySchema(); } @@ -1561,14 +1561,14 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -1614,20 +1614,20 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("requiredStringEntry").getMessage()); + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("requiredStringEntry").getMessage()); } finally { ODataCommon.deleteOdataResource(UrlUtils.complexTypeProperty(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, "requiredStringEntry", "complexType2nd")); @@ -1670,20 +1670,20 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("ctListPropSingle").getMessage()); + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("ctListPropSingle").getMessage()); } finally { UserDataComplexTypeUtils.deleteSimpleArraySchemaInComplex(); } @@ -1722,14 +1722,14 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "ET_STRING_PROP_VALUE"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -1742,7 +1742,7 @@ public UserDataComplexTypeCreateTest() { ODataCommon.checkResponseBody(response.bodyAsJson(), userdatalocationUrl, nameSpace, expected); // 取得リクエスト実行 - req = DcRequest.get(userdatalocationUrl); + req = PersoniumRequest.get(userdatalocationUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); response = request(req); @@ -1788,20 +1788,20 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "ET_STRING_PROP_VALUE"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("requiredStringEntry").getMessage()); + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("requiredStringEntry").getMessage()); } finally { ODataCommon.deleteOdataResource(UrlUtils.complexTypeProperty(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, "requiredStringEntry", "ListComplexType")); @@ -1822,13 +1822,13 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -1839,7 +1839,7 @@ public UserDataComplexTypeCreateTest() { ODataCommon.checkResponseBody(response.bodyAsJson(), userdatalocationUrl, nameSpace, expected); // 取得リクエスト実行 - req = DcRequest.get(userdatalocationUrl); + req = PersoniumRequest.get(userdatalocationUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); response = request(req); @@ -1868,14 +1868,14 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -1886,7 +1886,7 @@ public UserDataComplexTypeCreateTest() { ODataCommon.checkResponseBody(response.bodyAsJson(), userdatalocationUrl, nameSpace, expected); // 取得リクエスト実行 - req = DcRequest.get(userdatalocationUrl); + req = PersoniumRequest.get(userdatalocationUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); response = request(req); @@ -1913,13 +1913,13 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, "propertyValue"); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); @@ -1948,13 +1948,13 @@ public UserDataComplexTypeCreateTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -1965,7 +1965,7 @@ public UserDataComplexTypeCreateTest() { ODataCommon.checkResponseBody(response.bodyAsJson(), userdatalocationUrl, nameSpace, expected); // 取得リクエスト実行 - req = DcRequest.get(userdatalocationUrl); + req = PersoniumRequest.get(userdatalocationUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); response = request(req); @@ -1999,13 +1999,13 @@ public UserDataComplexTypeCreateTest() { // リクエストパラメータ設定 String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody("listprop", "hoge"); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataComplexTypeGetTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataComplexTypeGetTest.java similarity index 90% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataComplexTypeGetTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataComplexTypeGetTest.java index 1ce25a8a4..0ebff0b92 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataComplexTypeGetTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataComplexTypeGetTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; @@ -32,22 +32,22 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.UserDataUtils; /** * UserDataComplexType登録のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataComplexTypeGetTest extends AbstractUserDataTest { @@ -86,14 +86,14 @@ public UserDataComplexTypeGetTest() { reqBody.put("__id", "test000"); reqBody.put(ET_STRING_PROP, "etStrPropValue"); reqBody.put(ET_CT1ST_PROP, ct1stProp); - DcResponse resPost = createUserDataComplexType(reqBody); + PersoniumResponse resPost = createUserDataComplexType(reqBody); assertEquals(HttpStatus.SC_CREATED, resPost.getStatusCode()); // ユーザデータ取得 - DcRequest req = DcRequest.get(userdatalocationUrl); + PersoniumRequest req = PersoniumRequest.get(userdatalocationUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse resGet = request(req); + PersoniumResponse resGet = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_OK, resGet.getStatusCode()); @@ -133,20 +133,20 @@ public UserDataComplexTypeGetTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(ET_STRING_PROP, "etStrPropValue"); req.addJsonBody(ET_CT1ST_PROP, ct1stProp); - DcResponse resPost = request(req); + PersoniumResponse resPost = request(req); assertEquals(HttpStatus.SC_CREATED, resPost.getStatusCode()); // ユーザデータ取得 - req = DcRequest.get(userdatalocationUrl); + req = PersoniumRequest.get(userdatalocationUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse resGet = request(req); + PersoniumResponse resGet = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_OK, resGet.getStatusCode()); @@ -198,7 +198,7 @@ public UserDataComplexTypeGetTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); @@ -209,11 +209,11 @@ public UserDataComplexTypeGetTest() { req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); // シンプル型配列データの作成 - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // リクエスト実行 - req = DcRequest.get(userdatalocationUrl); + req = PersoniumRequest.get(userdatalocationUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); response = request(req); @@ -262,7 +262,7 @@ public UserDataComplexTypeGetTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); @@ -270,11 +270,11 @@ public UserDataComplexTypeGetTest() { req.addJsonBody("listComplexType", etListPropStr); // Complex型配列データの作成 - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // リクエスト実行 - req = DcRequest.get(userdatalocationUrl); + req = PersoniumRequest.get(userdatalocationUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); response = request(req); @@ -335,18 +335,18 @@ public UserDataComplexTypeGetTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); // Complex型配列データの作成 - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // リクエスト実行 - req = DcRequest.get(userdatalocationUrl); + req = PersoniumRequest.get(userdatalocationUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); response = request(req); @@ -392,18 +392,18 @@ public UserDataComplexTypeGetTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); // Complex型配列データの作成 - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // リクエスト実行 - req = DcRequest.get(userdatalocationUrl); + req = PersoniumRequest.get(userdatalocationUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); response = request(req); @@ -422,7 +422,7 @@ public UserDataComplexTypeGetTest() { } } - private DcResponse createUserDataComplexType(HashMap reqBody) { + private PersoniumResponse createUserDataComplexType(HashMap reqBody) { // ComplexTypeのプロパティ定義登録 UserDataComplexTypeUtils.createComplexTypeSchema(ENTITY_TYPE_NAME, COMPLEX_TYPE_NAME, ET_STRING_PROP, @@ -431,7 +431,7 @@ private DcResponse createUserDataComplexType(HashMap reqBody) { // UserData作成 String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); for (String key : reqBody.keySet()) { req.addJsonBody(key, reqBody.get(key)); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataComplexTypeListTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataComplexTypeListTest.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataComplexTypeListTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataComplexTypeListTest.java index 105006553..43afea0a1 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataComplexTypeListTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataComplexTypeListTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; @@ -32,26 +32,26 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.UserDataUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.UserDataUtils; +import io.personium.test.utils.TResponse; /** * UserDataComplexType一覧取得のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataComplexTypeListTest extends AbstractUserDataTest { @@ -106,7 +106,7 @@ public UserDataComplexTypeListTest() { reqBody.put("__id", USER_DATA_ID1); reqBody.put(ET_STRING_PROP, "etStrPropValue1"); reqBody.put(ET_CT1ST_PROP, ct1stProp1); - DcResponse resPost = createUserDataComplexType(reqBody); + PersoniumResponse resPost = createUserDataComplexType(reqBody); assertEquals(HttpStatus.SC_CREATED, resPost.getStatusCode()); // ユーザデータ2登録 @@ -126,7 +126,7 @@ public UserDataComplexTypeListTest() { .with("entityType", ENTITY_TYPE_NAME) .with("query", "?\\$orderby=__id%20desc") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -187,13 +187,13 @@ public UserDataComplexTypeListTest() { String requestUrl1 = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, ENTITY_TYPE_NAME, null); - DcRequest req1 = DcRequest.post(requestUrl1); + PersoniumRequest req1 = PersoniumRequest.post(requestUrl1); req1.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req1.addJsonBody("__id", USER_DATA_ID1); req1.addJsonBody(ET_STRING_PROP, "etStrPropValue1"); req1.addJsonBody(ET_CT1ST_PROP, ct1stProp1); - DcResponse resPost1 = request(req1); + PersoniumResponse resPost1 = request(req1); assertEquals(HttpStatus.SC_CREATED, resPost1.getStatusCode()); // ユーザデータ2登録 @@ -210,13 +210,13 @@ public UserDataComplexTypeListTest() { String requestUrl2 = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, ENTITY_TYPE_NAME, null); - DcRequest req2 = DcRequest.post(requestUrl2); + PersoniumRequest req2 = PersoniumRequest.post(requestUrl2); req2.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req2.addJsonBody("__id", USER_DATA_ID2); req2.addJsonBody(ET_STRING_PROP, "etStrPropValue2"); req2.addJsonBody(ET_CT1ST_PROP, ct1stProp2); - DcResponse resPost2 = request(req2); + PersoniumResponse resPost2 = request(req2); assertEquals(HttpStatus.SC_CREATED, resPost2.getStatusCode()); // ユーザデータの一覧取得 @@ -227,7 +227,7 @@ public UserDataComplexTypeListTest() { .with("entityType", ENTITY_TYPE_NAME) .with("query", "?\\$orderby=__id%20desc") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -296,7 +296,7 @@ public UserDataComplexTypeListTest() { String requestUrl1 = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req1 = DcRequest.post(requestUrl1); + PersoniumRequest req1 = PersoniumRequest.post(requestUrl1); req1.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req1.addJsonBody("__id", USER_DATA_ID1); req1.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "etStrPropValue1"); @@ -307,7 +307,7 @@ public UserDataComplexTypeListTest() { req1.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp1); // シンプル型配列データの作成 - DcResponse response1 = request(req1); + PersoniumResponse response1 = request(req1); assertEquals(HttpStatus.SC_CREATED, response1.getStatusCode()); // ユーザデータ2登録 @@ -316,7 +316,7 @@ public UserDataComplexTypeListTest() { String requestUrl2 = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req2 = DcRequest.post(requestUrl2); + PersoniumRequest req2 = PersoniumRequest.post(requestUrl2); req2.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req2.addJsonBody("__id", USER_DATA_ID2); req2.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "etStrPropValue2"); @@ -327,7 +327,7 @@ public UserDataComplexTypeListTest() { req2.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp2); // シンプル型配列データの作成 - DcResponse response2 = request(req2); + PersoniumResponse response2 = request(req2); assertEquals(HttpStatus.SC_CREATED, response2.getStatusCode()); // ユーザデータの一覧取得 @@ -338,7 +338,7 @@ public UserDataComplexTypeListTest() { .with("entityType", ENTITY_TYPE_NAME) .with("query", "?\\$orderby=__id%20desc") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -404,7 +404,7 @@ public UserDataComplexTypeListTest() { String requestUrl1 = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req1 = DcRequest.post(requestUrl1); + PersoniumRequest req1 = PersoniumRequest.post(requestUrl1); req1.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req1.addJsonBody("__id", USER_DATA_ID1); req1.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "etStrPropValue1"); @@ -412,7 +412,7 @@ public UserDataComplexTypeListTest() { req1.addJsonBody("listComplexType", etListPropStr); // Complex型配列データの作成 - DcResponse response1 = request(req1); + PersoniumResponse response1 = request(req1); assertEquals(HttpStatus.SC_CREATED, response1.getStatusCode()); // ユーザデータ2登録 @@ -421,7 +421,7 @@ public UserDataComplexTypeListTest() { String requestUrl2 = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req2 = DcRequest.post(requestUrl2); + PersoniumRequest req2 = PersoniumRequest.post(requestUrl2); req2.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req2.addJsonBody("__id", USER_DATA_ID2); req2.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "etStrPropValue2"); @@ -429,7 +429,7 @@ public UserDataComplexTypeListTest() { req2.addJsonBody("listComplexType", etListPropStr); // Complex型配列データの作成 - DcResponse response2 = request(req2); + PersoniumResponse response2 = request(req2); assertEquals(HttpStatus.SC_CREATED, response2.getStatusCode()); // ユーザデータの一覧取得 @@ -440,7 +440,7 @@ public UserDataComplexTypeListTest() { .with("entityType", ENTITY_TYPE_NAME) .with("query", "?\\$orderby=__id%20desc") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -515,14 +515,14 @@ public UserDataComplexTypeListTest() { String requestUrl1 = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req1 = DcRequest.post(requestUrl1); + PersoniumRequest req1 = PersoniumRequest.post(requestUrl1); req1.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req1.addJsonBody("__id", USER_DATA_ID1); req1.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "etStrPropValue1"); req1.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp1); // Complex型配列データの作成 - DcResponse response1 = request(req1); + PersoniumResponse response1 = request(req1); assertEquals(HttpStatus.SC_CREATED, response1.getStatusCode()); // ユーザデータ2登録 @@ -536,14 +536,14 @@ public UserDataComplexTypeListTest() { String requestUrl2 = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req2 = DcRequest.post(requestUrl2); + PersoniumRequest req2 = PersoniumRequest.post(requestUrl2); req2.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req2.addJsonBody("__id", USER_DATA_ID2); req2.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "etStrPropValue2"); req2.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp2); // Complex型配列データの作成 - DcResponse response2 = request(req2); + PersoniumResponse response2 = request(req2); assertEquals(HttpStatus.SC_CREATED, response2.getStatusCode()); // ユーザデータの一覧取得 @@ -554,7 +554,7 @@ public UserDataComplexTypeListTest() { .with("entityType", ENTITY_TYPE_NAME) .with("query", "?\\$orderby=__id%20desc") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -612,14 +612,14 @@ public UserDataComplexTypeListTest() { String requestUrl1 = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req1 = DcRequest.post(requestUrl1); + PersoniumRequest req1 = PersoniumRequest.post(requestUrl1); req1.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req1.addJsonBody("__id", USER_DATA_ID1); req1.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "etStrPropValue1"); req1.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp1); // Complex型配列データの作成 - DcResponse response1 = request(req1); + PersoniumResponse response1 = request(req1); assertEquals(HttpStatus.SC_CREATED, response1.getStatusCode()); // ユーザデータ2登録 @@ -629,14 +629,14 @@ public UserDataComplexTypeListTest() { String requestUrl2 = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req2 = DcRequest.post(requestUrl2); + PersoniumRequest req2 = PersoniumRequest.post(requestUrl2); req2.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req2.addJsonBody("__id", USER_DATA_ID2); req2.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "etStrPropValue2"); req2.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp2); // Complex型配列データの作成 - DcResponse response2 = request(req2); + PersoniumResponse response2 = request(req2); assertEquals(HttpStatus.SC_CREATED, response2.getStatusCode()); // ユーザデータの一覧取得 @@ -647,7 +647,7 @@ public UserDataComplexTypeListTest() { .with("entityType", ENTITY_TYPE_NAME) .with("query", "?\\$orderby=__id%20desc") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -712,19 +712,19 @@ public UserDataComplexTypeListTest() { // ユーザデータ登録 String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", USER_DATA_ID1); req.addJsonBody("nullableList", null); req.addJsonBody("ctNullableList", null); - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); JSONObject result = ((JSONObject) (((JSONObject) response.bodyAsJson().get("d")).get("results"))); assertEquals(null, result.get("nullableList")); assertEquals(null, result.get("ctNullableList")); // ユーザデータ取得 - req = DcRequest.get(USER_DATA_LOCATION_URL1); + req = PersoniumRequest.get(USER_DATA_LOCATION_URL1); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); response = request(req); @@ -760,11 +760,11 @@ public UserDataComplexTypeListTest() { } } - private DcResponse createUserDataComplexType(HashMap reqBody) { + private PersoniumResponse createUserDataComplexType(HashMap reqBody) { // UserData作成 String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); for (String key : reqBody.keySet()) { req.addJsonBody(key, reqBody.get(key)); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataComplexTypeListWithNPTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataComplexTypeListWithNPTest.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataComplexTypeListWithNPTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataComplexTypeListWithNPTest.java index 1794a3e2c..7fa2e576f 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataComplexTypeListWithNPTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataComplexTypeListWithNPTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import java.util.HashMap; import java.util.Map; @@ -24,18 +24,18 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.TResponse; /** * ComplexTypeUserDataのNavigationProperty経由一覧のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataComplexTypeListWithNPTest extends AbstractUserDataWithNP { diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataComplexTypeMergeTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataComplexTypeMergeTest.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataComplexTypeMergeTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataComplexTypeMergeTest.java index 54301341f..352c84d74 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataComplexTypeMergeTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataComplexTypeMergeTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; @@ -34,26 +34,26 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.UserDataUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.UserDataUtils; +import io.personium.test.utils.TResponse; /** * UserDataComplexType登録のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataComplexTypeMergeTest extends AbstractUserDataTest { @@ -86,12 +86,12 @@ public UserDataComplexTypeMergeTest() { // ユーザデータ登録リクエスト実行 String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", userDataId); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // ユーザデータマージリクエスト実行 @@ -135,7 +135,7 @@ public UserDataComplexTypeMergeTest() { UserDataComplexTypeUtils.ET_CT1ST_PROP, UserDataComplexTypeUtils.CT1ST_STRING_PROP); // ComplexTypeProperty登録(1階層目) - DcResponse complexTypePropertyResponse = UserDataUtils.createComplexTypeProperty(Setup.TEST_CELL1, + PersoniumResponse complexTypePropertyResponse = UserDataUtils.createComplexTypeProperty(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, "ct2ndStrProp", UserDataComplexTypeUtils.COMPLEX_TYPE_NAME, "Edm.String", true, null, "None"); complexTypePropertylocationUrl = complexTypePropertyResponse.getFirstHeader(HttpHeaders.LOCATION); @@ -150,12 +150,12 @@ public UserDataComplexTypeMergeTest() { // ユーザデータ登録リクエスト実行 String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", userDataId); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // ユーザデータマージリクエスト実行 @@ -206,7 +206,7 @@ public UserDataComplexTypeMergeTest() { UserDataComplexTypeUtils.ET_CT1ST_PROP, UserDataComplexTypeUtils.CT1ST_STRING_PROP); // ComplexTypeProperty登録(2階層目) - DcResponse complexTypePropertyResponse = UserDataUtils.createComplexTypeProperty(Setup.TEST_CELL1, + PersoniumResponse complexTypePropertyResponse = UserDataUtils.createComplexTypeProperty(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, "ct2ndStrProp", UserDataComplexTypeUtils.COMPLEX_TYPE_NAME, "Edm.String", true, null, "None"); complexTypePropertylocationUrl = complexTypePropertyResponse.getFirstHeader(HttpHeaders.LOCATION); @@ -235,12 +235,12 @@ public UserDataComplexTypeMergeTest() { // ユーザデータ登録リクエスト実行 String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", userDataId); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // ユーザデータマージリクエスト実行 @@ -294,7 +294,7 @@ public UserDataComplexTypeMergeTest() { UserDataComplexTypeUtils.ET_CT1ST_PROP, UserDataComplexTypeUtils.CT1ST_STRING_PROP); // ComplexTypeProperty登録(2階層目) - DcResponse complexTypePropertyResponse = UserDataUtils.createComplexTypeProperty(Setup.TEST_CELL1, + PersoniumResponse complexTypePropertyResponse = UserDataUtils.createComplexTypeProperty(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, "ct2ndStrProp", UserDataComplexTypeUtils.COMPLEX_TYPE_NAME, "Edm.String", true, null, "None"); complexTypePropertylocationUrl = complexTypePropertyResponse.getFirstHeader(HttpHeaders.LOCATION); @@ -323,12 +323,12 @@ public UserDataComplexTypeMergeTest() { // ユーザデータ登録リクエスト実行 String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", userDataId); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // ユーザデータマージリクエスト実行 @@ -384,21 +384,21 @@ public UserDataComplexTypeMergeTest() { Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, HttpStatus.SC_CREATED); // ComplexType作成 - DcResponse ctRes = UserDataUtils.createComplexType(Setup.TEST_CELL1, Setup.TEST_BOX1, + PersoniumResponse ctRes = UserDataUtils.createComplexType(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.COMPLEX_TYPE_NAME); // Property作成 - DcResponse p1Res = UserDataUtils.createProperty(Setup.TEST_CELL1, Setup.TEST_BOX1, + PersoniumResponse p1Res = UserDataUtils.createProperty(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ET_STRING_PROP, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, EdmSimpleType.STRING.getFullyQualifiedTypeName(), false, null, null, false, null); - DcResponse p2Res = UserDataUtils.createProperty(Setup.TEST_CELL1, Setup.TEST_BOX1, + PersoniumResponse p2Res = UserDataUtils.createProperty(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ET_CT1ST_PROP, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, UserDataComplexTypeUtils.COMPLEX_TYPE_NAME, false, null, "List", false, null); // complexTypeProperty作成 - DcResponse p3Res = UserDataUtils.createComplexTypeProperty(Setup.TEST_CELL1, Setup.TEST_BOX1, + PersoniumResponse p3Res = UserDataUtils.createComplexTypeProperty(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.CT1ST_STRING_PROP, UserDataComplexTypeUtils.COMPLEX_TYPE_NAME, EdmSimpleType.STRING.getFullyQualifiedTypeName(), false, null, null); @@ -424,12 +424,12 @@ public UserDataComplexTypeMergeTest() { // ユーザデータ登録リクエスト実行 String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", userDataId); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // ユーザデータマージリクエスト実行 @@ -503,7 +503,7 @@ public UserDataComplexTypeMergeTest() { UserDataComplexTypeUtils.COMPLEX_TYPE_NAME, EdmSimpleType.STRING.getFullyQualifiedTypeName(), false, null, null); // ComplexTypeProperty2のproperty登録(1階層目) - DcResponse complexTypePropertyResponse = UserDataUtils.createComplexTypeProperty(Setup.TEST_CELL1, + PersoniumResponse complexTypePropertyResponse = UserDataUtils.createComplexTypeProperty(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, "ct2ndStrProp", UserDataComplexTypeUtils.COMPLEX_TYPE_NAME, "Edm.String", true, null, "None"); complexTypePropertylocationUrl = complexTypePropertyResponse.getFirstHeader(HttpHeaders.LOCATION); @@ -511,12 +511,12 @@ public UserDataComplexTypeMergeTest() { // ユーザデータ登録リクエスト実行 String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", userDataId); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // ユーザデータマージリクエスト実行 @@ -637,7 +637,7 @@ private TResponse mergeRequest(String cell, String box, String col, String entit .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", ifMatch) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", updateReqBody.toJSONString()) .returns() .debug(); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataComplexTypeUtils.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataComplexTypeUtils.java similarity index 95% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataComplexTypeUtils.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataComplexTypeUtils.java index 251729cff..500349fd5 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataComplexTypeUtils.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataComplexTypeUtils.java @@ -14,19 +14,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import javax.ws.rs.core.MediaType; import org.apache.http.HttpStatus; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.UserDataUtils; /** * UserDataComplexTypeのUtilsクラス. diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataCreateLinkLimitTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataCreateLinkLimitTest.java similarity index 88% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataCreateLinkLimitTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataCreateLinkLimitTest.java index 9764af89b..64f73bb48 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataCreateLinkLimitTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataCreateLinkLimitTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; @@ -34,37 +34,37 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.utils.AssociationEndUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.utils.AssociationEndUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; /** * UserDataのlink登録の上限値テスト. たくさんデータを登録するので、「Integration.class, Regression.class」では動作しない。 */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class }) public class UserDataCreateLinkLimitTest extends JerseyTest { private static final Map INIT_PARAMS = new HashMap(); static { - INIT_PARAMS.put("com.sun.jersey.config.property.packages", "com.fujitsu.dc.core.rs"); + INIT_PARAMS.put("com.sun.jersey.config.property.packages", "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } String masterToken = Setup.MASTER_TOKEN_NAME; @@ -85,7 +85,7 @@ public class UserDataCreateLinkLimitTest extends JerseyTest { String srcId = "id"; // 登録するユーザODataの件数(N:Nの$linksで登録可能な上限値) - int registUserDataCount = DcCoreConfig.getLinksNtoNMaxSize(); + int registUserDataCount = PersoniumUnitConfig.getLinksNtoNMaxSize(); /** * コンストラクタ. @@ -246,8 +246,8 @@ public final void after() { targetEntityTypeName, id, HttpStatus.SC_BAD_REQUEST); // エラーメッセージのチェック - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.LINK_UPPER_LIMIT_RECORD_EXEED.getCode(), - DcCoreException.OData.LINK_UPPER_LIMIT_RECORD_EXEED.getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.LINK_UPPER_LIMIT_RECORD_EXEED.getCode(), + PersoniumCoreException.OData.LINK_UPPER_LIMIT_RECORD_EXEED.getMessage()); // 登録済み件数が増加していないことのチェック String query = String.format("?\\$top=%s&\\$inlinecount=allpages", 0); @@ -270,8 +270,8 @@ public final void after() { srcEntityTypeName, srcId, HttpStatus.SC_BAD_REQUEST); // エラーメッセージのチェック - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.LINK_UPPER_LIMIT_RECORD_EXEED.getCode(), - DcCoreException.OData.LINK_UPPER_LIMIT_RECORD_EXEED.getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.LINK_UPPER_LIMIT_RECORD_EXEED.getCode(), + PersoniumCoreException.OData.LINK_UPPER_LIMIT_RECORD_EXEED.getMessage()); // 登録済み件数が増加していないことのチェック query = String.format("?\\$top=%s&\\$inlinecount=allpages", 0); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataCreateLinkTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataCreateLinkTest.java similarity index 81% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataCreateLinkTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataCreateLinkTest.java index 6695b9c0c..98a936062 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataCreateLinkTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataCreateLinkTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import org.apache.http.HttpStatus; import org.json.simple.JSONObject; @@ -22,22 +22,22 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AssociationEndUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AssociationEndUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; /** * UserData登録のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataCreateLinkTest extends AbstractUserDataTest { @@ -67,16 +67,16 @@ public UserDataCreateLinkTest() { try { // 128文字のエンティティタイプを作成 - EntityTypeUtils.create(Setup.TEST_CELL1, DcCoreConfig.getMasterToken(), + EntityTypeUtils.create(Setup.TEST_CELL1, PersoniumUnitConfig.getMasterToken(), Setup.TEST_ODATA, entityTypeName, HttpStatus.SC_CREATED); - EntityTypeUtils.create(Setup.TEST_CELL1, DcCoreConfig.getMasterToken(), + EntityTypeUtils.create(Setup.TEST_CELL1, PersoniumUnitConfig.getMasterToken(), Setup.TEST_ODATA, navPropName, HttpStatus.SC_CREATED); // AssociationEndを作成 - AssociationEndUtils.create(DcCoreConfig.getMasterToken(), "*", Setup.TEST_CELL1, + AssociationEndUtils.create(PersoniumUnitConfig.getMasterToken(), "*", Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, HttpStatus.SC_CREATED, "AssociationEnd", entityTypeName); - AssociationEndUtils.create(DcCoreConfig.getMasterToken(), "*", Setup.TEST_CELL1, + AssociationEndUtils.create(PersoniumUnitConfig.getMasterToken(), "*", Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, HttpStatus.SC_CREATED, "LinkAssociationEnd", navPropName); @@ -105,7 +105,7 @@ public UserDataCreateLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", entityTypeName + "('" + userDataId + "')") .with("trgPath", navPropName) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("trgUserdataUrl", targetUri) .returns() .debug() @@ -116,9 +116,9 @@ public UserDataCreateLinkTest() { // ユーザーデータを削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - entityTypeName, userDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + entityTypeName, userDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - navPropName, linkUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + navPropName, linkUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); // AssociationEndLinkを削除 AssociationEndUtils @@ -134,9 +134,9 @@ public UserDataCreateLinkTest() { Setup.TEST_ODATA, navPropName, Setup.TEST_BOX1, "LinkAssociationEnd", HttpStatus.SC_NO_CONTENT); // エンティティタイプを削除 - EntityTypeUtils.delete(Setup.TEST_ODATA, DcCoreConfig.getMasterToken(), + EntityTypeUtils.delete(Setup.TEST_ODATA, PersoniumUnitConfig.getMasterToken(), "application/json", entityTypeName, Setup.TEST_CELL1, -1); - EntityTypeUtils.delete(Setup.TEST_ODATA, DcCoreConfig.getMasterToken(), + EntityTypeUtils.delete(Setup.TEST_ODATA, PersoniumUnitConfig.getMasterToken(), "application/json", navPropName, Setup.TEST_CELL1, -1); } } @@ -169,7 +169,7 @@ public UserDataCreateLinkTest() { .with("colPath", colName) .with("srcPath", "Category('userdata001')") .with("trgPath", targetEntityType) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("trgUserdataUrl", targetUri) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) @@ -178,7 +178,7 @@ public UserDataCreateLinkTest() { // ユーザデータの削除 deleteUserData(userDataId); deleteUserData(cellName, boxName, colName, targetEntityType, - userDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + userDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -210,7 +210,7 @@ public UserDataCreateLinkTest() { .with("colPath", colName) .with("srcPath", "Category('userdata001')") .with("trgPath", targetEntityType) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("trgUserdataUrl", targetUri) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) @@ -219,7 +219,7 @@ public UserDataCreateLinkTest() { // ユーザデータの削除 deleteUserData(userDataId); deleteUserData(cellName, boxName, colName, targetEntityType, - userDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + userDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -244,16 +244,16 @@ public UserDataCreateLinkTest() { try { // 128文字のエンティティタイプを作成 - EntityTypeUtils.create(Setup.TEST_CELL1, DcCoreConfig.getMasterToken(), + EntityTypeUtils.create(Setup.TEST_CELL1, PersoniumUnitConfig.getMasterToken(), Setup.TEST_ODATA, entityTypeName, HttpStatus.SC_CREATED); - EntityTypeUtils.create(Setup.TEST_CELL1, DcCoreConfig.getMasterToken(), + EntityTypeUtils.create(Setup.TEST_CELL1, PersoniumUnitConfig.getMasterToken(), Setup.TEST_ODATA, navPropName, HttpStatus.SC_CREATED); // AssociationEndを作成 - AssociationEndUtils.create(DcCoreConfig.getMasterToken(), "*", Setup.TEST_CELL1, + AssociationEndUtils.create(PersoniumUnitConfig.getMasterToken(), "*", Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, HttpStatus.SC_CREATED, "AssociationEnd", entityTypeName); - AssociationEndUtils.create(DcCoreConfig.getMasterToken(), "*", Setup.TEST_CELL1, + AssociationEndUtils.create(PersoniumUnitConfig.getMasterToken(), "*", Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, HttpStatus.SC_CREATED, "LinkAssociationEnd", navPropName); @@ -287,9 +287,9 @@ public UserDataCreateLinkTest() { // ユーザーデータを削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - entityTypeName, userDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + entityTypeName, userDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - navPropName, linkUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + navPropName, linkUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); // AssociationEndLinkを削除 AssociationEndUtils @@ -305,9 +305,9 @@ public UserDataCreateLinkTest() { Setup.TEST_ODATA, navPropName, Setup.TEST_BOX1, "LinkAssociationEnd", HttpStatus.SC_NO_CONTENT); // エンティティタイプを削除 - EntityTypeUtils.delete(Setup.TEST_ODATA, DcCoreConfig.getMasterToken(), + EntityTypeUtils.delete(Setup.TEST_ODATA, PersoniumUnitConfig.getMasterToken(), "application/json", entityTypeName, Setup.TEST_CELL1, -1); - EntityTypeUtils.delete(Setup.TEST_ODATA, DcCoreConfig.getMasterToken(), + EntityTypeUtils.delete(Setup.TEST_ODATA, PersoniumUnitConfig.getMasterToken(), "application/json", navPropName, Setup.TEST_CELL1, -1); } } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataCreateTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataCreateTest.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataCreateTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataCreateTest.java index e1645f364..48547279f 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataCreateTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataCreateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; @@ -34,30 +34,30 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcException; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRestAdapter; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumException; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumRestAdapter; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; /** * UserData登録のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataCreateTest extends AbstractUserDataTest { @@ -187,7 +187,7 @@ public UserDataCreateTest() { Setup.entityTypePost(TEST_COL, TEST_BOX, TEST_ENTITYTYPE, cellPath); // ユーザデータの一覧取得(0件HITであることを確認) - DcResponse listResponse = getUserDataWithDcClient(cellPath, + PersoniumResponse listResponse = getUserDataWithDcClient(cellPath, TEST_BOX, TEST_COL, TEST_ENTITYTYPE, @@ -260,7 +260,7 @@ public UserDataCreateTest() { Setup.entityTypePost(TEST_COL, boxPath, TEST_ENTITYTYPE, TEST_CELL); // ユーザデータの一覧取得(0件HITであることを確認) - DcResponse listResponse = getUserDataWithDcClient(TEST_CELL, + PersoniumResponse listResponse = getUserDataWithDcClient(TEST_CELL, boxPath, TEST_COL, TEST_ENTITYTYPE, @@ -330,7 +330,7 @@ public UserDataCreateTest() { Setup.entityTypePost(colPath, TEST_BOX, TEST_ENTITYTYPE, TEST_CELL); // ユーザデータの一覧取得(0件HITであることを確認) - DcResponse listResponse = getUserDataWithDcClient(TEST_CELL, + PersoniumResponse listResponse = getUserDataWithDcClient(TEST_CELL, TEST_BOX, colPath, TEST_ENTITYTYPE, @@ -396,7 +396,7 @@ public UserDataCreateTest() { Setup.entityTypePost(TEST_COL, TEST_BOX, entityPath, TEST_CELL); // ユーザデータの一覧取得(0件HITであることを確認) - DcResponse listResponse = getUserDataWithDcClient(TEST_CELL, + PersoniumResponse listResponse = getUserDataWithDcClient(TEST_CELL, TEST_BOX, TEST_COL, entityPath, @@ -518,8 +518,8 @@ public UserDataCreateTest() { // リクエストヘッダをセット HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse response = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse response = null; response = rest.post(UrlUtils.userData(cellName, boxName, colName, entityTypeName), body.toJSONString(), requestheaders); @@ -530,7 +530,7 @@ public UserDataCreateTest() { String nameSpace = getNameSpace(entityTypeName); ODataCommon.checkResponseBody(response.bodyAsJson(), null, nameSpace, additional); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } finally { @@ -682,7 +682,7 @@ public UserDataCreateTest() { JSONObject body = new JSONObject(); body.put("__id", userDataId); - int maxPropNum = DcCoreConfig.getMaxPropertyCountInEntityType(); + int maxPropNum = PersoniumUnitConfig.getMaxPropertyCountInEntityType(); for (int i = 0; i < maxPropNum; i++) { body.put("dynamicProperty" + i, "dynamicPropertyValue" + i); } @@ -727,7 +727,7 @@ public UserDataCreateTest() { JSONObject body = new JSONObject(); body.put("__id", userDataId); - int maxPropNum = DcCoreConfig.getMaxPropertyCountInEntityType(); + int maxPropNum = PersoniumUnitConfig.getMaxPropertyCountInEntityType(); for (int i = 0; i < maxPropNum + 1; i++) { body.put("dynamicProperty" + i, "dynamicPropertyValue" + i); } @@ -1339,7 +1339,7 @@ private TResponse createEntityType(String name, String odataName) { .with("boxPath", boxName) .with("odataSvcPath", odataName) .with("accept", MediaType.APPLICATION_JSON) - .with("token", "Bearer " + DcCoreConfig.getMasterToken()) + .with("token", "Bearer " + PersoniumUnitConfig.getMasterToken()) .with("Name", name) .returns() .debug(); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataCreateWithNPLimitTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataCreateWithNPLimitTest.java similarity index 88% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataCreateWithNPLimitTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataCreateWithNPLimitTest.java index 87ca6d0c0..20de26a04 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataCreateWithNPLimitTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataCreateWithNPLimitTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; @@ -34,21 +34,21 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.utils.AssociationEndUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.utils.AssociationEndUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; @@ -56,16 +56,16 @@ * UserDataのNavigationProperty経由登録の上限値テスト. * たくさんデータを登録するので、「Integration.class, Regression.class」では動作しない。 */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class }) public class UserDataCreateWithNPLimitTest extends JerseyTest { private static final Map INIT_PARAMS = new HashMap(); static { - INIT_PARAMS.put("com.sun.jersey.config.property.packages", "com.fujitsu.dc.core.rs"); + INIT_PARAMS.put("com.sun.jersey.config.property.packages", "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } String masterToken = Setup.MASTER_TOKEN_NAME; @@ -86,7 +86,7 @@ public class UserDataCreateWithNPLimitTest extends JerseyTest { String srcId = "id"; // 登録するユーザODataの件数(N:Nの$linksで登録可能な上限値) - int registUserDataCount = DcCoreConfig.getLinksNtoNMaxSize(); + int registUserDataCount = PersoniumUnitConfig.getLinksNtoNMaxSize(); /** * コンストラクタ. @@ -239,8 +239,8 @@ public final void after() { srcEntityTypeName, srcId, targetEntityTypeName, HttpStatus.SC_BAD_REQUEST); // エラーメッセージのチェック - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.LINK_UPPER_LIMIT_RECORD_EXEED.getCode(), - DcCoreException.OData.LINK_UPPER_LIMIT_RECORD_EXEED.getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.LINK_UPPER_LIMIT_RECORD_EXEED.getCode(), + PersoniumCoreException.OData.LINK_UPPER_LIMIT_RECORD_EXEED.getMessage()); // 登録済み件数が増加していないことのチェック String query = String.format("?\\$top=%s&\\$inlinecount=allpages", 0); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataCreateWithNPTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataCreateWithNPTest.java similarity index 95% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataCreateWithNPTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataCreateWithNPTest.java index ad6aae79c..977a91892 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataCreateWithNPTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataCreateWithNPTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; @@ -31,25 +31,25 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AssociationEndUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.UserDataUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AssociationEndUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.UserDataUtils; +import io.personium.test.utils.TResponse; /** * UserDataのNavigationProperty経由登録のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataCreateWithNPTest extends AbstractUserDataTest { @@ -190,7 +190,7 @@ public UserDataCreateWithNPTest() { JSONObject bodyNp = new JSONObject(); bodyNp.put("__id", userDataNpId); - int maxPropNum = DcCoreConfig.getMaxPropertyCountInEntityType(); + int maxPropNum = PersoniumUnitConfig.getMaxPropertyCountInEntityType(); for (int i = 0; i < maxPropNum; i++) { bodyNp.put("dynamicProperty" + i, "dynamicPropertyValue" + i); } @@ -220,7 +220,7 @@ public UserDataCreateWithNPTest() { JSONObject bodyNp = new JSONObject(); bodyNp.put("__id", userDataNpId); - int maxPropNum = DcCoreConfig.getMaxPropertyCountInEntityType(); + int maxPropNum = PersoniumUnitConfig.getMaxPropertyCountInEntityType(); for (int i = 0; i < maxPropNum + 1; i++) { bodyNp.put("dynamicProperty" + i, "dynamicPropertyValue" + i); } @@ -245,7 +245,7 @@ public UserDataCreateWithNPTest() { JSONObject bodyNp = new JSONObject(); bodyNp.put("__id", userDataNpId); - int maxPropNum = DcCoreConfig.getMaxPropertyCountInEntityType(); + int maxPropNum = PersoniumUnitConfig.getMaxPropertyCountInEntityType(); for (int i = 0; i < maxPropNum; i++) { bodyNp.put("dynamicProperty" + i, "dynamicPropertyValue" + i); } @@ -276,7 +276,7 @@ public UserDataCreateWithNPTest() { JSONObject bodyNp = new JSONObject(); bodyNp.put("__id", userDataNpId); - int maxPropNum = DcCoreConfig.getMaxPropertyCountInEntityType(); + int maxPropNum = PersoniumUnitConfig.getMaxPropertyCountInEntityType(); for (int i = 0; i < maxPropNum + 1; i++) { bodyNp.put("dynamicProperty" + i, "dynamicPropertyValue" + i); } @@ -906,7 +906,7 @@ private void CreateUserDataWithNP(int expectedSC, JSONObject bodyNp) { if (expectedSC == HttpStatus.SC_CREATED) { // 登録データを一件取得し、レスポンスヘッダからETAGを取得する TResponse getres = getUserData("testcell1", "box1", "setodata", navPropName, - userDataNpId, DcCoreConfig.getMasterToken(), "", HttpStatus.SC_OK); + userDataNpId, PersoniumUnitConfig.getMasterToken(), "", HttpStatus.SC_OK); String etag = getres.getHeader(HttpHeaders.ETAG); // レスポンスヘッダーのチェック diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataDeclardDoublePropertyTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataDeclardDoublePropertyTest.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataDeclardDoublePropertyTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataDeclardDoublePropertyTest.java index 13fec22ad..b4e78cc21 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataDeclardDoublePropertyTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataDeclardDoublePropertyTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -31,25 +31,25 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DaoException; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.odatacol.schema.property.PropertyUtils; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.DaoException; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.odatacol.schema.property.PropertyUtils; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; /** * UserODataのDouble型静的プロパティ登録のテストクラス. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataDeclardDoublePropertyTest extends AbstractUserDataTest { @@ -76,8 +76,8 @@ public UserDataDeclardDoublePropertyTest() { @Test public final void 数値形式のデータを登録できること() { TResponse createResponse; - DcResponse getResponse; - DcResponse listResponse; + PersoniumResponse getResponse; + PersoniumResponse listResponse; JSONObject createdEntity; JSONObject getEntity; JSONObject listEntity; @@ -181,8 +181,8 @@ public UserDataDeclardDoublePropertyTest() { @Test public final void 小数値データ登録後に整数値データが登録できること() { TResponse createResponse; - DcResponse getResponse; - DcResponse listResponse; + PersoniumResponse getResponse; + PersoniumResponse listResponse; JSONObject createdEntity; JSONObject getEntity; JSONObject listEntity; @@ -240,8 +240,8 @@ public UserDataDeclardDoublePropertyTest() { @Test public final void Double型にNullが登録できること() { TResponse createResponse; - DcResponse getResponse; - DcResponse listResponse; + PersoniumResponse getResponse; + PersoniumResponse listResponse; JSONObject createdEntity; JSONObject getEntity; JSONObject listEntity; @@ -322,8 +322,8 @@ public UserDataDeclardDoublePropertyTest() { @Test public final void Double型に文字列型の数値のデータが登録できること() { TResponse createResponse; - DcResponse getResponse; - DcResponse listResponse; + PersoniumResponse getResponse; + PersoniumResponse listResponse; try { // テスト用エンティティタイプ作成 createEntityType(); @@ -384,8 +384,8 @@ public UserDataDeclardDoublePropertyTest() { */ @Test public final void Double型のデフォルト値がデータ登録時に反映されてデータが登録できること() { - DcResponse getResponse; - DcResponse listResponse; + PersoniumResponse getResponse; + PersoniumResponse listResponse; try { // EntityType登録 EntityTypeUtils.create(CELL_NAME, AbstractCase.MASTER_TOKEN_NAME, @@ -425,8 +425,8 @@ public UserDataDeclardDoublePropertyTest() { */ @Test public final void Double型のデフォルト値が最大値の場合にデフォルト値を反映してデータが登録できること() { - DcResponse getResponse; - DcResponse listResponse; + PersoniumResponse getResponse; + PersoniumResponse listResponse; try { // EntityType登録 EntityTypeUtils.create(CELL_NAME, AbstractCase.MASTER_TOKEN_NAME, @@ -465,8 +465,8 @@ public UserDataDeclardDoublePropertyTest() { */ @Test public final void Double型配列のデータが登録できること() { - DcResponse getResponse; - DcResponse listResponse; + PersoniumResponse getResponse; + PersoniumResponse listResponse; try { // EntityType登録 EntityTypeUtils.create(CELL_NAME, AbstractCase.MASTER_TOKEN_NAME, @@ -537,8 +537,8 @@ public UserDataDeclardDoublePropertyTest() { @SuppressWarnings("unchecked") @Test public final void 数値形式のデータを更新できること() { - DcResponse getResponse; - DcResponse listResponse; + PersoniumResponse getResponse; + PersoniumResponse listResponse; JSONObject getEntity; JSONObject listEntity; try { @@ -629,8 +629,8 @@ public UserDataDeclardDoublePropertyTest() { @SuppressWarnings("unchecked") @Test public final void 数値形式のデータを部分更新できること() { - DcResponse getResponse; - DcResponse listResponse; + PersoniumResponse getResponse; + PersoniumResponse listResponse; JSONObject getEntity; JSONObject listEntity; try { @@ -743,8 +743,8 @@ private TResponse createUserData(String userDataId, String body, int code) { body, CELL_NAME, BOX_NAME, COL_NAME, ENTITYTYPE); } - private DcResponse getUserOData(String userDataId, int code) { - DcResponse response = ODataCommon.getOdataResource( + private PersoniumResponse getUserOData(String userDataId, int code) { + PersoniumResponse response = ODataCommon.getOdataResource( UrlUtils.userdata(CELL_NAME, BOX_NAME, COL_NAME, ENTITYTYPE, userDataId)); if (code != -1) { assertEquals(code, response.getStatusCode()); @@ -752,8 +752,8 @@ private DcResponse getUserOData(String userDataId, int code) { return response; } - private DcResponse getUserODataList() { - DcResponse response = + private PersoniumResponse getUserODataList() { + PersoniumResponse response = ODataCommon.getOdataResource(UrlUtils.userData(CELL_NAME, BOX_NAME, COL_NAME, ENTITYTYPE)); return response; } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataDeclaredDoubleComplexTypePropertyTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataDeclaredDoubleComplexTypePropertyTest.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataDeclaredDoubleComplexTypePropertyTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataDeclaredDoubleComplexTypePropertyTest.java index 9e1119e7a..bcb97499b 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataDeclaredDoubleComplexTypePropertyTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataDeclaredDoubleComplexTypePropertyTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; @@ -35,29 +35,29 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.utils.ODataUtils; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.odatacol.schema.property.PropertyUtils; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.utils.ODataUtils; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.odatacol.schema.property.PropertyUtils; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; /** * UserDataComplexType登録のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataDeclaredDoubleComplexTypePropertyTest extends AbstractUserDataTest { @@ -857,7 +857,7 @@ protected TResponse createEntityType(String name, String odataName) { .with("boxPath", boxName) .with("odataSvcPath", odataName) .with("accept", MediaType.APPLICATION_JSON) - .with("token", "Bearer " + DcCoreConfig.getMasterToken()) + .with("token", "Bearer " + PersoniumUnitConfig.getMasterToken()) .with("Name", name) .returns() .debug(); @@ -871,7 +871,7 @@ protected TResponse createEntityType(String name, String odataName) { protected void createProperty(String type, String defValue) { // リクエストパラメータ設定 String locationUrl = UrlUtils.property(cellName, boxName, COL_NAME, null, null); - DcRequest req = DcRequest.post(locationUrl); + PersoniumRequest req = PersoniumRequest.post(locationUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, PROP_NAME); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, ENTITY_TYPE_NAME); @@ -883,7 +883,7 @@ protected void createProperty(String type, String defValue) { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); @@ -901,7 +901,7 @@ protected void deleteUserData(String userDataId) { .with("collection", COL_NAME) .with("entityType", ENTITY_TYPE_NAME) .with("id", userDataId) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("ifMatch", "*") .returns() .debug(); @@ -923,7 +923,7 @@ protected void deleteProperty() { */ private void createEntities(String type, String defaultcomplexTypeProperty) { // Collection作成 - DavResourceUtils.createODataCollection(DcCoreConfig.getMasterToken(), HttpStatus.SC_CREATED, cellName, boxName, + DavResourceUtils.createODataCollection(PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_CREATED, cellName, boxName, COL_NAME); // EntityType作成 @@ -961,6 +961,6 @@ protected void deleteEntities() { // コレクションを削除 DavResourceUtils.deleteCollection(cellName, boxName, COL_NAME, - DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataDeepComplexTypeTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataDeepComplexTypeTest.java similarity index 95% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataDeepComplexTypeTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataDeepComplexTypeTest.java index b9f3205aa..db34fbcca 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataDeepComplexTypeTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataDeepComplexTypeTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -34,27 +34,27 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.test.CompareJSON; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.utils.AssociationEndUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.UserDataUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.test.CompareJSON; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.setup.Setup; +import io.personium.test.utils.AssociationEndUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.UserDataUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; /** * UserDataComplexType複数階層のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataDeepComplexTypeTest extends JerseyTest { @@ -69,11 +69,11 @@ public class UserDataDeepComplexTypeTest extends JerseyTest { static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataDeleteTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataDeleteTest.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataDeleteTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataDeleteTest.java index b7b09d403..b98e2eebd 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataDeleteTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataDeleteTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; @@ -25,24 +25,24 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * UserData削除のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataDeleteTest extends AbstractUserDataTest { @@ -188,7 +188,7 @@ public UserDataDeleteTest() { .statusCode(HttpStatus.SC_NO_CONTENT); } finally { deleteUserData(cellName, boxName, colName, entityTypeName, userDataId, - DcCoreConfig.getMasterToken(), "*", -1); + PersoniumUnitConfig.getMasterToken(), "*", -1); } } @@ -231,7 +231,7 @@ public UserDataDeleteTest() { // ユーザデータ取得 TResponse getRes = getUserData(cellName, boxName, colName, entityTypeName, userDataId, - DcCoreConfig.getMasterToken(), HttpStatus.SC_OK); + PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_OK); // ボディからEtag取得 JSONObject results = (JSONObject) ((JSONObject) createRes.bodyAsJson().get("d")).get("results"); @@ -500,18 +500,18 @@ public UserDataDeleteTest() { // ユーザデータ削除 String requestURL = UrlUtils.userdata(cellName, boxName, colName, entityTypeName + "(" + userdataKey + ")", null); - DcRequest req = DcRequest.delete(requestURL); + PersoniumRequest req = PersoniumRequest.delete(requestURL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.header(HttpHeaders.IF_MATCH, "*"); // リクエスト実行 - DcResponse res = request(req); + PersoniumResponse res = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); checkErrorResponse(res.bodyAsJson(), - DcCoreException.OData.ENTITY_KEY_PARSE_ERROR.getCode(), - DcCoreException.OData.ENTITY_KEY_PARSE_ERROR.getMessage()); + PersoniumCoreException.OData.ENTITY_KEY_PARSE_ERROR.getCode(), + PersoniumCoreException.OData.ENTITY_KEY_PARSE_ERROR.getMessage()); } finally { deleteUserData(userdataKey); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataDynamicDoublePropertyTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataDynamicDoublePropertyTest.java similarity index 90% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataDynamicDoublePropertyTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataDynamicDoublePropertyTest.java index 19462f952..b8dc8c281 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataDynamicDoublePropertyTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataDynamicDoublePropertyTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -30,24 +30,24 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DaoException; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.DaoException; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; /** * UserODataのDouble型動的プロパティ登録のテストクラス. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataDynamicDoublePropertyTest extends AbstractUserDataTest { @@ -74,8 +74,8 @@ public UserDataDynamicDoublePropertyTest() { @Test public final void 数値形式のデータを登録できること() { TResponse createResponse; - DcResponse getResponse; - DcResponse listResponse; + PersoniumResponse getResponse; + PersoniumResponse listResponse; JSONObject createdEntity; JSONObject getEntity; JSONObject listEntity; @@ -179,8 +179,8 @@ public UserDataDynamicDoublePropertyTest() { @Test public final void 小数値データ登録後に整数値データが登録できること() { TResponse createResponse; - DcResponse getResponse; - DcResponse listResponse; + PersoniumResponse getResponse; + PersoniumResponse listResponse; JSONObject createdEntity; JSONObject getEntity; JSONObject listEntity; @@ -238,8 +238,8 @@ public UserDataDynamicDoublePropertyTest() { @Test public final void Double型にNullが登録できること() { TResponse createResponse; - DcResponse getResponse; - DcResponse listResponse; + PersoniumResponse getResponse; + PersoniumResponse listResponse; JSONObject createdEntity; JSONObject getEntity; JSONObject listEntity; @@ -288,8 +288,8 @@ public UserDataDynamicDoublePropertyTest() { @Test public final void 文字列型にDouble型のデータが文字列として登録できること() { TResponse createResponse; - DcResponse getResponse; - DcResponse listResponse; + PersoniumResponse getResponse; + PersoniumResponse listResponse; try { // テスト用エンティティタイプ作成 createEntityType(); @@ -362,8 +362,8 @@ public UserDataDynamicDoublePropertyTest() { @Test public final void Double型に文字列型の数値のデータが登録できること() { TResponse createResponse; - DcResponse getResponse; - DcResponse listResponse; + PersoniumResponse getResponse; + PersoniumResponse listResponse; try { // テスト用エンティティタイプ作成 createEntityType(); @@ -412,8 +412,8 @@ private TResponse createUserData(String userDataId, String body, int code) { body, CELL_NAME, BOX_NAME, COL_NAME, ENTITYTYPE); } - private DcResponse getUserOData(String userDataId, int code) { - DcResponse response = ODataCommon.getOdataResource( + private PersoniumResponse getUserOData(String userDataId, int code) { + PersoniumResponse response = ODataCommon.getOdataResource( UrlUtils.userdata(CELL_NAME, BOX_NAME, COL_NAME, ENTITYTYPE, userDataId)); if (code != -1) { assertEquals(code, response.getStatusCode()); @@ -421,8 +421,8 @@ private DcResponse getUserOData(String userDataId, int code) { return response; } - private DcResponse getUserODataList() { - DcResponse response = + private PersoniumResponse getUserODataList() { + PersoniumResponse response = ODataCommon.getOdataResource(UrlUtils.userData(CELL_NAME, BOX_NAME, COL_NAME, ENTITYTYPE)); return response; } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataExpandTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataExpandTest.java similarity index 90% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataExpandTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataExpandTest.java index e81db10a9..e829bd6e0 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataExpandTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataExpandTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -31,30 +31,30 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AssociationEndUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AssociationEndUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; import com.sun.jersey.test.framework.WebAppDescriptor; /** * $expandクエリ指定のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataExpandTest extends AbstractUserDataTest { @@ -62,12 +62,12 @@ public class UserDataExpandTest extends AbstractUserDataTest { static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put( "com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } private String toEntityTypeName = "toEntity"; @@ -102,7 +102,7 @@ public UserDataExpandTest() { .with("entityType", navPropName + "('" + fromUserDataId + "')") .with("query", "?\\$expand=" + "_" + toEntityTypeName) .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -149,7 +149,7 @@ public UserDataExpandTest() { .with("entityType", navPropName) .with("query", "?\\$expand=" + "_" + toEntityTypeName) .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -213,7 +213,7 @@ public UserDataExpandTest() { .with("query", "?\\$filter=__id+eq+%27" + fromUserDataId + "%27&\\$expand=" + "_" + toEntityTypeName) .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -267,7 +267,7 @@ public UserDataExpandTest() { TResponse response = Http.request("box/odatacol/list.txt").with("cell", Setup.TEST_CELL1) .with("box", Setup.TEST_BOX1).with("collection", Setup.TEST_ODATA).with("entityType", navPropName) .with("query", "?\\$expand=" + "_" + toEntityTypeName).with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()).returns().statusCode(HttpStatus.SC_OK).debug(); + .with("token", PersoniumUnitConfig.getMasterToken()).returns().statusCode(HttpStatus.SC_OK).debug(); // レスポンスボディーのチェック Map> additional = new HashMap>(); @@ -339,7 +339,7 @@ public UserDataExpandTest() { .with("entityType", navPropName + "('" + fromUserDataId + "')") .with("query", "?\\$expand=") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -378,7 +378,7 @@ public UserDataExpandTest() { .with("entityType", navPropName) .with("query", "?\\$expand=") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -439,7 +439,7 @@ public UserDataExpandTest() { .with("entityType", navPropName + "('" + fromUserDataId + "')") .with("query", "?\\$expand=" + toEntityTypeName) .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -468,7 +468,7 @@ public UserDataExpandTest() { .with("entityType", navPropName) .with("query", "?\\$expand=" + toEntityTypeName) .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -497,7 +497,7 @@ public UserDataExpandTest() { .with("entityType", navPropName + "('" + fromUserDataId + "')") .with("query", "?\\$expand=_") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -526,7 +526,7 @@ public UserDataExpandTest() { .with("entityType", navPropName) .with("query", "?\\$expand=_") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -555,7 +555,7 @@ public UserDataExpandTest() { .with("entityType", navPropName + "('" + fromUserDataId + "')") .with("query", "?\\$expand=_test") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -584,7 +584,7 @@ public UserDataExpandTest() { .with("entityType", navPropName) .with("query", "?\\$expand=_test") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -613,7 +613,7 @@ public UserDataExpandTest() { .with("entityType", navPropName + "('" + fromUserDataId + "')") .with("query", "?\\$expand=" + "_" + toEntityTypeName + ",_test") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -642,7 +642,7 @@ public UserDataExpandTest() { .with("entityType", navPropName) .with("query", "?\\$expand=" + "_" + toEntityTypeName + ",_test") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -663,15 +663,15 @@ public final void createData() { JSONObject linkBody = new JSONObject(); // エンティティタイプを作成 - EntityTypeUtils.create(Setup.TEST_CELL1, DcCoreConfig.getMasterToken(), + EntityTypeUtils.create(Setup.TEST_CELL1, PersoniumUnitConfig.getMasterToken(), Setup.TEST_ODATA, toEntityTypeName, HttpStatus.SC_CREATED); - EntityTypeUtils.create(Setup.TEST_CELL1, DcCoreConfig.getMasterToken(), + EntityTypeUtils.create(Setup.TEST_CELL1, PersoniumUnitConfig.getMasterToken(), Setup.TEST_ODATA, navPropName, HttpStatus.SC_CREATED); // AssociationEndを作成 - AssociationEndUtils.create(DcCoreConfig.getMasterToken(), "*", Setup.TEST_CELL1, + AssociationEndUtils.create(PersoniumUnitConfig.getMasterToken(), "*", Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, HttpStatus.SC_CREATED, "AssociationEnd", toEntityTypeName); - AssociationEndUtils.create(DcCoreConfig.getMasterToken(), "*", Setup.TEST_CELL1, + AssociationEndUtils.create(PersoniumUnitConfig.getMasterToken(), "*", Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, HttpStatus.SC_CREATED, "LinkAssociationEnd", navPropName); // AssociationEndを関連付け @@ -703,7 +703,7 @@ public final void createData() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", toEntityTypeName + "('" + toUserDataId + "')") .with("trgPath", navPropName) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("trgUserdataUrl", targetUri) .returns() .debug() @@ -717,7 +717,7 @@ public final void createData() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", toEntityTypeName + "('" + toUserDataId2 + "')") .with("trgPath", navPropName) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("trgUserdataUrl", targetUri) .returns() .debug() @@ -736,13 +736,13 @@ public final void deleteData() { // ユーザデータを削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - toEntityTypeName, toUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + toEntityTypeName, toUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - navPropName, fromUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + navPropName, fromUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - toEntityTypeName, toUserDataId2, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + toEntityTypeName, toUserDataId2, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - navPropName, fromUserDataId2, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + navPropName, fromUserDataId2, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); // AssociationEndLinkを削除 AssociationEndUtils.deleteLink(Setup.TEST_CELL1, Setup.TEST_ODATA, @@ -756,9 +756,9 @@ public final void deleteData() { Setup.TEST_ODATA, navPropName, Setup.TEST_BOX1, "LinkAssociationEnd", HttpStatus.SC_NO_CONTENT); // エンティティタイプを削除 - EntityTypeUtils.delete(Setup.TEST_ODATA, DcCoreConfig.getMasterToken(), + EntityTypeUtils.delete(Setup.TEST_ODATA, PersoniumUnitConfig.getMasterToken(), "application/json", toEntityTypeName, Setup.TEST_CELL1, HttpStatus.SC_NO_CONTENT); - EntityTypeUtils.delete(Setup.TEST_ODATA, DcCoreConfig.getMasterToken(), + EntityTypeUtils.delete(Setup.TEST_ODATA, PersoniumUnitConfig.getMasterToken(), "application/json", navPropName, Setup.TEST_CELL1, HttpStatus.SC_NO_CONTENT); } @@ -771,7 +771,7 @@ public final void deleteData2() { // ユーザデータを削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, fromEntityTypeName, "noneNP", - DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } @@ -977,8 +977,8 @@ public final void createData2() { TResponse response = listUserODataWithExpand(cellName, boxName, colName, fromEntity, expands, top, HttpStatus.SC_BAD_REQUEST); - ODataCommon.checkErrorResponseBody(response, DcCoreException.OData.EXPAND_COUNT_LIMITATION_EXCEEDED.getCode(), - DcCoreException.OData.EXPAND_COUNT_LIMITATION_EXCEEDED.getMessage()); + ODataCommon.checkErrorResponseBody(response, PersoniumCoreException.OData.EXPAND_COUNT_LIMITATION_EXCEEDED.getCode(), + PersoniumCoreException.OData.EXPAND_COUNT_LIMITATION_EXCEEDED.getMessage()); } @@ -987,7 +987,7 @@ public final void createData2() { */ @Test public final void 一覧取得でexpand指定時にtopに取得件数最大数を指定した場合正常に取得できること() { - final int top = DcCoreConfig.getMaxExpandSizeForList(); + final int top = PersoniumUnitConfig.getMaxExpandSizeForList(); String cellName = Setup.TEST_CELL1; String boxName = Setup.TEST_BOX1; @@ -1007,7 +1007,7 @@ public final void createData2() { */ @Test public final void 一覧取得でexpand指定時にtopに取得件数最大数を超える値を指定した場合400エラーとなること() { - final int top = DcCoreConfig.getMaxExpandSizeForList() + 1; + final int top = PersoniumUnitConfig.getMaxExpandSizeForList() + 1; String cellName = Setup.TEST_CELL1; String boxName = Setup.TEST_BOX1; @@ -1023,8 +1023,8 @@ public final void createData2() { HttpStatus.SC_BAD_REQUEST); ODataCommon.checkErrorResponseBody(response, - DcCoreException.OData.QUERY_INVALID_ERROR.params("$top", String.valueOf(top)).getCode(), - DcCoreException.OData.QUERY_INVALID_ERROR.params("$top", String.valueOf(top)).getMessage()); + PersoniumCoreException.OData.QUERY_INVALID_ERROR.params("$top", String.valueOf(top)).getCode(), + PersoniumCoreException.OData.QUERY_INVALID_ERROR.params("$top", String.valueOf(top)).getMessage()); } @@ -1042,7 +1042,7 @@ public final void createData2() { String userDataId = "userdata000"; - int maxPropertyNum = DcCoreConfig.getExpandPropertyMaxSizeForRetrieve(); + int maxPropertyNum = PersoniumUnitConfig.getExpandPropertyMaxSizeForRetrieve(); try { // 事前準備 @@ -1106,7 +1106,7 @@ public final void createData2() { String userDataId = "userdata000"; - int maxPropertyNum = DcCoreConfig.getExpandPropertyMaxSizeForRetrieve() + 1; + int maxPropertyNum = PersoniumUnitConfig.getExpandPropertyMaxSizeForRetrieve() + 1; try { // 事前準備 @@ -1150,8 +1150,8 @@ public final void createData2() { String expands = expandBuilder.toString(); TResponse res = UserDataUtils.getWithQuery(cellName, MASTER_TOKEN_NAME, boxName, colName, fromEntity, expands, userDataId, HttpStatus.SC_BAD_REQUEST); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.EXPAND_COUNT_LIMITATION_EXCEEDED.getCode(), - DcCoreException.OData.EXPAND_COUNT_LIMITATION_EXCEEDED.getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.EXPAND_COUNT_LIMITATION_EXCEEDED.getCode(), + PersoniumCoreException.OData.EXPAND_COUNT_LIMITATION_EXCEEDED.getMessage()); } finally { Setup.cellBulkDeletion(cellName); @@ -1183,7 +1183,7 @@ private void checkResponseBodyAsExpand(String baseEntityId, final String targetE * @param col コレクション名 */ private void createExpandData(String cell, String box, String col) { - final String token = DcCoreConfig.getMasterToken(); + final String token = PersoniumUnitConfig.getMasterToken(); // 1. 制御オブジェクトの作成 CellUtils.create(cell, token, HttpStatus.SC_CREATED); BoxUtils.create(cell, box, token, HttpStatus.SC_CREATED); @@ -1263,7 +1263,7 @@ private void createExpandData(String cell, String box, String col) { @SuppressWarnings("unchecked") private void createExpandUserODataByNP(String cell, String box, String col, String baseEntity, String id, String navPropName, int records) { - final String token = DcCoreConfig.getMasterToken(); + final String token = PersoniumUnitConfig.getMasterToken(); // 引数で渡された件数分のユーザODataを作成する。 for (int i = 0; i < records; i++) { @@ -1293,7 +1293,7 @@ private TResponse listUserODataWithExpand(String cell, String box, .with("entityType", baseEntity) .with("query", "?\\$expand=" + expands + "&\\$top=" + top + "&\\$orderby=__id") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(status) .debug(); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataFullTextSearchTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataFullTextSearchTest.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataFullTextSearchTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataFullTextSearchTest.java index fbcc3ae94..645c4a4ad 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataFullTextSearchTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataFullTextSearchTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; @@ -27,19 +27,19 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; /** * UserData全文検索のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataFullTextSearchTest extends AbstractUserDataTest { @@ -76,7 +76,7 @@ public UserDataFullTextSearchTest() { body.put("number", 1); this.createUserDataWithDcClient(cellName, boxName, colName, entityTypeName, body); - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, "?q=たま"); // レスポンスボディーのチェック @@ -129,7 +129,7 @@ public UserDataFullTextSearchTest() { body.put("number", 1); this.createUserDataWithDcClient(cellName, boxName, colName, entityTypeName, body); - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, "?q=ぽち"); // レスポンスボディーのチェック @@ -190,7 +190,7 @@ public UserDataFullTextSearchTest() { body.put("number", 1); this.createUserDataWithDcClient(cellName, boxName, colName, entityTypeName, body); - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, "?q=はち"); // レスポンスボディーのチェック @@ -233,7 +233,7 @@ public UserDataFullTextSearchTest() { body.put("number", 1); this.createUserDataWithDcClient(cellName, boxName, colName, entityTypeName, body); - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, "?q=ぽち1号"); // レスポンスボディーのチェック @@ -286,7 +286,7 @@ public UserDataFullTextSearchTest() { body.put("number", 1); this.createUserDataWithDcClient(cellName, boxName, colName, entityTypeName, body); - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, "?q=1号"); // レスポンスボディーのチェック @@ -339,7 +339,7 @@ public UserDataFullTextSearchTest() { body.put("number", 1); this.createUserDataWithDcClient(cellName, boxName, colName, entityTypeName, body); - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, "?q=pochi1st"); // レスポンスボディーのチェック @@ -392,7 +392,7 @@ public UserDataFullTextSearchTest() { body.put("number", 1); this.createUserDataWithDcClient(cellName, boxName, colName, entityTypeName, body); - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, "?q=POCHI"); // レスポンスボディーのチェック @@ -445,7 +445,7 @@ public UserDataFullTextSearchTest() { body.put("number", 1); this.createUserDataWithDcClient(cellName, boxName, colName, entityTypeName, body); - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, "?q=pochi"); // レスポンスボディーのチェック @@ -498,7 +498,7 @@ public UserDataFullTextSearchTest() { body.put("number", 1); this.createUserDataWithDcClient(cellName, boxName, colName, entityTypeName, body); - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, "?q=pochi"); // レスポンスボディーのチェック @@ -541,7 +541,7 @@ public UserDataFullTextSearchTest() { body.put("number", 1); this.createUserDataWithDcClient(cellName, boxName, colName, entityTypeName, body); - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, "?q=pochi%201st"); // レスポンスボディーのチェック @@ -594,7 +594,7 @@ public UserDataFullTextSearchTest() { body.put("number", 1); this.createUserDataWithDcClient(cellName, boxName, colName, entityTypeName, body); - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, "?q=pochi"); // レスポンスボディーのチェック @@ -655,7 +655,7 @@ public UserDataFullTextSearchTest() { body.put("number", 1); this.createUserDataWithDcClient(cellName, boxName, colName, entityTypeName, body); - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, "?q=bone%201st%20pochi"); // レスポンスボディーのチェック @@ -712,7 +712,7 @@ public UserDataFullTextSearchTest() { body.put("number", 1); this.createUserDataWithDcClient(cellName, boxName, colName, entityTypeName, body); - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, "?q=pochi%261st"); // レスポンスボディーのチェック @@ -763,7 +763,7 @@ public UserDataFullTextSearchTest() { body.put("name_ja", "たま ポチ"); this.createUserDataWithDcClient(cellName, boxName, colName, entityTypeName, body); - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, "?q=ポチ%20たま"); // レスポンスボディーのチェック @@ -818,7 +818,7 @@ public UserDataFullTextSearchTest() { body.put("name_ja", "たま ポチ"); this.createUserDataWithDcClient(cellName, boxName, colName, entityTypeName, body); - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, "?q=%22ポチ%20たま%22"); // レスポンスボディーのチェック @@ -875,7 +875,7 @@ public UserDataFullTextSearchTest() { body.put("number", 1); this.createUserDataWithDcClient(cellName, boxName, colName, entityTypeName, body); - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, "?q=pochi%261st"); // レスポンスボディーのチェック @@ -928,7 +928,7 @@ public UserDataFullTextSearchTest() { body.put("number", 1); this.createUserDataWithDcClient(cellName, boxName, colName, entityTypeName, body); - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, "?q=pochi"); // レスポンスボディーのチェック @@ -989,7 +989,7 @@ public UserDataFullTextSearchTest() { body.put("number", 1); this.createUserDataWithDcClient(cellName, boxName, colName, entityTypeName, body); - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, "?q=pochi%201st"); // レスポンスボディーのチェック @@ -1042,7 +1042,7 @@ public UserDataFullTextSearchTest() { body.put("number", 1); this.createUserDataWithDcClient(cellName, boxName, colName, entityTypeName, body); - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, "?q=ぽちichi"); // レスポンスボディーのチェック @@ -1095,12 +1095,12 @@ public UserDataFullTextSearchTest() { body.put("number", 1); this.createUserDataWithDcClient(cellName, boxName, colName, entityTypeName, body); - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, "?q="); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - checkErrorResponse(response.bodyAsJson(), DcCoreException.OData.QUERY_INVALID_ERROR.getCode(), - DcCoreException.OData.QUERY_INVALID_ERROR.params("q", "").getMessage()); + checkErrorResponse(response.bodyAsJson(), PersoniumCoreException.OData.QUERY_INVALID_ERROR.getCode(), + PersoniumCoreException.OData.QUERY_INVALID_ERROR.params("q", "").getMessage()); } finally { // ユーザデータ削除 deleteUserData(userDataId1); @@ -1139,12 +1139,12 @@ public UserDataFullTextSearchTest() { + "12345678901234567890123456789012345678901234567890123456789012345678901234567890" + "1234567890123456"; - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, "?q=" + qValue); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - checkErrorResponse(response.bodyAsJson(), DcCoreException.OData.QUERY_INVALID_ERROR.getCode(), - DcCoreException.OData.QUERY_INVALID_ERROR.params("q", qValue).getMessage()); + checkErrorResponse(response.bodyAsJson(), PersoniumCoreException.OData.QUERY_INVALID_ERROR.getCode(), + PersoniumCoreException.OData.QUERY_INVALID_ERROR.params("q", qValue).getMessage()); } finally { // ユーザデータ削除 deleteUserData(userDataId1); @@ -1183,7 +1183,7 @@ public UserDataFullTextSearchTest() { + "12345678901234567890123456789012345678901234567890123456789012345678901234567890" + "123456789012345"; - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, "?q=" + qValue); // レスポンスボディーのチェック @@ -1231,7 +1231,7 @@ public UserDataFullTextSearchTest() { + "12345678901234567890123456789012345678901234567890123456789012345678901234567890" + "123456789012あ"; - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, "?q=" + qValue); // レスポンスボディーのチェック @@ -1274,7 +1274,7 @@ public UserDataFullTextSearchTest() { body.put("number", 1); this.createUserDataWithDcClient(cellName, boxName, colName, entityTypeName, body); - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, "?q=pochi_1st"); // レスポンスボディーのチェック @@ -1318,7 +1318,7 @@ public UserDataFullTextSearchTest() { this.createUserDataWithDcClient(cellName, boxName, colName, entityTypeName, body); // 半角空白&+\,"'%?;:~!*@$=() のテスト - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, entityTypeName, "?q=pochi%20%26%2B%5C%2C%22%27%25%3F%3B%3A%7E%21%2A%40%24%3D%28%291st"); // レスポンスボディーのチェック diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataGetTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataGetTest.java similarity index 93% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataGetTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataGetTest.java index 21d203c96..6353d1897 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataGetTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataGetTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -33,26 +33,26 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DaoException; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.DaoException; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * UserData取得のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataGetTest extends AbstractUserDataTest { @@ -140,7 +140,7 @@ public UserDataGetTest() { ODataCommon.checkResponseBody(response.bodyAsJson(), null, nameSpace, additional); } finally { deleteUserData(cellName, boxName, linkColName, linkEntityTypeName, - "parent", DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + "parent", PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } // B(0..1) - A(0..1) | B(1) - D(*) @@ -165,7 +165,7 @@ public UserDataGetTest() { ODataCommon.checkResponseBody(response.bodyAsJson(), null, nameSpace, additional); } finally { deleteUserData(cellName, boxName, linkColName, linkEntityTypeName, - "parent", DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + "parent", PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } // C(1) - A(0..1) | C(*) - D(*) @@ -190,7 +190,7 @@ public UserDataGetTest() { ODataCommon.checkResponseBody(response.bodyAsJson(), null, nameSpace, additional); } finally { deleteUserData(cellName, boxName, linkColName, linkEntityTypeName, - "parent", DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + "parent", PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } // D(*) - A(0..1) | D(*) - B(1) | D(*) - C(*) @@ -216,7 +216,7 @@ public UserDataGetTest() { ODataCommon.checkResponseBody(response.bodyAsJson(), null, nameSpace, additional); } finally { deleteUserData(cellName, boxName, linkColName, linkEntityTypeName, - "parent", DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + "parent", PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -891,7 +891,7 @@ public UserDataGetTest() { body.put("complexProperty", complexBody); body.put("dynamicProperty", "dynamicStringProperty"); complexBody.put("complexStringProperty", "complexStringProprty"); - DcResponse createResponse = createUserDataWithDcClient(Setup.TEST_CELL1, Setup.TEST_BOX1, + PersoniumResponse createResponse = createUserDataWithDcClient(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, "selectTestEntity", body); userdataUrl = createResponse.getFirstHeader(HttpHeaders.LOCATION); @@ -937,7 +937,7 @@ public UserDataGetTest() { body.put("complexProperty", complexBody); body.put("dynamicProperty", "dynamicStringProperty"); complexBody.put("complexStringProperty", "complexStringProprty"); - DcResponse createResponse = createUserDataWithDcClient(Setup.TEST_CELL1, Setup.TEST_BOX1, + PersoniumResponse createResponse = createUserDataWithDcClient(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, "selectTestEntity", body); userdataUrl = createResponse.getFirstHeader(HttpHeaders.LOCATION); @@ -984,7 +984,7 @@ public UserDataGetTest() { body.put("complexProperty", complexBody); body.put("dynamicProperty", "dynamicStringProperty"); complexBody.put("complexStringProperty", "complexStringProprty"); - DcResponse createResponse = createUserDataWithDcClient(Setup.TEST_CELL1, Setup.TEST_BOX1, + PersoniumResponse createResponse = createUserDataWithDcClient(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, "selectTestEntity", body); userdataUrl = createResponse.getFirstHeader(HttpHeaders.LOCATION); @@ -1031,7 +1031,7 @@ public UserDataGetTest() { body.put("complexProperty", complexBody); body.put("dynamicProperty", "dynamicStringProperty"); complexBody.put("complexStringProperty", "complexStringProprty"); - DcResponse createResponse = createUserDataWithDcClient(Setup.TEST_CELL1, Setup.TEST_BOX1, + PersoniumResponse createResponse = createUserDataWithDcClient(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, "selectTestEntity", body); userdataUrl = createResponse.getFirstHeader(HttpHeaders.LOCATION); @@ -1078,7 +1078,7 @@ public UserDataGetTest() { body.put("complexProperty", complexBody); body.put("dynamicProperty", "dynamicStringProperty"); complexBody.put("complexStringProperty", "complexStringProprty"); - DcResponse createResponse = createUserDataWithDcClient(Setup.TEST_CELL1, Setup.TEST_BOX1, + PersoniumResponse createResponse = createUserDataWithDcClient(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, "selectTestEntity", body); userdataUrl = createResponse.getFirstHeader(HttpHeaders.LOCATION); @@ -1125,7 +1125,7 @@ public UserDataGetTest() { body.put("complexProperty", complexBody); body.put("dynamicProperty", "dynamicStringProperty"); complexBody.put("complexStringProperty", "complexStringProprty"); - DcResponse createResponse = createUserDataWithDcClient(Setup.TEST_CELL1, Setup.TEST_BOX1, + PersoniumResponse createResponse = createUserDataWithDcClient(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, "selectTestEntity", body); userdataUrl = createResponse.getFirstHeader(HttpHeaders.LOCATION); @@ -1171,10 +1171,10 @@ public UserDataGetTest() { // ユーザデータの一件取得 String url = String.format("%s/%s/%s/%s/%s('%s')", UrlUtils.getBaseUrl(), cellName, boxName, colName, entityTypeName, userDataId); - DcRequest request = DcRequest.get(url); + PersoniumRequest request = PersoniumRequest.get(url); request.header("Accept", "application/json"); request.header("Authorization", "Bearer " + AbstractCase.MASTER_TOKEN_NAME); - DcResponse dres = ODataCommon.request(request); + PersoniumResponse dres = ODataCommon.request(request); assertEquals(dres.getStatusCode(), HttpStatus.SC_OK); // レスポンスボディーのチェック @@ -1206,10 +1206,10 @@ public UserDataGetTest() { // ユーザデータの一覧取得 String url = String.format("%s/%s/%s/%s/%s", UrlUtils.getBaseUrl(), cellName, boxName, colName, entityTypeName); - DcRequest request = DcRequest.get(url); + PersoniumRequest request = PersoniumRequest.get(url); request.header("Accept", "application/json"); request.header("Authorization", "Bearer " + AbstractCase.MASTER_TOKEN_NAME); - DcResponse dres = ODataCommon.request(request); + PersoniumResponse dres = ODataCommon.request(request); assertEquals(dres.getStatusCode(), HttpStatus.SC_OK); // レスポンスボディーのチェック @@ -1236,18 +1236,18 @@ public UserDataGetTest() { // ユーザデータ更新 String requestURL = UrlUtils.userdata(cellName, boxName, colName, entityTypeName + "(" + userdataKey + ")", null); - DcRequest req = DcRequest.get(requestURL); + PersoniumRequest req = PersoniumRequest.get(requestURL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.header(HttpHeaders.IF_MATCH, "*"); // リクエスト実行 - DcResponse res = request(req); + PersoniumResponse res = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); checkErrorResponse(res.bodyAsJson(), - DcCoreException.OData.ENTITY_KEY_PARSE_ERROR.getCode(), - DcCoreException.OData.ENTITY_KEY_PARSE_ERROR.getMessage()); + PersoniumCoreException.OData.ENTITY_KEY_PARSE_ERROR.getCode(), + PersoniumCoreException.OData.ENTITY_KEY_PARSE_ERROR.getMessage()); } finally { deleteUserData(userdataKey); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataLinkDeleteTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataLinkDeleteTest.java similarity index 96% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataLinkDeleteTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataLinkDeleteTest.java index a7f72f6b6..3549ee77d 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataLinkDeleteTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataLinkDeleteTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -35,24 +35,24 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmMultiplicity; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AssociationEndUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AssociationEndUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.UserDataUtils; /** * $expandクエリ指定のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataLinkDeleteTest extends AbstractUserDataTest { @@ -492,7 +492,7 @@ public UserDataLinkDeleteTest() { private void verifyUserDataLinkRemoval(final String cell, final String box, final String col, final String srcUserDataId, final String tgtUserDataId) { // ユーザデータ間の$linksが削除されたことをNP経由のユーザデータ一覧取得で確認する - DcResponse res = ODataCommon.getOdataResource( + PersoniumResponse res = ODataCommon.getOdataResource( UrlUtils.userdataNP(cell, box, col, "srcEntity", srcUserDataId, "tgtEntity")); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); JSONArray array = (JSONArray) ((JSONObject) res.bodyAsJson().get("d")).get("results"); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataLinkPropertyTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataLinkPropertyTest.java similarity index 95% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataLinkPropertyTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataLinkPropertyTest.java index 98bcdf295..d50d1410e 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataLinkPropertyTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataLinkPropertyTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.fail; @@ -30,26 +30,26 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AssociationEndUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AssociationEndUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; import com.sun.jersey.test.framework.WebAppDescriptor; /** * Propertyを定義したユーザデータの$link取得のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataLinkPropertyTest extends AbstractUserDataTest { @@ -58,11 +58,11 @@ public class UserDataLinkPropertyTest extends AbstractUserDataTest { private static final Map INIT_PARAMS = new HashMap(); static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } private static final String CELL = "UserDataLinkPropertyTest" + "_cell"; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataLinkQueryTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataLinkQueryTest.java similarity index 83% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataLinkQueryTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataLinkQueryTest.java index a1cc82668..5952d0977 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataLinkQueryTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataLinkQueryTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; @@ -27,30 +27,30 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AssociationEndUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AssociationEndUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * $expandクエリ指定のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataLinkQueryTest extends AbstractUserDataTest { - int topMaxNum = DcCoreConfig.getTopQueryMaxSize(); - int skipMaxNum = DcCoreConfig.getSkipQueryMaxSize(); + int topMaxNum = PersoniumUnitConfig.getTopQueryMaxSize(); + int skipMaxNum = PersoniumUnitConfig.getSkipQueryMaxSize(); private String toEntityTypeName = "toEntity"; private String fromEntityTypeName = "fromEntity"; @@ -79,14 +79,14 @@ public UserDataLinkQueryTest() { .with("srcPath", "SalesDetail('userdata000')") .with("trgPath", "test") .with("query", "?\\$top=-1") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.QUERY_INVALID_ERROR.getCode(), - DcCoreException.OData.QUERY_INVALID_ERROR.params("$top", "-1").getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.QUERY_INVALID_ERROR.getCode(), + PersoniumCoreException.OData.QUERY_INVALID_ERROR.params("$top", "-1").getMessage()); } /** @@ -116,7 +116,7 @@ public UserDataLinkQueryTest() { .with("srcPath", "Product" + "('" + fromUserDataId + "')") .with("trgPath", "Sales") .with("query", "?\\$top=0") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -129,10 +129,10 @@ public UserDataLinkQueryTest() { deleteUserDataLinks("Sales", toUserDataId, "Product", fromUserDataId); // fromのユーザデータを削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - "Product", fromUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + "Product", fromUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); // toのユーザデータを削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - "Sales", toUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + "Sales", toUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -164,7 +164,7 @@ public UserDataLinkQueryTest() { .with("srcPath", "Product" + "('" + fromUserDataId + "')") .with("trgPath", "Sales") .with("query", "?\\$top=" + top) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -177,10 +177,10 @@ public UserDataLinkQueryTest() { deleteUserDataLinks("Sales", toUserDataId, "Product", fromUserDataId); // fromのユーザデータを削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - "Product", fromUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + "Product", fromUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); // toのユーザデータを削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - "Sales", toUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + "Sales", toUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -211,7 +211,7 @@ public UserDataLinkQueryTest() { .with("srcPath", "Sales" + "('" + fromUserDataId + "')") .with("trgPath", "SalesDetail") .with("query", "?\\$top=0") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -224,10 +224,10 @@ public UserDataLinkQueryTest() { deleteUserDataLinks("SalesDetail", toUserDataId, "Sales", fromUserDataId); // fromのユーザデータを削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - "Sales", fromUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + "Sales", fromUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); // toのユーザデータを削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - "SalesDetail", toUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + "SalesDetail", toUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -259,7 +259,7 @@ public UserDataLinkQueryTest() { .with("srcPath", "Sales" + "('" + fromUserDataId + "')") .with("trgPath", "SalesDetail") .with("query", "?\\$top=" + top) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -272,10 +272,10 @@ public UserDataLinkQueryTest() { deleteUserDataLinks("SalesDetail", toUserDataId, "Sales", fromUserDataId); // fromのユーザデータを削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - "Sales", fromUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + "Sales", fromUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); // toのユーザデータを削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - "SalesDetail", toUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + "SalesDetail", toUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -293,14 +293,14 @@ public UserDataLinkQueryTest() { .with("srcPath", "SalesDetail('userdata000')") .with("trgPath", "test") .with("query", "?\\$top=" + top) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.QUERY_INVALID_ERROR.getCode(), - DcCoreException.OData.QUERY_INVALID_ERROR.params("$top", top).getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.QUERY_INVALID_ERROR.getCode(), + PersoniumCoreException.OData.QUERY_INVALID_ERROR.params("$top", top).getMessage()); } /** @@ -316,14 +316,14 @@ public UserDataLinkQueryTest() { .with("srcPath", "SalesDetail('userdata000')") .with("trgPath", "test") .with("query", "?\\$top=%27test%27") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.getCode(), - DcCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.params("$top").getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.getCode(), + PersoniumCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.params("$top").getMessage()); } /** @@ -339,14 +339,14 @@ public UserDataLinkQueryTest() { .with("srcPath", "SalesDetail('userdata000')") .with("trgPath", "test") .with("query", "?\\$top=") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.getCode(), - DcCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.params("$top").getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.getCode(), + PersoniumCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.params("$top").getMessage()); } /** @@ -362,14 +362,14 @@ public UserDataLinkQueryTest() { .with("srcPath", "SalesDetail('userdata000')") .with("trgPath", "test") .with("query", "?\\$skip=-1") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.QUERY_INVALID_ERROR.getCode(), - DcCoreException.OData.QUERY_INVALID_ERROR.params("$skip", "-1").getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.QUERY_INVALID_ERROR.getCode(), + PersoniumCoreException.OData.QUERY_INVALID_ERROR.params("$skip", "-1").getMessage()); } /** @@ -399,7 +399,7 @@ public UserDataLinkQueryTest() { .with("srcPath", "Product" + "('" + fromUserDataId + "')") .with("trgPath", "Sales") .with("query", "?\\$skip=0") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -412,10 +412,10 @@ public UserDataLinkQueryTest() { deleteUserDataLinks("Sales", toUserDataId, "Product", fromUserDataId); // fromのユーザデータを削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - "Product", fromUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + "Product", fromUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); // toのユーザデータを削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - "Sales", toUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + "Sales", toUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -447,7 +447,7 @@ public UserDataLinkQueryTest() { .with("srcPath", "Product" + "('" + fromUserDataId + "')") .with("trgPath", "Sales") .with("query", "?\\$skip=" + skip) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -460,10 +460,10 @@ public UserDataLinkQueryTest() { deleteUserDataLinks("Sales", toUserDataId, "Product", fromUserDataId); // fromのユーザデータを削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - "Product", fromUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + "Product", fromUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); // toのユーザデータを削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - "Sales", toUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + "Sales", toUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -494,7 +494,7 @@ public UserDataLinkQueryTest() { .with("srcPath", "Sales" + "('" + fromUserDataId + "')") .with("trgPath", "SalesDetail") .with("query", "?\\$skip=0") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -507,10 +507,10 @@ public UserDataLinkQueryTest() { deleteUserDataLinks("SalesDetail", toUserDataId, "Sales", fromUserDataId); // fromのユーザデータを削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - "Sales", fromUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + "Sales", fromUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); // toのユーザデータを削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - "SalesDetail", toUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + "SalesDetail", toUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -542,7 +542,7 @@ public UserDataLinkQueryTest() { .with("srcPath", "Sales" + "('" + fromUserDataId + "')") .with("trgPath", "SalesDetail") .with("query", "?\\$skip=" + skip) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -555,10 +555,10 @@ public UserDataLinkQueryTest() { deleteUserDataLinks("SalesDetail", toUserDataId, "Sales", fromUserDataId); // fromのユーザデータを削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - "Sales", fromUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + "Sales", fromUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); // toのユーザデータを削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - "SalesDetail", toUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + "SalesDetail", toUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -576,14 +576,14 @@ public UserDataLinkQueryTest() { .with("srcPath", "SalesDetail('userdata000')") .with("trgPath", "test") .with("query", "?\\$skip=" + skip) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.QUERY_INVALID_ERROR.getCode(), - DcCoreException.OData.QUERY_INVALID_ERROR.params("$skip", skip).getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.QUERY_INVALID_ERROR.getCode(), + PersoniumCoreException.OData.QUERY_INVALID_ERROR.params("$skip", skip).getMessage()); } /** @@ -599,14 +599,14 @@ public UserDataLinkQueryTest() { .with("srcPath", "SalesDetail('userdata000')") .with("trgPath", "test") .with("query", "?\\$skip=%27test%27") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.getCode(), - DcCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.params("$skip").getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.getCode(), + PersoniumCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.params("$skip").getMessage()); } /** @@ -622,14 +622,14 @@ public UserDataLinkQueryTest() { .with("srcPath", "SalesDetail('userdata000')") .with("trgPath", "test") .with("query", "?\\$skip=") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.getCode(), - DcCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.params("$skip").getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.getCode(), + PersoniumCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.params("$skip").getMessage()); } /** @@ -642,15 +642,15 @@ public final void createData() { JSONObject linkBody = new JSONObject(); // エンティティタイプを作成 - EntityTypeUtils.create(Setup.TEST_CELL1, DcCoreConfig.getMasterToken(), + EntityTypeUtils.create(Setup.TEST_CELL1, PersoniumUnitConfig.getMasterToken(), Setup.TEST_ODATA, toEntityTypeName, HttpStatus.SC_CREATED); - EntityTypeUtils.create(Setup.TEST_CELL1, DcCoreConfig.getMasterToken(), + EntityTypeUtils.create(Setup.TEST_CELL1, PersoniumUnitConfig.getMasterToken(), Setup.TEST_ODATA, navPropName, HttpStatus.SC_CREATED); // AssociationEndを作成 - AssociationEndUtils.create(DcCoreConfig.getMasterToken(), "*", Setup.TEST_CELL1, + AssociationEndUtils.create(PersoniumUnitConfig.getMasterToken(), "*", Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, HttpStatus.SC_CREATED, "AssociationEnd", toEntityTypeName); - AssociationEndUtils.create(DcCoreConfig.getMasterToken(), "*", Setup.TEST_CELL1, + AssociationEndUtils.create(PersoniumUnitConfig.getMasterToken(), "*", Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, HttpStatus.SC_CREATED, "LinkAssociationEnd", navPropName); // AssociationEndを関連付け @@ -682,7 +682,7 @@ public final void createData() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", toEntityTypeName + "('" + toUserDataId + "')") .with("trgPath", navPropName) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("trgUserdataUrl", targetUri) .returns() .debug() @@ -696,7 +696,7 @@ public final void createData() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", toEntityTypeName + "('" + toUserDataId2 + "')") .with("trgPath", navPropName) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("trgUserdataUrl", targetUri) .returns() .debug() @@ -716,7 +716,7 @@ private void linkUserData(String toEntity, String toUserId, .with("colPath", Setup.TEST_ODATA) .with("srcPath", toEntity + "('" + toUserDataId + "')") .with("trgPath", fromEntity) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("trgUserdataUrl", targetUri) .returns() .debug() @@ -735,7 +735,7 @@ private void deleteUserDataLinks(String srcEntityTypeName, String userDataId, St .with("navProp", "_" + trgEntityTypeName) .with("navKey", navPropId) .with("contentType", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("ifMatch", "*") .returns(); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataLinkTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataLinkTest.java similarity index 87% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataLinkTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataLinkTest.java index 70245490d..c7bc89029 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataLinkTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataLinkTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import java.util.ArrayList; @@ -26,25 +26,25 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AssociationEndUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AssociationEndUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.TResponse; /** * $expandクエリ指定のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataLinkTest extends AbstractUserDataTest { @@ -104,7 +104,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", srcEntityType + "('" + srcUserDataId + "')") .with("trgPath", targetEntityType) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -120,11 +120,11 @@ public UserDataLinkTest() { ResourceUtils.deleteUserDataLinks(srcUserDataId, targetUserDataId, targetEntityType, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, srcEntityType, -1); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId + 1, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId + 1, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - srcEntityType, srcUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + srcEntityType, srcUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -170,7 +170,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", srcEntityType + "('" + srcUserDataId + "')") .with("trgPath", targetEntityType) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -186,11 +186,11 @@ public UserDataLinkTest() { ResourceUtils.deleteUserDataLinks(srcUserDataId, targetUserDataId, targetEntityType, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, srcEntityType, -1); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId + 1, DcCoreConfig.getMasterToken(), -1); + targetEntityType, targetUserDataId + 1, PersoniumUnitConfig.getMasterToken(), -1); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), -1); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), -1); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - srcEntityType, srcUserDataId, DcCoreConfig.getMasterToken(), -1); + srcEntityType, srcUserDataId, PersoniumUnitConfig.getMasterToken(), -1); } } @@ -236,7 +236,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", srcEntityType + "('" + srcUserDataId + "')") .with("trgPath", targetEntityType) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -256,11 +256,11 @@ public UserDataLinkTest() { ResourceUtils.deleteUserDataLinks(srcUserDataId, targetUserDataId + 1, targetEntityType, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, srcEntityType, -1); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId + 1, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId + 1, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - srcEntityType, srcUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + srcEntityType, srcUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -306,7 +306,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", srcEntityType + "('" + srcUserDataId + "')") .with("trgPath", targetEntityType) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -322,11 +322,11 @@ public UserDataLinkTest() { ResourceUtils.deleteUserDataLinks(srcUserDataId, targetUserDataId, targetEntityType, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, srcEntityType, -1); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId + 1, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId + 1, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - srcEntityType, srcUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + srcEntityType, srcUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -372,7 +372,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", srcEntityType + "('" + srcUserDataId + "')") .with("trgPath", targetEntityType) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -392,11 +392,11 @@ public UserDataLinkTest() { ResourceUtils.deleteUserDataLinks(srcUserDataId, targetUserDataId + 1, targetEntityType, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, srcEntityType, -1); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId + 1, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId + 1, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - srcEntityType, srcUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + srcEntityType, srcUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -442,7 +442,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", srcEntityType + "('" + srcUserDataId + "')") .with("trgPath", targetEntityType) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -458,11 +458,11 @@ public UserDataLinkTest() { ResourceUtils.deleteUserDataLinks(srcUserDataId, targetUserDataId, targetEntityType, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, srcEntityType, -1); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId + 1, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId + 1, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - srcEntityType, srcUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + srcEntityType, srcUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -508,7 +508,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", srcEntityType + "('" + srcUserDataId + "')") .with("trgPath", targetEntityType) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -524,11 +524,11 @@ public UserDataLinkTest() { ResourceUtils.deleteUserDataLinks(srcUserDataId, targetUserDataId, targetEntityType, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, srcEntityType, -1); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - srcEntityType, srcUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + srcEntityType, srcUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId + 1, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId + 1, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -574,7 +574,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", srcEntityType + "('" + srcUserDataId + "')") .with("trgPath", targetEntityType) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -594,11 +594,11 @@ public UserDataLinkTest() { ResourceUtils.deleteUserDataLinks(srcUserDataId, targetUserDataId + 1, targetEntityType, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, srcEntityType, -1); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - srcEntityType, srcUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + srcEntityType, srcUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId + 1, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId + 1, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -639,7 +639,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", srcEntityType + "('" + srcUserDataId + "')") .with("trgPath", targetEntityType) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -652,10 +652,10 @@ public UserDataLinkTest() { ResourceUtils.deleteUserDataLinks(srcUserDataId, targetUserDataId, targetEntityType, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, srcEntityType, HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - srcEntityType, srcUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + srcEntityType, srcUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -696,7 +696,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", srcEntityType + "('" + srcUserDataId + "')") .with("trgPath", targetEntityType) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -709,10 +709,10 @@ public UserDataLinkTest() { ResourceUtils.deleteUserDataLinks(srcUserDataId, targetUserDataId, targetEntityType, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, srcEntityType, HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - srcEntityType, srcUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + srcEntityType, srcUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -753,7 +753,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", srcEntityType + "('" + srcUserDataId + "')") .with("trgPath", targetEntityType) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -766,10 +766,10 @@ public UserDataLinkTest() { ResourceUtils.deleteUserDataLinks(srcUserDataId, targetUserDataId, targetEntityType, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, srcEntityType, HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - srcEntityType, srcUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + srcEntityType, srcUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -808,7 +808,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", srcEntityType + "('" + srcUserDataId + "')") .with("trgPath", targetEntityType) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -820,9 +820,9 @@ public UserDataLinkTest() { } finally { deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - srcEntityType, srcUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + srcEntityType, srcUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -861,7 +861,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", srcEntityType + "('" + srcUserDataId + "')") .with("trgPath", targetEntityType) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -873,9 +873,9 @@ public UserDataLinkTest() { } finally { deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - srcEntityType, srcUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + srcEntityType, srcUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -914,7 +914,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", srcEntityType + "('" + srcUserDataId + "')") .with("trgPath", targetEntityType) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -926,9 +926,9 @@ public UserDataLinkTest() { } finally { deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - srcEntityType, srcUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + srcEntityType, srcUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -967,7 +967,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", srcEntityType + "('" + srcUserDataId + "')") .with("trgPath", targetEntityType) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -979,9 +979,9 @@ public UserDataLinkTest() { } finally { deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - srcEntityType, srcUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + srcEntityType, srcUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -1020,7 +1020,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", srcEntityType + "('" + srcUserDataId + "')") .with("trgPath", targetEntityType) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -1032,9 +1032,9 @@ public UserDataLinkTest() { } finally { deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - srcEntityType, srcUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + srcEntityType, srcUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -1073,7 +1073,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", srcEntityType + "('" + srcUserDataId + "')") .with("trgPath", targetEntityType) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -1085,9 +1085,9 @@ public UserDataLinkTest() { } finally { deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - srcEntityType, srcUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + srcEntityType, srcUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -1126,7 +1126,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", srcEntityType + "('" + srcUserDataId + "')") .with("trgPath", targetEntityType) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -1138,9 +1138,9 @@ public UserDataLinkTest() { } finally { deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - srcEntityType, srcUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + srcEntityType, srcUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -1179,7 +1179,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", srcEntityType + "('" + srcUserDataId + "')") .with("trgPath", targetEntityType) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -1191,9 +1191,9 @@ public UserDataLinkTest() { } finally { deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - srcEntityType, srcUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + srcEntityType, srcUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -1223,7 +1223,7 @@ public UserDataLinkTest() { // $links先のユーザデータ削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); // $links一覧取得 TResponse resList = Http.request("box/odatacol/list-link.txt") @@ -1232,7 +1232,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", srcEntityType + "('" + srcUserDataId + "')") .with("trgPath", targetEntityType) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -1243,7 +1243,7 @@ public UserDataLinkTest() { ODataCommon.checkLinResponseBody(resList.bodyAsJson(), expectedUriList); } finally { deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - srcEntityType, srcUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + srcEntityType, srcUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -1273,7 +1273,7 @@ public UserDataLinkTest() { // $links先のユーザデータ削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); // $links一覧取得 TResponse resList = Http.request("box/odatacol/list-link.txt") @@ -1282,7 +1282,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", srcEntityType + "('" + srcUserDataId + "')") .with("trgPath", targetEntityType) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -1293,7 +1293,7 @@ public UserDataLinkTest() { ODataCommon.checkLinResponseBody(resList.bodyAsJson(), expectedUriList); } finally { deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - srcEntityType, srcUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + srcEntityType, srcUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -1323,7 +1323,7 @@ public UserDataLinkTest() { // $links先のユーザデータ削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); // $links一覧取得 TResponse resList = Http.request("box/odatacol/list-link.txt") @@ -1332,7 +1332,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", srcEntityType + "('" + srcUserDataId + "')") .with("trgPath", targetEntityType) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -1343,7 +1343,7 @@ public UserDataLinkTest() { ODataCommon.checkLinResponseBody(resList.bodyAsJson(), expectedUriList); } finally { deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - srcEntityType, srcUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + srcEntityType, srcUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -1373,7 +1373,7 @@ public UserDataLinkTest() { // $links先のユーザデータ削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); // $links一覧取得 TResponse resList = Http.request("box/odatacol/list-link.txt") @@ -1382,7 +1382,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", srcEntityType + "('" + srcUserDataId + "')") .with("trgPath", targetEntityType) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -1393,7 +1393,7 @@ public UserDataLinkTest() { ODataCommon.checkLinResponseBody(resList.bodyAsJson(), expectedUriList); } finally { deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - srcEntityType, srcUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + srcEntityType, srcUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -1423,7 +1423,7 @@ public UserDataLinkTest() { // $links先のユーザデータ削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); // $links一覧取得 TResponse resList = Http.request("box/odatacol/list-link.txt") @@ -1432,7 +1432,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", srcEntityType + "('" + srcUserDataId + "')") .with("trgPath", targetEntityType) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -1442,7 +1442,7 @@ public UserDataLinkTest() { ODataCommon.checkLinResponseBody(resList.bodyAsJson(), expectedUriList); } finally { deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - srcEntityType, srcUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + srcEntityType, srcUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -1472,7 +1472,7 @@ public UserDataLinkTest() { // $links先のユーザデータ削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_CONFLICT); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_CONFLICT); // $links一覧取得 TResponse resList = Http.request("box/odatacol/list-link.txt") @@ -1481,7 +1481,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", srcEntityType + "('" + srcUserDataId + "')") .with("trgPath", targetEntityType) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -1495,9 +1495,9 @@ public UserDataLinkTest() { ResourceUtils.deleteUserDataLinks(srcUserDataId, targetUserDataId, targetEntityType, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, srcEntityType, -1); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - srcEntityType, srcUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + srcEntityType, srcUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -1527,7 +1527,7 @@ public UserDataLinkTest() { // $links先のユーザデータ削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_CONFLICT); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_CONFLICT); // $links一覧取得 TResponse resList = Http.request("box/odatacol/list-link.txt") @@ -1536,7 +1536,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", srcEntityType + "('" + srcUserDataId + "')") .with("trgPath", targetEntityType) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -1550,9 +1550,9 @@ public UserDataLinkTest() { ResourceUtils.deleteUserDataLinks(srcUserDataId, targetUserDataId, targetEntityType, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, srcEntityType, -1); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - srcEntityType, srcUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + srcEntityType, srcUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -1582,7 +1582,7 @@ public UserDataLinkTest() { // $links先のユーザデータ削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_CONFLICT); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_CONFLICT); // $links一覧取得 TResponse resList = Http.request("box/odatacol/list-link.txt") @@ -1591,7 +1591,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", srcEntityType + "('" + srcUserDataId + "')") .with("trgPath", targetEntityType) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -1605,9 +1605,9 @@ public UserDataLinkTest() { ResourceUtils.deleteUserDataLinks(srcUserDataId, targetUserDataId, targetEntityType, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, srcEntityType, -1); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - srcEntityType, srcUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + srcEntityType, srcUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - targetEntityType, targetUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + targetEntityType, targetUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -1637,7 +1637,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", "Sales" + "('" + toUserDataId + "')") .with("trgPath", "SalesDetail") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -1654,10 +1654,10 @@ public UserDataLinkTest() { deleteUserDataLinks("Sales", toUserDataId, "SalesDetail", fromUserDataId); // fromのユーザデータを削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - "SalesDetail", fromUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + "SalesDetail", fromUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); // toのユーザデータを削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - "Sales", toUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + "Sales", toUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -1678,7 +1678,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", toEntityTypeName + "('" + toUserDataId + "')") .with("trgPath", navPropName) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -1722,7 +1722,7 @@ public UserDataLinkTest() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", "SalesDetail" + "('" + fromUserDataId + "')") .with("trgPath", "Sales") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -1739,10 +1739,10 @@ public UserDataLinkTest() { deleteUserDataLinks("Sales", toUserDataId, "SalesDetail", fromUserDataId); // fromのユーザデータを削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - "SalesDetail", fromUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + "SalesDetail", fromUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); // toのユーザデータを削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - "Sales", toUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + "Sales", toUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -1756,15 +1756,15 @@ public final void createData() { JSONObject linkBody = new JSONObject(); // エンティティタイプを作成 - EntityTypeUtils.create(Setup.TEST_CELL1, DcCoreConfig.getMasterToken(), + EntityTypeUtils.create(Setup.TEST_CELL1, PersoniumUnitConfig.getMasterToken(), Setup.TEST_ODATA, toEntityTypeName, HttpStatus.SC_CREATED); - EntityTypeUtils.create(Setup.TEST_CELL1, DcCoreConfig.getMasterToken(), + EntityTypeUtils.create(Setup.TEST_CELL1, PersoniumUnitConfig.getMasterToken(), Setup.TEST_ODATA, navPropName, HttpStatus.SC_CREATED); // AssociationEndを作成 - AssociationEndUtils.create(DcCoreConfig.getMasterToken(), "*", Setup.TEST_CELL1, + AssociationEndUtils.create(PersoniumUnitConfig.getMasterToken(), "*", Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, HttpStatus.SC_CREATED, "AssociationEnd", toEntityTypeName); - AssociationEndUtils.create(DcCoreConfig.getMasterToken(), "*", Setup.TEST_CELL1, + AssociationEndUtils.create(PersoniumUnitConfig.getMasterToken(), "*", Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, HttpStatus.SC_CREATED, "LinkAssociationEnd", navPropName); // AssociationEndを関連付け @@ -1796,7 +1796,7 @@ public final void createData() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", toEntityTypeName + "('" + toUserDataId + "')") .with("trgPath", navPropName) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("trgUserdataUrl", targetUri) .returns() .debug() @@ -1810,7 +1810,7 @@ public final void createData() { .with("colPath", Setup.TEST_ODATA) .with("srcPath", toEntityTypeName + "('" + toUserDataId2 + "')") .with("trgPath", navPropName) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("trgUserdataUrl", targetUri) .returns() .debug() @@ -1829,7 +1829,7 @@ private void linkUserData(String toEntity, String toUserId, .with("colPath", Setup.TEST_ODATA) .with("srcPath", toEntity + "('" + toUserDataId + "')") .with("trgPath", fromEntity) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("trgUserdataUrl", targetUri) .returns() .debug() @@ -1848,13 +1848,13 @@ private void deleteData() { // ユーザデータを削除 deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - toEntityTypeName, toUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + toEntityTypeName, toUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - navPropName, fromUserDataId, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + navPropName, fromUserDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - toEntityTypeName, toUserDataId2, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + toEntityTypeName, toUserDataId2, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, - navPropName, fromUserDataId2, DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + navPropName, fromUserDataId2, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); // AssociationEndLinkを削除 AssociationEndUtils.deleteLink(Setup.TEST_CELL1, Setup.TEST_ODATA, @@ -1868,9 +1868,9 @@ private void deleteData() { Setup.TEST_ODATA, navPropName, Setup.TEST_BOX1, "LinkAssociationEnd", HttpStatus.SC_NO_CONTENT); // エンティティタイプを削除 - EntityTypeUtils.delete(Setup.TEST_ODATA, DcCoreConfig.getMasterToken(), + EntityTypeUtils.delete(Setup.TEST_ODATA, PersoniumUnitConfig.getMasterToken(), "application/json", toEntityTypeName, Setup.TEST_CELL1, HttpStatus.SC_NO_CONTENT); - EntityTypeUtils.delete(Setup.TEST_ODATA, DcCoreConfig.getMasterToken(), + EntityTypeUtils.delete(Setup.TEST_ODATA, PersoniumUnitConfig.getMasterToken(), "application/json", navPropName, Setup.TEST_CELL1, HttpStatus.SC_NO_CONTENT); } @@ -1886,7 +1886,7 @@ private void deleteUserDataLinks(String srcEntityTypeName, String userDataId, St .with("navProp", "_" + trgEntityTypeName) .with("navKey", navPropId) .with("contentType", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("ifMatch", "*") .returns(); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataLinkTopSkipTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataLinkTopSkipTest.java similarity index 87% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataLinkTopSkipTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataLinkTopSkipTest.java index 64b9000f4..c11d6aef3 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataLinkTopSkipTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataLinkTopSkipTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; @@ -33,39 +33,39 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AssociationEndUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AssociationEndUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; /** * ユーザODataの$links取得で、$top・$skipクエリを指定した場合のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class }) // 本テストでは1回につき25件のユーザODataを作成する。IT以降のテストの時間短縮のため、コミットビルドでのみ動作するようにしている。 public class UserDataLinkTopSkipTest extends JerseyTest { private static final Map INIT_PARAMS = new HashMap(); static { - INIT_PARAMS.put("com.sun.jersey.config.property.packages", "com.fujitsu.dc.core.rs"); + INIT_PARAMS.put("com.sun.jersey.config.property.packages", "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } private static final String MASTER_TOKEN_NAME = Setup.MASTER_TOKEN_NAME; @@ -215,13 +215,13 @@ private void createSchemaandBaseData(String cellName, String boxName, String col BoxUtils.create(cellName, boxName, MASTER_TOKEN_NAME, HttpStatus.SC_CREATED); DavResourceUtils.createODataCollection(MASTER_TOKEN_NAME, HttpStatus.SC_CREATED, cellName, boxName, colName); - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), colName, toEntityTypeName, HttpStatus.SC_CREATED); - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), colName, fromEntityTypeName, HttpStatus.SC_CREATED); - AssociationEndUtils.create(DcCoreConfig.getMasterToken(), fromMultiplicity, cellName, + AssociationEndUtils.create(PersoniumUnitConfig.getMasterToken(), fromMultiplicity, cellName, boxName, colName, HttpStatus.SC_CREATED, "AssociationEnd", fromEntityTypeName); - AssociationEndUtils.create(DcCoreConfig.getMasterToken(), toMultiplicity, cellName, + AssociationEndUtils.create(PersoniumUnitConfig.getMasterToken(), toMultiplicity, cellName, boxName, colName, HttpStatus.SC_CREATED, "LinkAssociationEnd", toEntityTypeName); AssociationEndUtils.createLink(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, fromEntityTypeName, toEntityTypeName, "AssociationEnd", diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListDeclaredDoubleTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataListDeclaredDoubleTest.java similarity index 86% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListDeclaredDoubleTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataListDeclaredDoubleTest.java index 6446c3d8e..aa66c341a 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListDeclaredDoubleTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataListDeclaredDoubleTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; @@ -31,23 +31,23 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.box.odatacol.schema.property.PropertyUtils; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.box.odatacol.schema.property.PropertyUtils; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.UserDataUtils; /** * UserDataのDouble型への検索テスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataListDeclaredDoubleTest extends AbstractUserDataTest { @@ -67,7 +67,7 @@ public UserDataListDeclaredDoubleTest() { String propertyName = "doubleProp"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, entityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); // プロパティの登録 @@ -81,10 +81,10 @@ public UserDataListDeclaredDoubleTest() { // ユーザデータの一覧取得 String searchRequestUrl = UrlUtils.userData(cellName, boxName, colName, entityTypeName) + "?$filter=" + propertyName + "+eq+12345.12345&$inlinecount=allpages"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -110,7 +110,7 @@ public UserDataListDeclaredDoubleTest() { String propertyName = "doubleProp"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, entityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); // プロパティの登録 @@ -124,10 +124,10 @@ public UserDataListDeclaredDoubleTest() { // ユーザデータの一覧取得 String searchRequestUrl = UrlUtils.userData(cellName, boxName, colName, entityTypeName) + "?$filter=" + propertyName + "+eq+1&$inlinecount=allpages&$orderby=__id"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -156,7 +156,7 @@ public UserDataListDeclaredDoubleTest() { String propertyName = "doubleProp"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, entityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); // プロパティの登録 @@ -170,10 +170,10 @@ public UserDataListDeclaredDoubleTest() { // ユーザデータの一覧取得 String searchRequestUrl = UrlUtils.userData(cellName, boxName, colName, entityTypeName) + "?$filter=" + propertyName + "+eq+1.0&$inlinecount=allpages&$orderby=__id"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -202,7 +202,7 @@ public UserDataListDeclaredDoubleTest() { String propertyName = "doubleProp"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, entityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); // プロパティの登録 @@ -216,10 +216,10 @@ public UserDataListDeclaredDoubleTest() { // ユーザデータの一覧取得 String searchRequestUrl = UrlUtils.userData(cellName, boxName, colName, entityTypeName) + "?$filter=" + propertyName + "+gt+1.0&$inlinecount=allpages&$orderby=__id"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -252,7 +252,7 @@ public UserDataListDeclaredDoubleTest() { String propertyName = "doubleProp"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, entityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); // プロパティの登録 @@ -266,10 +266,10 @@ public UserDataListDeclaredDoubleTest() { // ユーザデータの一覧取得 String searchRequestUrl = UrlUtils.userData(cellName, boxName, colName, entityTypeName) + "?$filter=" + propertyName + "+le+0&$inlinecount=allpages&$orderby=__id"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -299,7 +299,7 @@ public UserDataListDeclaredDoubleTest() { String propertyName = "doubleProp"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, entityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); // プロパティの登録 @@ -313,10 +313,10 @@ public UserDataListDeclaredDoubleTest() { // ユーザデータの一覧取得 String searchRequestUrl = UrlUtils.userData(cellName, boxName, colName, entityTypeName) + "?$filter=" + propertyName + "+eq+null&$inlinecount=allpages&$orderby=__id"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -345,7 +345,7 @@ public UserDataListDeclaredDoubleTest() { String propertyName = "doubleProp"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, entityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); // プロパティの登録 @@ -359,10 +359,10 @@ public UserDataListDeclaredDoubleTest() { // ユーザデータの一覧取得 String searchRequestUrl = UrlUtils.userData(cellName, boxName, colName, entityTypeName) + "?$filter=" + propertyName + "+eq+1.79E308&$inlinecount=allpages&$orderby=__id"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -391,7 +391,7 @@ public UserDataListDeclaredDoubleTest() { String propertyName = "doubleProp"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, entityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); // プロパティの登録 @@ -405,10 +405,10 @@ public UserDataListDeclaredDoubleTest() { // ユーザデータの一覧取得 String searchRequestUrl = UrlUtils.userData(cellName, boxName, colName, entityTypeName) + "?$filter=" + propertyName + "+eq+--1.79E308&$inlinecount=allpages&$orderby=__id"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -435,7 +435,7 @@ public UserDataListDeclaredDoubleTest() { String propertyName = "doubleProp"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, entityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); // プロパティの登録 @@ -446,7 +446,7 @@ public UserDataListDeclaredDoubleTest() { JSONObject body = new JSONObject(); body.put("__id", "doubleInt"); body.put(propertyName, 1); - UserDataUtils.create(DcCoreConfig.getMasterToken(), HttpStatus.SC_CREATED, body, + UserDataUtils.create(PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_CREATED, body, cellName, boxName, colName, entityTypeName); // プロパティの更新 @@ -463,10 +463,10 @@ public UserDataListDeclaredDoubleTest() { // ユーザデータの一覧取得 String searchRequestUrl = UrlUtils.userData(cellName, boxName, colName, entityTypeName) + "?$filter=" + propertyName + "+eq+1.0&$inlinecount=allpages&$orderby=__id"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -500,7 +500,7 @@ public UserDataListDeclaredDoubleTest() { String propertyName = "doubleProp"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, entityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); // プロパティの登録 @@ -511,7 +511,7 @@ public UserDataListDeclaredDoubleTest() { JSONObject body = new JSONObject(); body.put("__id", "doubleInt"); body.put(propertyName, 2); - UserDataUtils.create(DcCoreConfig.getMasterToken(), HttpStatus.SC_CREATED, body, + UserDataUtils.create(PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_CREATED, body, cellName, boxName, colName, entityTypeName); // プロパティの更新 @@ -528,10 +528,10 @@ public UserDataListDeclaredDoubleTest() { // ユーザデータの一覧取得 String searchRequestUrl = UrlUtils.userData(cellName, boxName, colName, entityTypeName) + "?$filter=" + propertyName + "+gt+1.234&$inlinecount=allpages&$orderby=__id"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -567,7 +567,7 @@ public UserDataListDeclaredDoubleTest() { String propertyName = "doubleProp"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, entityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); // プロパティの登録 @@ -581,10 +581,10 @@ public UserDataListDeclaredDoubleTest() { // ユーザデータの一覧取得 String searchRequestUrl = UrlUtils.userData(cellName, boxName, colName, entityTypeName) + "?$orderby=" + propertyName + "+asc,__id&$inlinecount=allpages"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -631,7 +631,7 @@ public UserDataListDeclaredDoubleTest() { String propertyName = "doubleProp"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, entityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); // プロパティの登録 @@ -645,10 +645,10 @@ public UserDataListDeclaredDoubleTest() { // ユーザデータの一覧取得 String searchRequestUrl = UrlUtils.userData(cellName, boxName, colName, entityTypeName) + "?$orderby=" + propertyName + "+desc,__id&$inlinecount=allpages"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -696,7 +696,7 @@ public UserDataListDeclaredDoubleTest() { String propertyName = "doubleProp"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, entityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); // プロパティの登録 @@ -707,7 +707,7 @@ public UserDataListDeclaredDoubleTest() { JSONObject body = new JSONObject(); body.put("__id", "doubleInt"); body.put(propertyName, 1); - UserDataUtils.create(DcCoreConfig.getMasterToken(), HttpStatus.SC_CREATED, body, + UserDataUtils.create(PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_CREATED, body, cellName, boxName, colName, entityTypeName); // プロパティの更新 @@ -724,10 +724,10 @@ public UserDataListDeclaredDoubleTest() { // ユーザデータの一覧取得 String searchRequestUrl = UrlUtils.userData(cellName, boxName, colName, entityTypeName) + "?$orderby=" + propertyName + ",__id&$inlinecount=allpages"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -777,7 +777,7 @@ public UserDataListDeclaredDoubleTest() { String propertyName = "doubleProp"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, entityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); // プロパティの登録 @@ -791,10 +791,10 @@ public UserDataListDeclaredDoubleTest() { // ユーザデータの一覧取得 String searchRequestUrl = UrlUtils.userData(cellName, boxName, colName, entityTypeName) + "?q=1.79E308&$inlinecount=allpages&$orderby=__id"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -824,7 +824,7 @@ public UserDataListDeclaredDoubleTest() { String propertyName = "doubleProp"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, entityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); // プロパティの登録 @@ -838,10 +838,10 @@ public UserDataListDeclaredDoubleTest() { // ユーザデータの一覧取得 String searchRequestUrl = UrlUtils.userData(cellName, boxName, colName, entityTypeName) + "?q=-1.79E308&$inlinecount=allpages&$orderby=__id"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -872,7 +872,7 @@ public UserDataListDeclaredDoubleTest() { String propertyName = "doubleProp"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, entityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); // プロパティの登録 @@ -883,7 +883,7 @@ public UserDataListDeclaredDoubleTest() { JSONObject body = new JSONObject(); body.put("__id", "doubleInt"); body.put(propertyName, 1); - UserDataUtils.create(DcCoreConfig.getMasterToken(), HttpStatus.SC_CREATED, body, + UserDataUtils.create(PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_CREATED, body, cellName, boxName, colName, entityTypeName); // プロパティの更新 @@ -900,10 +900,10 @@ public UserDataListDeclaredDoubleTest() { // ユーザデータの一覧取得 String searchRequestUrl = UrlUtils.userData(cellName, boxName, colName, entityTypeName) + "?q=1&$inlinecount=allpages&$orderby=__id"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -931,7 +931,7 @@ public UserDataListDeclaredDoubleTest() { String propertyName = "doubleProp"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, entityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); // プロパティの登録 @@ -942,7 +942,7 @@ public UserDataListDeclaredDoubleTest() { JSONObject body = new JSONObject(); body.put("__id", "doubleInt"); body.put(propertyName, 1); - UserDataUtils.create(DcCoreConfig.getMasterToken(), HttpStatus.SC_CREATED, body, + UserDataUtils.create(PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_CREATED, body, cellName, boxName, colName, entityTypeName); // プロパティの更新 @@ -959,10 +959,10 @@ public UserDataListDeclaredDoubleTest() { // ユーザデータの一覧取得 String searchRequestUrl = UrlUtils.userData(cellName, boxName, colName, entityTypeName) + "?q=1.0&$inlinecount=allpages&$orderby=__id"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -994,42 +994,42 @@ protected void createTestData(String entityTypeName, String propertyName) { JSONObject body = new JSONObject(); body.put("__id", "doubleMax"); body.put(propertyName, 1.79E308); - UserDataUtils.create(DcCoreConfig.getMasterToken(), HttpStatus.SC_CREATED, body, + UserDataUtils.create(PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_CREATED, body, cellName, boxName, colName, entityTypeName); body.put("__id", "double"); body.put(propertyName, 12345.12345); - UserDataUtils.create(DcCoreConfig.getMasterToken(), HttpStatus.SC_CREATED, body, + UserDataUtils.create(PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_CREATED, body, cellName, boxName, colName, entityTypeName); body.put("__id", "doubleString"); body.put(propertyName, "1.2345"); - UserDataUtils.create(DcCoreConfig.getMasterToken(), HttpStatus.SC_CREATED, body, + UserDataUtils.create(PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_CREATED, body, cellName, boxName, colName, entityTypeName); body.put("__id", "doubleNatural"); body.put(propertyName, 1); - UserDataUtils.create(DcCoreConfig.getMasterToken(), HttpStatus.SC_CREATED, body, + UserDataUtils.create(PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_CREATED, body, cellName, boxName, colName, entityTypeName); body.put("__id", "doubleDecimal"); body.put(propertyName, 1.0); - UserDataUtils.create(DcCoreConfig.getMasterToken(), HttpStatus.SC_CREATED, body, + UserDataUtils.create(PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_CREATED, body, cellName, boxName, colName, entityTypeName); body.put("__id", "doubleZero"); body.put(propertyName, 0.0); - UserDataUtils.create(DcCoreConfig.getMasterToken(), HttpStatus.SC_CREATED, body, + UserDataUtils.create(PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_CREATED, body, cellName, boxName, colName, entityTypeName); body.put("__id", "doubleMin"); body.put(propertyName, -1.79e308); - UserDataUtils.create(DcCoreConfig.getMasterToken(), HttpStatus.SC_CREATED, body, + UserDataUtils.create(PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_CREATED, body, cellName, boxName, colName, entityTypeName); body.put("__id", "doubleNull"); body.put(propertyName, null); - UserDataUtils.create(DcCoreConfig.getMasterToken(), HttpStatus.SC_CREATED, body, + UserDataUtils.create(PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_CREATED, body, cellName, boxName, colName, entityTypeName); } @@ -1040,20 +1040,20 @@ protected void createTestData(String entityTypeName, String propertyName) { */ protected void deleteTestData(String entityTypeName, String propertyName) { // UserODataの削除 - UserDataUtils.delete(DcCoreConfig.getMasterToken(), -1, entityTypeName, "doubleInt", colName); - UserDataUtils.delete(DcCoreConfig.getMasterToken(), -1, entityTypeName, "double", colName); - UserDataUtils.delete(DcCoreConfig.getMasterToken(), -1, entityTypeName, "doubleZero", colName); - UserDataUtils.delete(DcCoreConfig.getMasterToken(), -1, entityTypeName, "doubleNull", colName); - UserDataUtils.delete(DcCoreConfig.getMasterToken(), -1, entityTypeName, "doubleMax", colName); - UserDataUtils.delete(DcCoreConfig.getMasterToken(), -1, entityTypeName, "doubleMin", colName); - UserDataUtils.delete(DcCoreConfig.getMasterToken(), -1, entityTypeName, "doubleString", colName); - UserDataUtils.delete(DcCoreConfig.getMasterToken(), -1, entityTypeName, "doubleNatural", colName); - UserDataUtils.delete(DcCoreConfig.getMasterToken(), -1, entityTypeName, "doubleDecimal", colName); + UserDataUtils.delete(PersoniumUnitConfig.getMasterToken(), -1, entityTypeName, "doubleInt", colName); + UserDataUtils.delete(PersoniumUnitConfig.getMasterToken(), -1, entityTypeName, "double", colName); + UserDataUtils.delete(PersoniumUnitConfig.getMasterToken(), -1, entityTypeName, "doubleZero", colName); + UserDataUtils.delete(PersoniumUnitConfig.getMasterToken(), -1, entityTypeName, "doubleNull", colName); + UserDataUtils.delete(PersoniumUnitConfig.getMasterToken(), -1, entityTypeName, "doubleMax", colName); + UserDataUtils.delete(PersoniumUnitConfig.getMasterToken(), -1, entityTypeName, "doubleMin", colName); + UserDataUtils.delete(PersoniumUnitConfig.getMasterToken(), -1, entityTypeName, "doubleString", colName); + UserDataUtils.delete(PersoniumUnitConfig.getMasterToken(), -1, entityTypeName, "doubleNatural", colName); + UserDataUtils.delete(PersoniumUnitConfig.getMasterToken(), -1, entityTypeName, "doubleDecimal", colName); PropertyUtils.delete(AbstractCase.BEARER_MASTER_TOKEN, cellName, boxName, colName, entityTypeName, propertyName, -1); // EntityTypeの削除 - EntityTypeUtils.delete(colName, DcCoreConfig.getMasterToken(), + EntityTypeUtils.delete(colName, PersoniumUnitConfig.getMasterToken(), MediaType.APPLICATION_JSON, entityTypeName, boxName, cellName, -1); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListFilterBooleanTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataListFilterBooleanTest.java similarity index 83% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListFilterBooleanTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataListFilterBooleanTest.java index d4ae1099c..30c5e2216 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListFilterBooleanTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataListFilterBooleanTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; @@ -28,22 +28,22 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.UserDataUtils; /** * UserDataのBoolean型への検索テスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataListFilterBooleanTest extends AbstractUserDataTest { @@ -68,10 +68,10 @@ public UserDataListFilterBooleanTest() { // ユーザデータの一覧取得 String searchRequestUrl = UrlUtils.userData(cellName, boxName, colName, entityTypeName) + "?$filter=bool+eq+true&$inlinecount=allpages"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -102,10 +102,10 @@ public UserDataListFilterBooleanTest() { // ユーザデータの一覧取得 String searchRequestUrl = UrlUtils.userData(cellName, boxName, colName, entityTypeName) + "?$filter=bool+eq+false&$inlinecount=allpages"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -136,10 +136,10 @@ public UserDataListFilterBooleanTest() { // ユーザデータの一覧取得 String searchRequestUrl = UrlUtils.userData(cellName, boxName, colName, entityTypeName) + "?$filter=bool+eq+null&$inlinecount=allpages"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -166,10 +166,10 @@ public UserDataListFilterBooleanTest() { String entityTypeName = "SalesDetail"; String searchRequestUrl = UrlUtils.userData(cellName, boxName, colName, entityTypeName) + "?$filter=truth+eq+%27true%27&$inlinecount=allpages"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_BAD_REQUEST, searchResponse.getStatusCode()); } @@ -183,10 +183,10 @@ public UserDataListFilterBooleanTest() { String entityTypeName = "SalesDetail"; String searchRequestUrl = UrlUtils.userData(cellName, boxName, colName, entityTypeName) + "?$filter=truth+eq+%27false%27&$inlinecount=allpages"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_BAD_REQUEST, searchResponse.getStatusCode()); } @@ -200,10 +200,10 @@ public UserDataListFilterBooleanTest() { String entityTypeName = "SalesDetail"; String searchRequestUrl = UrlUtils.userData(cellName, boxName, colName, entityTypeName) + "?$filter=truth+eq+%27null%27&$inlinecount=allpages"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_BAD_REQUEST, searchResponse.getStatusCode()); } @@ -217,10 +217,10 @@ public UserDataListFilterBooleanTest() { String entityTypeName = "SalesDetail"; String searchRequestUrl = UrlUtils.userData(cellName, boxName, colName, entityTypeName) + "?$filter=truth+eq+%27hoge%27&$inlinecount=allpages"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_BAD_REQUEST, searchResponse.getStatusCode()); } @@ -231,24 +231,24 @@ public UserDataListFilterBooleanTest() { @SuppressWarnings("unchecked") protected void createTestData(String entityTypeName) { // Booleanの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, entityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); // 真偽値が true / false / null のデータを作成 JSONObject body = new JSONObject(); body.put("__id", "boolTrue"); body.put("bool", true); - UserDataUtils.create(DcCoreConfig.getMasterToken(), HttpStatus.SC_CREATED, body, + UserDataUtils.create(PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_CREATED, body, cellName, boxName, colName, entityTypeName); body.put("__id", "boolFalse"); body.put("bool", false); - UserDataUtils.create(DcCoreConfig.getMasterToken(), HttpStatus.SC_CREATED, body, + UserDataUtils.create(PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_CREATED, body, cellName, boxName, colName, entityTypeName); body.put("__id", "boolNull"); body.put("bool", null); - UserDataUtils.create(DcCoreConfig.getMasterToken(), HttpStatus.SC_CREATED, body, + UserDataUtils.create(PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_CREATED, body, cellName, boxName, colName, entityTypeName); } @@ -258,12 +258,12 @@ protected void createTestData(String entityTypeName) { */ protected void deleteTestData(String entityTypeName) { // UserODataの削除 - UserDataUtils.delete(DcCoreConfig.getMasterToken(), -1, entityTypeName, "boolTrue", colName); - UserDataUtils.delete(DcCoreConfig.getMasterToken(), -1, entityTypeName, "boolFalse", colName); - UserDataUtils.delete(DcCoreConfig.getMasterToken(), -1, entityTypeName, "boolNull", colName); + UserDataUtils.delete(PersoniumUnitConfig.getMasterToken(), -1, entityTypeName, "boolTrue", colName); + UserDataUtils.delete(PersoniumUnitConfig.getMasterToken(), -1, entityTypeName, "boolFalse", colName); + UserDataUtils.delete(PersoniumUnitConfig.getMasterToken(), -1, entityTypeName, "boolNull", colName); // EntityTypeの削除 - EntityTypeUtils.delete(colName, DcCoreConfig.getMasterToken(), + EntityTypeUtils.delete(colName, PersoniumUnitConfig.getMasterToken(), MediaType.APPLICATION_JSON, entityTypeName, boxName, cellName, -1); } @@ -281,7 +281,7 @@ protected void deleteTestData(String entityTypeName) { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=truth+ge+true&\\$inlinecount=allpages") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -302,7 +302,7 @@ protected void deleteTestData(String entityTypeName) { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=startswith%28truth%2ctrue%29") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -323,7 +323,7 @@ protected void deleteTestData(String entityTypeName) { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=startswith%28truth%2cfalse%29") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -344,7 +344,7 @@ protected void deleteTestData(String entityTypeName) { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=substringof%28true%2ctruth%29") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -365,7 +365,7 @@ protected void deleteTestData(String entityTypeName) { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=substringof%28false%2ctruth%29") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListFilterFunctionTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataListFilterFunctionTest.java similarity index 87% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListFilterFunctionTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataListFilterFunctionTest.java index c6058b1ea..357a020a0 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListFilterFunctionTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataListFilterFunctionTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import java.util.HashMap; import java.util.Map; @@ -26,23 +26,23 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; /** * UserData一覧のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataListFilterFunctionTest extends AbstractUserDataTest { @@ -63,7 +63,7 @@ public UserDataListFilterFunctionTest() { public final void UserDataに前方一致検索クエリに英語キーワードを指定して対象のデータのみ取得できること() { // englishプロパティの先頭が大文字Testの値のみ取得する String sdEntityTypeName = "SalesDetail"; - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, "?$filter=startswith%28english%2c%27Test%27%29&$inlinecount=allpages"); // レスポンスボディーのチェック @@ -117,7 +117,7 @@ public UserDataListFilterFunctionTest() { // ユーザデータの一覧取得 String sdEntityTypeName = "SalesDetail"; - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, "?$filter=startswith%28english%2c%27Search+substr%27%29"); // レスポンスボディーのチェック @@ -148,7 +148,7 @@ public UserDataListFilterFunctionTest() { // ユーザデータの一覧取得 String sdEntityTypeName = "SalesDetail"; - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, "?$filter=startswith%28english%2c%27substringof%27%29&$inlinecount=allpages"); // レスポンスボディーのチェック @@ -164,7 +164,7 @@ public UserDataListFilterFunctionTest() { // ユーザデータの一覧取得 String sdEntityTypeName = "SalesDetail"; - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, "?$filter=startswith%28japanese%2c%27部分一致検索漢字の%27%29"); // レスポンスボディーのチェック @@ -195,7 +195,7 @@ public UserDataListFilterFunctionTest() { // ユーザデータの一覧取得 String sdEntityTypeName = "SalesDetail"; - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, "?$filter=startswith%28japanese%2c%27一致検索%27%29&$inlinecount=allpages"); // レスポンスボディーのチェック @@ -218,7 +218,7 @@ public UserDataListFilterFunctionTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=startswith%28test%29") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -239,7 +239,7 @@ public UserDataListFilterFunctionTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=startswith%28%27test%27%29%2c%27test%27") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -260,7 +260,7 @@ public UserDataListFilterFunctionTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=startswith%28test%2ctest%29") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -281,7 +281,7 @@ public UserDataListFilterFunctionTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=startswith%28number%2c1%29") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -302,7 +302,7 @@ public UserDataListFilterFunctionTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=startswith%28decimal%2c1.1%29") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -323,7 +323,7 @@ public UserDataListFilterFunctionTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=startswith%28null%2cnull%29") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -340,9 +340,9 @@ public UserDataListFilterFunctionTest() { // Edm.Stringの検索条件:文字列: "string data" String query = "?\\$filter=startswith%28english%2ctrue%29&\\$inlinecount=allpages"; TResponse res = UserDataUtils.list(cellName, boxName, colName, sdEntityTypeName, query, - DcCoreConfig.getMasterToken(), HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("english").getMessage()); + PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_BAD_REQUEST); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("english").getMessage()); } /** @@ -360,7 +360,7 @@ public UserDataListFilterFunctionTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=startswith%28%29") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -373,7 +373,7 @@ public UserDataListFilterFunctionTest() { public final void UserDataに部分一致検索クエリに英語キーワードを指定して対象のデータのみ取得できること() { // ユーザデータの一覧取得 String sdEntityTypeName = "SalesDetail"; - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, "?$filter=substringof%28%27value%27%2cenglish%29"); // レスポンスボディーのチェック @@ -404,7 +404,7 @@ public UserDataListFilterFunctionTest() { // ユーザデータの一覧取得 String sdEntityTypeName = "SalesDetail"; - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, "?$filter=substringof%28%27Search+substringof%27%2cenglish%29"); // レスポンスボディーのチェック @@ -435,7 +435,7 @@ public UserDataListFilterFunctionTest() { // ユーザデータの一覧取得 String sdEntityTypeName = "SalesDetail"; - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, "?$filter=substringof%28%27部分一致検索漢字%27%2cjapanese%29"); // レスポンスボディーのチェック @@ -466,7 +466,7 @@ public UserDataListFilterFunctionTest() { // ユーザデータの一覧取得 String sdEntityTypeName = "SalesDetail"; - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, "?$filter=substringof%28%27けんさく%27%2cjapanese%29"); // レスポンスボディーのチェック @@ -504,7 +504,7 @@ public UserDataListFilterFunctionTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=substringof%28test%29") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -525,7 +525,7 @@ public UserDataListFilterFunctionTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=substringof%28%27test%27%29") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -546,7 +546,7 @@ public UserDataListFilterFunctionTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=substringof%28test%2ctest%29") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -567,7 +567,7 @@ public UserDataListFilterFunctionTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=substringof%281%2cnumber%29") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -588,7 +588,7 @@ public UserDataListFilterFunctionTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=substringof%281.1%2cdecimal%29") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -609,7 +609,7 @@ public UserDataListFilterFunctionTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=substringof%28null%2csample%29") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -626,9 +626,9 @@ public UserDataListFilterFunctionTest() { // Edm.Stringの検索条件:文字列: "string data" String query = "?\\$filter=substringof%28true%2cenglish%29&\\$inlinecount=allpages"; TResponse res = UserDataUtils.list(cellName, boxName, colName, sdEntityTypeName, query, - DcCoreConfig.getMasterToken(), HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("english").getMessage()); + PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_BAD_REQUEST); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("english").getMessage()); } } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListFilterNoneExistKeyTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataListFilterNoneExistKeyTest.java similarity index 83% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListFilterNoneExistKeyTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataListFilterNoneExistKeyTest.java index 11de0a610..1e7091ef2 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListFilterNoneExistKeyTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataListFilterNoneExistKeyTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import javax.ws.rs.core.MediaType; @@ -24,22 +24,22 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * UserData一覧のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataListFilterNoneExistKeyTest extends AbstractUserDataTest { @@ -85,14 +85,14 @@ public UserDataListFilterNoneExistKeyTest() { .with("query", "?\\$filter=dynamicProperty+eq+%27dynamicPropertyValue%27" + "+or+noneExistName+eq+%27noneExistValue%27") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); // エラーコードとメッセージのチェック - ODataCommon.checkErrorResponseBody(response, DcCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), - DcCoreException.OData.UNKNOWN_QUERY_KEY.params("noneExistName").getMessage()); + ODataCommon.checkErrorResponseBody(response, PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), + PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.params("noneExistName").getMessage()); } finally { // ユーザデータ削除 deleteUserData(userDataId); @@ -134,14 +134,14 @@ public UserDataListFilterNoneExistKeyTest() { + "+and+noneExistName+eq+%27noneExistValue%27" + "&\\$inlinecount=allpages") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); // エラーコードとメッセージのチェック - ODataCommon.checkErrorResponseBody(response, DcCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), - DcCoreException.OData.UNKNOWN_QUERY_KEY.params("noneExistName").getMessage()); + ODataCommon.checkErrorResponseBody(response, PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), + PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.params("noneExistName").getMessage()); } finally { // ユーザデータ削除 deleteUserData(userDataId); @@ -182,14 +182,14 @@ public UserDataListFilterNoneExistKeyTest() { .with("query", "?\\$filter=noneExistName+eq+%27noneExistValue%27" + "&\\$inlinecount=allpages") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); // エラーコードとメッセージのチェック - ODataCommon.checkErrorResponseBody(response, DcCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), - DcCoreException.OData.UNKNOWN_QUERY_KEY.params("noneExistName").getMessage()); + ODataCommon.checkErrorResponseBody(response, PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), + PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.params("noneExistName").getMessage()); } finally { // ユーザデータ削除 deleteUserData(userDataId); @@ -213,14 +213,14 @@ public UserDataListFilterNoneExistKeyTest() { .with("query", "?\\$filter=noneExistName+eq+%27noneExistValue%27" + "&\\$inlinecount=allpages") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); // エラーコードとメッセージのチェック - ODataCommon.checkErrorResponseBody(response, DcCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), - DcCoreException.OData.UNKNOWN_QUERY_KEY.params("noneExistName").getMessage()); + ODataCommon.checkErrorResponseBody(response, PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), + PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.params("noneExistName").getMessage()); } /** @@ -251,7 +251,7 @@ public UserDataListFilterNoneExistKeyTest() { .with("query", "?\\$filter=dynamicProperty+eq+%27noneExistValue%27" + "&\\$inlinecount=allpages") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListFilterTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataListFilterTest.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListFilterTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataListFilterTest.java index cc6f1152c..49c2bfc19 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListFilterTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataListFilterTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -37,25 +37,25 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; /** * UserData一覧のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataListFilterTest extends AbstractUserDataTest { @@ -105,7 +105,7 @@ public UserDataListFilterTest() { .with("entityType", entityTypeName) .with("query", "?\\$filter=dynamicProperty+eq+%27dynamicPropertyValue%27") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -176,8 +176,8 @@ public UserDataListFilterTest() { res = UserDataUtils.list(cellName, boxName, colName, entityTypeName, query, AbstractCase.MASTER_TOKEN_NAME, HttpStatus.SC_BAD_REQUEST); // 不正なデータのため400エラーとなること ODataCommon.checkErrorResponseBody(res, - DcCoreException.OData.OPERATOR_AND_OPERAND_UNABLE_TO_UNESCAPE.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_UNABLE_TO_UNESCAPE.params("value_\\u001_value") + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_UNABLE_TO_UNESCAPE.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_UNABLE_TO_UNESCAPE.params("value_\\u001_value") .getMessage()); } finally { deleteUserData(userDataId1); @@ -200,7 +200,7 @@ public UserDataListFilterTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=number+eq+5&\\$inlinecount=allpages") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -214,7 +214,7 @@ public UserDataListFilterTest() { String resId = (String) ((JSONObject) result).get("__id"); // 取得した__idから一件取得する TResponse responseUnit = getUserData(cellName, boxName, colName, sdEntityTypeName, - resId, DcCoreConfig.getMasterToken(), "", HttpStatus.SC_OK); + resId, PersoniumUnitConfig.getMasterToken(), "", HttpStatus.SC_OK); // レスポンスヘッダからEtag情報を取得する etag.put(resId, responseUnit.getHeader(HttpHeaders.ETAG)); } @@ -256,7 +256,7 @@ public UserDataListFilterTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=decimal+eq+5.1&\\$inlinecount=allpages") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -270,7 +270,7 @@ public UserDataListFilterTest() { String resId = (String) ((JSONObject) result).get("__id"); // 取得した__idから一件取得する TResponse responseUnit = getUserData(cellName, boxName, colName, sdEntityTypeName, - resId, DcCoreConfig.getMasterToken(), "", HttpStatus.SC_OK); + resId, PersoniumUnitConfig.getMasterToken(), "", HttpStatus.SC_OK); // レスポンスヘッダからEtag情報を取得する etag.put(resId, responseUnit.getHeader(HttpHeaders.ETAG)); } @@ -313,7 +313,7 @@ public UserDataListFilterTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=number+eq+null&\\$inlinecount=allpages") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -327,7 +327,7 @@ public UserDataListFilterTest() { String resId = (String) ((JSONObject) result).get("__id"); // 取得した__idから一件取得する TResponse responseUnit = getUserData(cellName, boxName, colName, sdEntityTypeName, - resId, DcCoreConfig.getMasterToken(), "", HttpStatus.SC_OK); + resId, PersoniumUnitConfig.getMasterToken(), "", HttpStatus.SC_OK); // レスポンスヘッダからEtag情報を取得する etag.put(resId, responseUnit.getHeader(HttpHeaders.ETAG)); } @@ -372,7 +372,7 @@ public UserDataListFilterTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=__id+eq+%27userdata006%27") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -424,7 +424,7 @@ public UserDataListFilterTest() { .with("entityType", entityTypeName) .with("query", "?\\$filter=dynamicPropertyBoolean+eq+true") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -463,7 +463,7 @@ public UserDataListFilterTest() { String sdEntityTypeName = "SalesDetail"; // ユーザデータの一覧取得 String query = "?$inlinecount=allpages"; - DcResponse res = UserDataUtils.listEntities(cellName, boxName, colName, sdEntityTypeName, query, + PersoniumResponse res = UserDataUtils.listEntities(cellName, boxName, colName, sdEntityTypeName, query, AbstractCase.MASTER_TOKEN_NAME, HttpStatus.SC_OK); JSONObject json = res.bodyAsJson(); int count = Integer.parseInt((String) ((JSONObject) json.get("d")).get("__count")); @@ -487,7 +487,7 @@ public UserDataListFilterTest() { String sdEntityTypeName = "SalesDetail"; // ユーザデータの一覧取得 String query = "?$inlinecount=allpages"; - DcResponse res = UserDataUtils.listEntities(cellName, boxName, colName, sdEntityTypeName, query, + PersoniumResponse res = UserDataUtils.listEntities(cellName, boxName, colName, sdEntityTypeName, query, AbstractCase.MASTER_TOKEN_NAME, HttpStatus.SC_OK); JSONObject json = res.bodyAsJson(); int count = Integer.parseInt((String) ((JSONObject) json.get("d")).get("__count")); @@ -514,7 +514,7 @@ public UserDataListFilterTest() { String sdEntityTypeName = "SalesDetail"; // ユーザデータの一覧取得 String query = "?$inlinecount=allpages"; - DcResponse res = UserDataUtils.listEntities(cellName, boxName, colName, sdEntityTypeName, query, + PersoniumResponse res = UserDataUtils.listEntities(cellName, boxName, colName, sdEntityTypeName, query, AbstractCase.MASTER_TOKEN_NAME, HttpStatus.SC_OK); JSONObject json = res.bodyAsJson(); int count = Integer.parseInt((String) ((JSONObject) json.get("d")).get("__count")); @@ -564,7 +564,7 @@ public UserDataListFilterTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=__id+gt+%27userdata006%27+and+__id+lt+%27userdata008%27") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -587,7 +587,7 @@ public UserDataListFilterTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=__id+ge+%27userdata006%27+and+__id+le+%27userdata008%27&\\$orderby=__id") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -634,7 +634,7 @@ public UserDataListFilterTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=startswith(__id,%27userdata006%27)&\\$orderby=__id") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -651,7 +651,7 @@ public UserDataListFilterTest() { ODataCommon.checkCommonResponseUri(response.bodyAsJson(), uri); } finally { - deleteUserData(cellName, boxName, colName, sdEntityTypeName, userDataId, DcCoreConfig.getMasterToken(), + deleteUserData(cellName, boxName, colName, sdEntityTypeName, userDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteDynamicProperty("dynamicProperty"); } @@ -672,7 +672,7 @@ public UserDataListFilterTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=substringof(%27userdata006%27,__id)") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -718,7 +718,7 @@ public UserDataListFilterTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=__published+eq+" + date.substring(6, 19)) .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -733,7 +733,7 @@ public UserDataListFilterTest() { ODataCommon.checkCommonResponseUri(response.bodyAsJson(), uri); } finally { - deleteUserData(cellName, boxName, colName, sdEntityTypeName, userDataId, DcCoreConfig.getMasterToken(), + deleteUserData(cellName, boxName, colName, sdEntityTypeName, userDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteDynamicProperty("dynamicProperty"); } @@ -762,7 +762,7 @@ public UserDataListFilterTest() { long date = parseDateStringToLong(dateStr); // ユーザデータの一覧取得 - DcResponse searchResponse = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, + PersoniumResponse searchResponse = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, "?$filter=__published+ge+" + date + "+and+__published+le+" + (date + 1000)); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); @@ -778,7 +778,7 @@ public UserDataListFilterTest() { assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); ODataCommon.checkCommonResponseUri(searchResponse.bodyAsJson(), uri); } finally { - deleteUserData(cellName, boxName, colName, sdEntityTypeName, userDataId, DcCoreConfig.getMasterToken(), + deleteUserData(cellName, boxName, colName, sdEntityTypeName, userDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteDynamicProperty("dynamicProperty"); } @@ -813,7 +813,7 @@ public UserDataListFilterTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=__updated+eq+" + date.substring(6, 19)) .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -828,7 +828,7 @@ public UserDataListFilterTest() { ODataCommon.checkCommonResponseUri(response.bodyAsJson(), uri); } finally { - deleteUserData(cellName, boxName, colName, sdEntityTypeName, userDataId, DcCoreConfig.getMasterToken(), + deleteUserData(cellName, boxName, colName, sdEntityTypeName, userDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteDynamicProperty("dynamicProperty"); } @@ -858,7 +858,7 @@ public UserDataListFilterTest() { long date = parseDateStringToLong(dateStr); // ユーザデータの一覧取得 - DcResponse searchResponse = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, + PersoniumResponse searchResponse = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, "?$filter=__updated+ge+" + date + "+and+__updated+le+" + (date + 1000)); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); @@ -874,7 +874,7 @@ public UserDataListFilterTest() { assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); ODataCommon.checkCommonResponseUri(searchResponse.bodyAsJson(), uri); } finally { - deleteUserData(cellName, boxName, colName, sdEntityTypeName, userDataId, DcCoreConfig.getMasterToken(), + deleteUserData(cellName, boxName, colName, sdEntityTypeName, userDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); deleteDynamicProperty("dynamicProperty"); } @@ -894,7 +894,7 @@ public UserDataListFilterTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=number+ge+5+and+number+lt+6&\\$inlinecount=allpages") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -937,7 +937,7 @@ public UserDataListFilterTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=decimal+gt+8.1+or+decimal+le+0.1&\\$inlinecount=allpages") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -990,7 +990,7 @@ public UserDataListFilterTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=test+ge+'test5'+and+test+le+'test6'&\\$inlinecount=allpages") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -1043,7 +1043,7 @@ public UserDataListFilterTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=test+gt+'test7'+and+number+lt+9&\\$inlinecount=allpages") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -1086,7 +1086,7 @@ public UserDataListFilterTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=test+ge+null&\\$inlinecount=allpages") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -1098,7 +1098,7 @@ public UserDataListFilterTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=test+gt+null&\\$inlinecount=allpages") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -1110,7 +1110,7 @@ public UserDataListFilterTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=test+le+null&\\$inlinecount=allpages") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -1122,7 +1122,7 @@ public UserDataListFilterTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=test+lt+null&\\$inlinecount=allpages") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -1142,7 +1142,7 @@ public UserDataListFilterTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=tes+ge+null&\\$inlinecount=allpages") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -1154,7 +1154,7 @@ public UserDataListFilterTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=tes+gt+null&\\$inlinecount=allpages") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -1166,7 +1166,7 @@ public UserDataListFilterTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=tes+le+null&\\$inlinecount=allpages") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -1178,7 +1178,7 @@ public UserDataListFilterTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=tes+lt+null&\\$inlinecount=allpages") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -1198,7 +1198,7 @@ public UserDataListFilterTest() { .with("entityType", sdEntityTypeName) .with("query", "?\\$filter=test+ge&\\$inlinecount=allpages") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -1219,7 +1219,7 @@ public UserDataListFilterTest() { .with("query", "?\\$filter=dynamicProperty+eq+%27dynamicPropertyValue1" + "%27+and+sample+eq+%27sample1%27") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -1273,7 +1273,7 @@ public UserDataListFilterTest() { .with("query", "?\\$filter=dynamicProperty+eq+%27dynamicPropertyValue1" + "%27+and+sample+eq+%27sample1%27+and+test+eq+%27test1%27") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -1311,7 +1311,7 @@ public UserDataListFilterTest() { // ユーザデータの一覧取得 String sdEntityTypeName = "SalesDetail"; - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, "?$filter=japanese+eq+%27部分一致検索テスト%27" + "+and+japanese+eq+%27部分一致検索漢字のテスト%27"); @@ -1332,7 +1332,7 @@ public UserDataListFilterTest() { .with("entityType", entityTypeName) .with("query", "?\\$filter=dynamicProperty+eq+%27dynamicPropertyValue1%27+and") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -1351,7 +1351,7 @@ public UserDataListFilterTest() { .with("entityType", entityTypeName) .with("query", "?\\$filter=and+dynamicProperty+eq+%27dynamicPropertyValue1%27") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -1372,7 +1372,7 @@ public UserDataListFilterTest() { .with("query", "?\\$filter=dynamicProperty+eq+%27dynamicPropertyValue5%27" + "+or+sample+eq+%27sample7%27") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -1425,7 +1425,7 @@ public UserDataListFilterTest() { .with("query", "?\\$filter=dynamicProperty+eq+%27dynamicPropertyValue5%27" + "+or+sample+eq+%27sample7%27+or+test+eq+%27test9%27") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -1481,7 +1481,7 @@ public UserDataListFilterTest() { // ユーザデータの一覧取得 String sdEntityTypeName = "SalesDetail"; - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, "?$filter=japanese+eq+%27部分一致検索テスト%27" + "+or+japanese+eq+%27部分一致検索漢字のテスト%27"); @@ -1528,7 +1528,7 @@ public UserDataListFilterTest() { .with("entityType", entityTypeName) .with("query", "?\\$filter=dynamicProperty+eq+%27dynamicPropertyValue1%27+or") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -1547,7 +1547,7 @@ public UserDataListFilterTest() { .with("entityType", entityTypeName) .with("query", "?\\$filter=or+dynamicProperty+eq+%27dynamicPropertyValue1%27") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -1569,7 +1569,7 @@ public UserDataListFilterTest() { + "+and+(dynamicProperty+eq+%27dynamicPropertyValue1%27" + "+or+test+eq+%27test2%27+or+test+eq+%27test6%27)") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -1613,7 +1613,7 @@ public UserDataListFilterTest() { + "+and+dynamicProperty+eq+%27dynamicPropertyValue1%27)" + "+and+(test+eq+%27test1%27+or+sample+eq+%27sample1%27)") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -1668,7 +1668,7 @@ public UserDataListFilterTest() { + "+and+(dynamicProperty+eq+%27dynamicPropertyValue1%27" + "+or+(test+eq+%27test6%27+or+sample+eq+%27sample2%27))") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -1763,7 +1763,7 @@ public UserDataListFilterTest() { + "+and+(dynamicProperty+eq+%27dynamicPropertyValue1%27" + "+or+test+eq+%27test2%27") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -1882,7 +1882,7 @@ public UserDataListFilterTest() { body, cellName, boxName, colName, entityType); // ユーザデータの一覧取得 - DcResponse response = UserDataListFilterTest.getUserDataWithDcClient(cellName, boxName, colName, + PersoniumResponse response = UserDataListFilterTest.getUserDataWithDcClient(cellName, boxName, colName, entityType, "?$filter=dynamicProperty+eq+%27" + value + "%27&$inlinecount=allpages"); @@ -1921,7 +1921,7 @@ public UserDataListFilterTest() { body, cellName, boxName, colName, entityType); // ユーザデータの一覧取得 - DcResponse response = UserDataListFilterTest.getUserDataWithDcClient(cellName, boxName, colName, + PersoniumResponse response = UserDataListFilterTest.getUserDataWithDcClient(cellName, boxName, colName, entityType, "?$filter=dynamicProperty+eq+%27" + value + "%27&$inlinecount=allpages"); @@ -1958,7 +1958,7 @@ public UserDataListFilterTest() { body, cellName, boxName, colName, entityType); // ユーザデータの一覧取得 gt - DcResponse response = UserDataListFilterTest.getUserDataWithDcClient(cellName, boxName, colName, + PersoniumResponse response = UserDataListFilterTest.getUserDataWithDcClient(cellName, boxName, colName, entityType, "?$filter=dynamicProperty+gt+%27" + UserDataUtils.createString(queryLength - 1) + "0" + "%27&$inlinecount=allpages"); @@ -2019,7 +2019,7 @@ public UserDataListFilterTest() { body, cellName, boxName, colName, entityType); // ユーザデータの一覧取得 gt - DcResponse response = UserDataListFilterTest.getUserDataWithDcClient(cellName, boxName, colName, + PersoniumResponse response = UserDataListFilterTest.getUserDataWithDcClient(cellName, boxName, colName, entityType, "?$filter=dynamicProperty+gt+%27" + UserDataUtils.createString(queryLength - 1) + "0" + "%27&$inlinecount=allpages"); @@ -2076,7 +2076,7 @@ public UserDataListFilterTest() { body, cellName, boxName, colName, entityType); // ユーザデータの一覧取得 startswith - DcResponse response = UserDataListFilterTest.getUserDataWithDcClient(cellName, boxName, colName, + PersoniumResponse response = UserDataListFilterTest.getUserDataWithDcClient(cellName, boxName, colName, entityType, "?$filter=startswith(dynamicProperty,%27" + value + "%27)&$inlinecount=allpages"); // ヒット数のチェック @@ -2115,7 +2115,7 @@ public UserDataListFilterTest() { body, cellName, boxName, colName, entityType); // ユーザデータの一覧取得 startswith - DcResponse response = UserDataListFilterTest.getUserDataWithDcClient(cellName, boxName, colName, + PersoniumResponse response = UserDataListFilterTest.getUserDataWithDcClient(cellName, boxName, colName, entityType, "?$filter=startswith(dynamicProperty,%27" + value + "%27)&$inlinecount=allpages"); // ヒット数のチェック @@ -2178,7 +2178,7 @@ private TResponse userDataListWithFilter(String sdEntityTypeName, String query, .with("entityType", sdEntityTypeName) .with("query", query) .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(code) .debug(); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListFilterTypeValidateTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataListFilterTypeValidateTest.java similarity index 67% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListFilterTypeValidateTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataListFilterTypeValidateTest.java index 1fb12d523..aff04901d 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListFilterTypeValidateTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataListFilterTypeValidateTest.java @@ -14,32 +14,32 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import org.apache.http.HttpStatus; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; /** * UserData一覧のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataListFilterTypeValidateTest extends AbstractUserDataTest { - private static final String TOKEN = DcCoreConfig.getMasterToken(); + private static final String TOKEN = PersoniumUnitConfig.getMasterToken(); private static final String CELL = "filterTypeValidateTest"; private static final String BOX = "box"; private static final String COL = "odata"; @@ -75,38 +75,38 @@ public UserDataListFilterTypeValidateTest() { // Edm.Stringの検索条件: 整数: 1111 query = "?\\$filter=string+eq+1111&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("string").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("string").getMessage()); // Edm.Stringの検索条件: 整数: 1111 eq以外の演算子(gt) query = "?\\$filter=string+gt+1111&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("string").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("string").getMessage()); // Edm.Stringの検索条件: 整数: 1111 startswith() query = "?\\$filter=startswith%28string%2C1111%29"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("string").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("string").getMessage()); // Edm.Stringの検索条件: 整数: 1111 startswith() query = "?\\$filter=substringof%281111%2Cstring%29"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("string").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("string").getMessage()); // Edm.Stringの検索条件: 実数値(単精度): 1111.11 query = "?\\$filter=string+eq+1111.11&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("string").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("string").getMessage()); // Edm.Stringの検索条件: 実数値(倍精度): 1111.1111111 query = "?\\$filter=string+eq+1111.1111111&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("string").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("string").getMessage()); // Edm.Stringの検索条件: 真偽値: true query = "?\\$filter=string+eq+true&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("string").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("string").getMessage()); } /** @@ -131,23 +131,23 @@ public UserDataListFilterTypeValidateTest() { // Edm.Stringの検索条件: 整数: 1111 query = "?\\$filter=string+ne+1111&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("string").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("string").getMessage()); // Edm.Stringの検索条件: 実数値(単精度): 1111.11 query = "?\\$filter=string+ne+1111.11&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("string").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("string").getMessage()); // Edm.Stringの検索条件: 実数値(倍精度): 1111.1111111 query = "?\\$filter=string+ne+1111.1111111&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("string").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("string").getMessage()); // Edm.Stringの検索条件: 真偽値: true query = "?\\$filter=string+ne+true&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("string").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("string").getMessage()); } /** @@ -172,33 +172,33 @@ public UserDataListFilterTypeValidateTest() { // Edm.Int32の検索条件: 文字列: "1111" query = "?\\$filter=int32+eq+%271111%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32").getMessage()); // Edm.Int32の検索条件: 文字列: "1111" eq以外の演算子(ge) query = "?\\$filter=int32+ge+%271111%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32").getMessage()); // Edm.Int32の検索条件: 文字列: "aaaa" query = "?\\$filter=int32+eq+%27aaaa%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32").getMessage()); // Edm.Int32の検索条件: 実数値(単精度): 1111.11 query = "?\\$filter=int32+eq+1111.11&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32").getMessage()); // Edm.Int32の検索条件: 実数値(倍精度): 1111.1111111 query = "?\\$filter=int32+eq+1111.1111111&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32").getMessage()); // Edm.Int32の検索条件: 真偽値: true query = "?\\$filter=int32+eq+true&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32").getMessage()); // 値の範囲チェック // Edm.Int32の検索条件: 範囲内(最大値 2147483647) @@ -212,13 +212,13 @@ public UserDataListFilterTypeValidateTest() { // Edm.Int32の検索条件: 範囲外(最大値 2147483647 + 1): 2147483648 query = "?\\$filter=int32+eq+2147483648&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.getCode(), - DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params("int32").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.getCode(), + PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params("int32").getMessage()); // Edm.Int32の検索条件: 範囲外(最小値 -2147483648 - 1): -2147483649 query = "?\\$filter=int32+eq+-2147483649&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.getCode(), - DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params("int32").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.getCode(), + PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params("int32").getMessage()); } @@ -244,28 +244,28 @@ public UserDataListFilterTypeValidateTest() { // Edm.Int32の検索条件: 文字列: "1111" query = "?\\$filter=int32+ne+%271111%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32").getMessage()); // Edm.Int32の検索条件: 文字列: "aaaa" query = "?\\$filter=int32+ne+%27aaaa%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32").getMessage()); // Edm.Int32の検索条件: 実数値(単精度): 1111.11 query = "?\\$filter=int32+ne+1111.11&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32").getMessage()); // Edm.Int32の検索条件: 実数値(倍精度): 1111.1111111 query = "?\\$filter=int32+ne+1111.1111111&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32").getMessage()); // Edm.Int32の検索条件: 真偽値: true query = "?\\$filter=int32+ne+true&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32").getMessage()); // 値の範囲チェック // Edm.Int32の検索条件: 範囲内(最大値 2147483647) @@ -279,13 +279,13 @@ public UserDataListFilterTypeValidateTest() { // Edm.Int32の検索条件: 範囲外(最大値 2147483647 + 1): 2147483648 query = "?\\$filter=int32+ne+2147483648&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.getCode(), - DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params("int32").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.getCode(), + PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params("int32").getMessage()); // Edm.Int32の検索条件: 範囲外(最小値 -2147483648 - 1): -2147483649 query = "?\\$filter=int32+ne+-2147483649&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.getCode(), - DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params("int32").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.getCode(), + PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params("int32").getMessage()); } @@ -315,38 +315,38 @@ public UserDataListFilterTypeValidateTest() { // Edm.Singleの検索条件: 文字列: "1111" query = "?\\$filter=single+eq+%271111%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("single").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("single").getMessage()); // Edm.Singleの検索条件: 文字列: "1111" eq以外の演算子(lt) query = "?\\$filter=single+lt+%271111%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("single").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("single").getMessage()); // Edm.Singleの検索条件: 文字列: "1111.11" query = "?\\$filter=single+eq+%271111.11%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("single").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("single").getMessage()); // Edm.Singleの検索条件: 文字列: "1111.1a" query = "?\\$filter=single+eq+%271111.1a%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("single").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("single").getMessage()); // Edm.Singleの検索条件: 真偽値: true query = "?\\$filter=single+eq+true&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("single").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("single").getMessage()); // Edm.Singleの検索条件: Single: 1111.11f query = "?\\$filter=single+eq+1111.11f&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("single").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("single").getMessage()); // Edm.Singleの検索条件: Decimal: 1111.11m query = "?\\$filter=single+eq+1111.11m&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("single").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("single").getMessage()); // 値の範囲チェック // Edm.Singleの検索条件: 整数部分5桁 小数部分 5桁: 11111.11111 @@ -356,18 +356,18 @@ public UserDataListFilterTypeValidateTest() { // Edm.Singleの検索条件: 整数部分6桁 小数部分 5桁: 111111.11111 query = "?\\$filter=single+eq+111111.11111&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.getCode(), - DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params("single").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.getCode(), + PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params("single").getMessage()); // Edm.Singleの検索条件: 整数部分5桁 小数部分 6桁: 11111.111111 query = "?\\$filter=single+eq+11111.111111&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.getCode(), - DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params("single").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.getCode(), + PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params("single").getMessage()); // Edm.Singleの検索条件: 整数部分6桁 小数部分 6桁: 111111.111111 query = "?\\$filter=single+eq+111111.111111&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.getCode(), - DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params("single").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.getCode(), + PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params("single").getMessage()); } /** @@ -396,33 +396,33 @@ public UserDataListFilterTypeValidateTest() { // Edm.Singleの検索条件: 文字列: "1111" query = "?\\$filter=single+ne+%271111%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("single").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("single").getMessage()); // Edm.Singleの検索条件: 文字列: "1111.11" query = "?\\$filter=single+ne+%271111.11%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("single").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("single").getMessage()); // Edm.Singleの検索条件: 文字列: "1111.1a" query = "?\\$filter=single+ne+%271111.1a%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("single").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("single").getMessage()); // Edm.Singleの検索条件: 真偽値: true query = "?\\$filter=single+ne+true&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("single").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("single").getMessage()); // Edm.Singleの検索条件: Single: 1111.11f query = "?\\$filter=single+ne+1111.11f&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("single").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("single").getMessage()); // Edm.Singleの検索条件: Decimal: 1111.11m query = "?\\$filter=single+ne+1111.11m&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("single").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("single").getMessage()); // 値の範囲チェック // Edm.Singleの検索条件: 整数部分5桁 小数部分 5桁: 11111.11111 @@ -432,18 +432,18 @@ public UserDataListFilterTypeValidateTest() { // Edm.Singleの検索条件: 整数部分6桁 小数部分 5桁: 111111.11111 query = "?\\$filter=single+ne+111111.11111&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.getCode(), - DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params("single").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.getCode(), + PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params("single").getMessage()); // Edm.Singleの検索条件: 整数部分5桁 小数部分 6桁: 11111.111111 query = "?\\$filter=single+ne+11111.111111&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.getCode(), - DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params("single").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.getCode(), + PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params("single").getMessage()); // Edm.Singleの検索条件: 整数部分6桁 小数部分 6桁: 111111.111111 query = "?\\$filter=single+ne+111111.111111&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.getCode(), - DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params("single").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.getCode(), + PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params("single").getMessage()); } /** @@ -471,38 +471,38 @@ public UserDataListFilterTypeValidateTest() { // Edm.Doubleの検索条件: 文字列: "1111" query = "?\\$filter=double+eq+%271111%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("double").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("double").getMessage()); // Edm.Doubleの検索条件: 文字列: "1111" eq以外の演算子(le) query = "?\\$filter=double+le+%271111%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("double").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("double").getMessage()); // Edm.Doubleの検索条件: 文字列: "1111.1111111" query = "?\\$filter=double+eq+%271111.1111111%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("double").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("double").getMessage()); // Edm.Doubleの検索条件: 文字列: "1111.111111a" query = "?\\$filter=double+eq+%271111.111111a%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("double").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("double").getMessage()); // Edm.Doubleの検索条件: 真偽値: true query = "?\\$filter=double+eq+true&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("double").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("double").getMessage()); // Edm.Doubleの検索条件: Single: 1111.11f query = "?\\$filter=double+eq+1111.11f&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("double").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("double").getMessage()); // Edm.Doubleの検索条件: Decimal: 1111.11m query = "?\\$filter=double+eq+1111.11m&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("double").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("double").getMessage()); // 値の範囲チェック // 現状、指数表記での$filter検索はできない(制限事項)ため、チェックせず。 @@ -533,33 +533,33 @@ public UserDataListFilterTypeValidateTest() { // Edm.Doubleの検索条件: 文字列: "1111" query = "?\\$filter=double+ne+%271111%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("double").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("double").getMessage()); // Edm.Doubleの検索条件: 文字列: "1111.1111111" query = "?\\$filter=double+ne+%271111.1111111%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("double").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("double").getMessage()); // Edm.Doubleの検索条件: 文字列: "1111.111111a" query = "?\\$filter=double+ne+%271111.111111a%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("double").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("double").getMessage()); // Edm.Doubleの検索条件: 真偽値: true query = "?\\$filter=double+ne+true&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("double").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("double").getMessage()); // Edm.Doubleの検索条件: Single: 1111.11f query = "?\\$filter=double+ne+1111.11f&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("double").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("double").getMessage()); // Edm.Doubleの検索条件: Decimal: 1111.11m query = "?\\$filter=double+ne+1111.11m&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("double").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("double").getMessage()); // 値の範囲チェック // 現状、指数表記での$filter検索はできない(制限事項)ため、チェックせず。 @@ -583,33 +583,33 @@ public UserDataListFilterTypeValidateTest() { // Edm.Booleanの検索条件: 文字列: "true" query = "?\\$filter=boolean+eq+%27true%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("boolean").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("boolean").getMessage()); // Edm.Booleanの検索条件:整数: 1111 query = "?\\$filter=boolean+eq+1111&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("boolean").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("boolean").getMessage()); // Edm.Booleanの検索条件: 実数値(単精度): 1111.11 query = "?\\$filter=boolean+eq+1111.11&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("boolean").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("boolean").getMessage()); // Edm.Booleanの検索条件: 実数値(倍精度): 1111.1111111 query = "?\\$filter=boolean+eq+1111.1111111&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("boolean").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("boolean").getMessage()); // Edm.Booleanの検索条件: Single: 1111.11f query = "?\\$filter=boolean+eq+1111.11f&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("boolean").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("boolean").getMessage()); // Edm.Booleanの検索条件: Decimal: 1111.11m query = "?\\$filter=boolean+eq+1111.11m&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("boolean").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("boolean").getMessage()); } /** @@ -629,33 +629,33 @@ public UserDataListFilterTypeValidateTest() { // Edm.Booleanの検索条件: 文字列: "true" query = "?\\$filter=boolean+ne+%27true%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("boolean").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("boolean").getMessage()); // Edm.Booleanの検索条件:整数: 1111 query = "?\\$filter=boolean+ne+1111&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("boolean").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("boolean").getMessage()); // Edm.Booleanの検索条件: 実数値(単精度): 1111.11 query = "?\\$filter=boolean+ne+1111.11&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("boolean").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("boolean").getMessage()); // Edm.Booleanの検索条件: 実数値(倍精度): 1111.1111111 query = "?\\$filter=boolean+ne+1111.1111111&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("boolean").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("boolean").getMessage()); // Edm.Booleanの検索条件: Single: 1111.11f query = "?\\$filter=boolean+ne+1111.11f&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("boolean").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("boolean").getMessage()); // Edm.Booleanの検索条件: Decimal: 1111.11m query = "?\\$filter=boolean+ne+1111.11m&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("boolean").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("boolean").getMessage()); } /** @@ -679,38 +679,38 @@ public UserDataListFilterTypeValidateTest() { // Edm.DateTimeの検索条件:文字列: "1420589956172" query = "?\\$filter=datetime+eq+%271420589956172%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("datetime").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("datetime").getMessage()); // Edm.DateTimeの検索条件: 文字列: "/Date(1410689956172)/" query = "?\\$filter=datetime+eq+%27%2FDate%281420589956172%29%2F%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("datetime").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("datetime").getMessage()); // Edm.DateTimeの検索条件: 実数値(単精度): 1111.11 query = "?\\$filter=datetime+eq+1111.11&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("datetime").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("datetime").getMessage()); // Edm.DateTimeの検索条件: 実数値(倍精度): 1111.1111111 query = "?\\$filter=datetime+eq+1111.1111111&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("datetime").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("datetime").getMessage()); // Edm.DateTimeの検索条件: 真偽値: true query = "?\\$filter=datetime+eq+true&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("datetime").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("datetime").getMessage()); // Edm.DateTimeの検索条件: Single: 1111.11f query = "?\\$filter=datetime+eq+1111.11f&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("datetime").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("datetime").getMessage()); // Edm.DateTimeの検索条件: Decimal: 1111.11m query = "?\\$filter=datetime+eq+1111.11m&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("datetime").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("datetime").getMessage()); // 値の範囲チェック // Edm.DateTimeの検索条件:最大値: 253402300799999 @@ -724,13 +724,13 @@ public UserDataListFilterTypeValidateTest() { // Edm.DateTimeの検索条件:最大値(253402300799999) + 1: 253402300800000 query = "?\\$filter=datetime+eq+253402300800000&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.getCode(), - DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params("datetime").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.getCode(), + PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params("datetime").getMessage()); // Edm.DateTimeの検索条件:最小値(-6847804800000) + 1: -6847804800001 query = "?\\$filter=datetime+eq+-6847804800001&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.getCode(), - DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params("datetime").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.getCode(), + PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params("datetime").getMessage()); } /** @@ -754,38 +754,38 @@ public UserDataListFilterTypeValidateTest() { // Edm.DateTimeの検索条件:文字列: "1420589956172" query = "?\\$filter=datetime+ne+%271420589956172%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("datetime").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("datetime").getMessage()); // Edm.DateTimeの検索条件: 文字列: "/Date(1410689956172)/" query = "?\\$filter=datetime+ne+%27%2FDate%281420589956172%29%2F%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("datetime").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("datetime").getMessage()); // Edm.DateTimeの検索条件: 実数値(単精度): 1111.11 query = "?\\$filter=datetime+ne+1111.11&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("datetime").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("datetime").getMessage()); // Edm.DateTimeの検索条件: 実数値(倍精度): 1111.1111111 query = "?\\$filter=datetime+ne+1111.1111111&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("datetime").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("datetime").getMessage()); // Edm.DateTimeの検索条件: 真偽値: true query = "?\\$filter=datetime+ne+true&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("datetime").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("datetime").getMessage()); // Edm.DateTimeの検索条件: Single: 1111.11f query = "?\\$filter=datetime+ne+1111.11f&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("datetime").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("datetime").getMessage()); // Edm.DateTimeの検索条件: Decimal: 1111.11m query = "?\\$filter=datetime+ne+1111.11m&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("datetime").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("datetime").getMessage()); // 値の範囲チェック // Edm.DateTimeの検索条件:最大値: 253402300799999 @@ -799,13 +799,13 @@ public UserDataListFilterTypeValidateTest() { // Edm.DateTimeの検索条件:最大値(253402300799999) + 1: 253402300800000 query = "?\\$filter=datetime+ne+253402300800000&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.getCode(), - DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params("datetime").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.getCode(), + PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params("datetime").getMessage()); // Edm.DateTimeの検索条件:最小値(-6847804800000) + 1: -6847804800001 query = "?\\$filter=datetime+ne+-6847804800001&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.getCode(), - DcCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params("datetime").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.getCode(), + PersoniumCoreException.OData.UNSUPPORTED_OPERAND_FORMAT.params("datetime").getMessage()); } /** @@ -821,8 +821,8 @@ public UserDataListFilterTypeValidateTest() { // Edm.Stringの検索条件: 整数: 1111 query = "?\\$filter=d_string+eq+1111&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_string").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_string").getMessage()); // Edm.Int32 // Edm.Int32の検索条件:整数: 2222 @@ -832,8 +832,8 @@ public UserDataListFilterTypeValidateTest() { // Edm.Int32の検索条件: 文字列: "222a" query = "?\\$filter=d_int32+eq+%27222a%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_int32").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_int32").getMessage()); // Edm.Single(動的プロパティでは、Double型として登録される) // Edm.Singleの検索条件:整数: 2222 @@ -843,13 +843,13 @@ public UserDataListFilterTypeValidateTest() { // Edm.Singleの検索条件: 文字列: "2222.22" query = "?\\$filter=d_single+eq+%272222.22%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_single").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_single").getMessage()); // Edm.Singleの検索条件: 文字列: "2222.2a" query = "?\\$filter=d_single+eq+%272222.2a%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_single").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_single").getMessage()); // Edm.Double // Edm.Doubleの検索条件:整数: 2222 @@ -859,13 +859,13 @@ public UserDataListFilterTypeValidateTest() { // Edm.Doubleの検索条件: 文字列: "2222.2222222" query = "?\\$filter=d_double+eq+%272222.2222222%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_double").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_double").getMessage()); // Edm.Doubleの検索条件: 文字列: "2222.222222a" query = "?\\$filter=d_double+eq+%272222.222222a%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_double").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_double").getMessage()); // Edm.Boolean // Edm.Booleanの検索条件: 真偽値: false @@ -875,15 +875,15 @@ public UserDataListFilterTypeValidateTest() { // Edm.Booleanの検索条件: 文字列: "false" query = "?\\$filter=d_boolean+eq+%27false%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_boolean").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_boolean").getMessage()); // Edm.DateTime(動的プロパティは未サポートのため、Edm.String型として登録される) // Edm.DateTimeの検索条件:整数(LONG): 1410689956172 query = "?\\$filter=d_datetime+eq+1410689956172&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_datetime").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_datetime").getMessage()); // Edm.DateTimeの検索条件: 文字列: "/Date(1410689956172)/" query = "?\\$filter=d_datetime+eq+%27%2FDate%281410689956172%29%2F%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_OK); @@ -891,8 +891,8 @@ public UserDataListFilterTypeValidateTest() { // Edm.DateTimeの検索条件: 実数値(単精度): 1111.11 query = "?\\$filter=d_datetime+eq+1111.11&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_datetime").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_datetime").getMessage()); } /** @@ -908,8 +908,8 @@ public UserDataListFilterTypeValidateTest() { // Edm.Stringの検索条件: 整数: 1111 query = "?\\$filter=d_string+ne+1111&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_string").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_string").getMessage()); // Edm.Int32 // Edm.Int32の検索条件:整数: 2222 @@ -919,8 +919,8 @@ public UserDataListFilterTypeValidateTest() { // Edm.Int32の検索条件: 文字列: "222a" query = "?\\$filter=d_int32+ne+%27222a%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_int32").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_int32").getMessage()); // Edm.Single(動的プロパティでは、Double型として登録される) // Edm.Singleの検索条件:整数: 2222 @@ -930,13 +930,13 @@ public UserDataListFilterTypeValidateTest() { // Edm.Singleの検索条件: 文字列: "2222.22" query = "?\\$filter=d_single+ne+%272222.22%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_single").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_single").getMessage()); // Edm.Singleの検索条件: 文字列: "2222.2a" query = "?\\$filter=d_single+ne+%272222.2a%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_single").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_single").getMessage()); // Edm.Double // Edm.Doubleの検索条件:整数: 2222 @@ -946,13 +946,13 @@ public UserDataListFilterTypeValidateTest() { // Edm.Doubleの検索条件: 文字列: "2222.2222222" query = "?\\$filter=d_double+ne+%272222.2222222%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_double").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_double").getMessage()); // Edm.Doubleの検索条件: 文字列: "2222.222222a" query = "?\\$filter=d_double+ne+%272222.222222a%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_double").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_double").getMessage()); // Edm.Boolean // Edm.Booleanの検索条件: 真偽値: false @@ -962,15 +962,15 @@ public UserDataListFilterTypeValidateTest() { // Edm.Booleanの検索条件: 文字列: "false" query = "?\\$filter=d_boolean+ne+%27false%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_boolean").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_boolean").getMessage()); // Edm.DateTime(動的プロパティは未サポートのため、Edm.String型として登録される) // Edm.DateTimeの検索条件:整数(LONG): 1410689956172 query = "?\\$filter=d_datetime+ne+1410689956172&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_datetime").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_datetime").getMessage()); // Edm.DateTimeの検索条件: 文字列: "/Date(1410689956172)/" query = "?\\$filter=d_datetime+ne+%27%2FDate%281410689956172%29%2F%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_OK); @@ -978,8 +978,8 @@ public UserDataListFilterTypeValidateTest() { // Edm.DateTimeの検索条件: 実数値(単精度): 1111.11 query = "?\\$filter=d_datetime+ne+1111.11&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_datetime").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("d_datetime").getMessage()); } /** @@ -990,26 +990,26 @@ public UserDataListFilterTypeValidateTest() { // Edm.Booleanの検索の比較演算子: lt String query = "?\\$filter=boolean+lt+true&\\$inlinecount=allpages"; TResponse res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.FILTER_PARSE_ERROR.getCode(), - DcCoreException.OData.FILTER_PARSE_ERROR.getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.FILTER_PARSE_ERROR.getCode(), + PersoniumCoreException.OData.FILTER_PARSE_ERROR.getMessage()); // Edm.Booleanの検索の比較演算子: le query = "?\\$filter=boolean+le+true&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.FILTER_PARSE_ERROR.getCode(), - DcCoreException.OData.FILTER_PARSE_ERROR.getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.FILTER_PARSE_ERROR.getCode(), + PersoniumCoreException.OData.FILTER_PARSE_ERROR.getMessage()); // Edm.Booleanの検索の比較演算子: ge query = "?\\$filter=boolean+ge+true&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.FILTER_PARSE_ERROR.getCode(), - DcCoreException.OData.FILTER_PARSE_ERROR.getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.FILTER_PARSE_ERROR.getCode(), + PersoniumCoreException.OData.FILTER_PARSE_ERROR.getMessage()); // Edm.Booleanの検索の比較演算子: gt query = "?\\$filter=boolean+gt+true&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.FILTER_PARSE_ERROR.getCode(), - DcCoreException.OData.FILTER_PARSE_ERROR.getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.FILTER_PARSE_ERROR.getCode(), + PersoniumCoreException.OData.FILTER_PARSE_ERROR.getMessage()); } /** @@ -1020,8 +1020,8 @@ public UserDataListFilterTypeValidateTest() { // Edm.Int32配列の検索の比較演算子: eq、検索条件: 文字列:"a" String query = "?\\$filter=int32_list+eq+%27a%27&\\$inlinecount=allpages"; TResponse res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32_list").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32_list").getMessage()); // Edm.Int32配列の検索の比較演算子: eq、検索条件: 整数: 数値:3 query = "?\\$filter=int32_list+eq+3&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_OK); @@ -1030,8 +1030,8 @@ public UserDataListFilterTypeValidateTest() { // Edm.Int32配列の検索の比較演算子: ne、検索条件: 文字列:"1111" query = "?\\$filter=int32_list+ne+%271111%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32_list").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32_list").getMessage()); // Edm.Int32配列の検索の比較演算子: ne、検索条件: 整数: 数値:6 query = "?\\$filter=int32_list+ne+6&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_OK); @@ -1040,8 +1040,8 @@ public UserDataListFilterTypeValidateTest() { // Edm.Int32配列の検索の比較演算子: gt、検索条件: 文字列:"b" query = "?\\$filter=int32_list+gt+%27b%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32_list").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32_list").getMessage()); // Edm.Int32配列の検索の比較演算子: gt、検索条件: 整数:5 query = "?\\$filter=int32_list+gt+5&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_OK); @@ -1050,8 +1050,8 @@ public UserDataListFilterTypeValidateTest() { // Edm.Int32配列の検索の比較演算子: ge、検索条件: 文字列:"c" query = "?\\$filter=int32_list+ge+%27c%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32_list").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32_list").getMessage()); // Edm.Int32配列の検索の比較演算子: ge、検索条件: 整数:5 query = "?\\$filter=int32_list+ge+5&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_OK); @@ -1060,8 +1060,8 @@ public UserDataListFilterTypeValidateTest() { // Edm.Int32配列の検索の比較演算子: lt、検索条件: 文字列:"d" query = "?\\$filter=int32_list+lt+%27d%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32_list").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32_list").getMessage()); // Edm.Int32配列の検索の比較演算子: lt、検索条件: 整数:3 query = "?\\$filter=int32_list+lt+3&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_OK); @@ -1070,8 +1070,8 @@ public UserDataListFilterTypeValidateTest() { // Edm.Int32配列の検索の比較演算子: le、検索条件: 文字列:"e" query = "?\\$filter=int32_list+le+%27e%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), - DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32_list").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), + PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("int32_list").getMessage()); // Edm.Int32配列の検索の比較演算子: le、検索条件: 整数:3 query = "?\\$filter=int32_list+le+3&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_OK); @@ -1098,19 +1098,19 @@ public UserDataListFilterTypeValidateTest() { // __metadataを検索しようとすると400エラーとなること query = "?\\$filter=__metadata+eq+%27invalidKey%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), - DcCoreException.OData.UNKNOWN_QUERY_KEY.params("__metadata").getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), + PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.params("__metadata").getMessage()); // NTKPを検索しようとすると400エラーとなること query = "?\\$filter=_SalesDetail+eq+%27invalidKey%27&\\$inlinecount=allpages"; res = UserDataUtils.list(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, "Sales", query, TOKEN, HttpStatus.SC_BAD_REQUEST); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), - DcCoreException.OData.UNKNOWN_QUERY_KEY.params("_SalesDetail").getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), + PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.params("_SalesDetail").getMessage()); // 予約語ではない__始まりのプロパティを検索しようとすると400エラーとなること query = "?\\$filter=__invalid+eq+%27invalidKey%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), - DcCoreException.OData.UNKNOWN_QUERY_KEY.params("__invalid").getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), + PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.params("__invalid").getMessage()); } /** @@ -1133,19 +1133,19 @@ public UserDataListFilterTypeValidateTest() { // __metadataを検索しようとすると400エラーとなること query = "?\\$filter=__metadata+ne+%27invalidKey%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), - DcCoreException.OData.UNKNOWN_QUERY_KEY.params("__metadata").getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), + PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.params("__metadata").getMessage()); // NTKPを検索しようとすると400エラーとなること query = "?\\$filter=_SalesDetail+ne+%27invalidKey%27&\\$inlinecount=allpages"; res = UserDataUtils.list(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, "Sales", query, TOKEN, HttpStatus.SC_BAD_REQUEST); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), - DcCoreException.OData.UNKNOWN_QUERY_KEY.params("_SalesDetail").getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), + PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.params("_SalesDetail").getMessage()); // 予約語ではない__始まりのプロパティを検索しようとすると400エラーとなること query = "?\\$filter=__invalid+ne+%27invalidKey%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), - DcCoreException.OData.UNKNOWN_QUERY_KEY.params("__invalid").getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), + PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.params("__invalid").getMessage()); } /** @@ -1156,31 +1156,31 @@ public UserDataListFilterTypeValidateTest() { // gt String query = "?\\$filter=__metadata+gt+%27invalidKey%27&\\$inlinecount=allpages"; TResponse res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), - DcCoreException.OData.UNKNOWN_QUERY_KEY.params("__metadata").getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), + PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.params("__metadata").getMessage()); // ge query = "?\\$filter=__metadata+ge+%27invalidKey%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), - DcCoreException.OData.UNKNOWN_QUERY_KEY.params("__metadata").getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), + PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.params("__metadata").getMessage()); // lt query = "?\\$filter=__metadata+lt+%27invalidKey%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); // le query = "?\\$filter=__metadata+le+%27invalidKey%27&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), - DcCoreException.OData.UNKNOWN_QUERY_KEY.params("__metadata").getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), + PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.params("__metadata").getMessage()); // startswith query = "?\\$filter=startswith%28__metadata%2c%27invalidKey%27%29&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), - DcCoreException.OData.UNKNOWN_QUERY_KEY.params("__metadata").getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), + PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.params("__metadata").getMessage()); // substringof query = "?\\$filter=substringof%28%27invalidKey%27%2c__metadata%29&\\$inlinecount=allpages"; res = UserDataUtils.list(CELL, BOX, COL, ENTITY, query, TOKEN, HttpStatus.SC_BAD_REQUEST); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), - DcCoreException.OData.UNKNOWN_QUERY_KEY.params("__metadata").getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.getCode(), + PersoniumCoreException.OData.UNKNOWN_QUERY_KEY.params("__metadata").getMessage()); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListOrderbyTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataListOrderbyTest.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListOrderbyTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataListOrderbyTest.java index ea7684796..ddfb88dfd 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListOrderbyTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataListOrderbyTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -34,26 +34,26 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.Common; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; /** * UserData一覧の$orderbyクエリのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataListOrderbyTest extends AbstractUserDataTest { @@ -116,7 +116,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "?\\$orderby=__id") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -151,7 +151,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "?\\$orderby=__published") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -196,7 +196,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "?\\$orderby=__updated") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -224,7 +224,7 @@ public void deleteUserDataList() { // ユーザデータの一覧取得 String sdEntityTypeName = "SalesDetail"; - DcResponse response = getUserDataWithDcClient(cellName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, @@ -247,7 +247,7 @@ public void deleteUserDataList() { // ユーザデータの一覧取得 String sdEntityTypeName = "SalesDetail"; - DcResponse response = getUserDataWithDcClient(cellName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, @@ -270,7 +270,7 @@ public void deleteUserDataList() { // ユーザデータの一覧取得 String sdEntityTypeName = "SalesDetail"; - DcResponse response = getUserDataWithDcClient(cellName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, @@ -295,7 +295,7 @@ public void deleteUserDataList() { // ユーザデータの一覧取得 String sdEntityTypeName = "SalesDetail"; - DcResponse response = getUserDataWithDcClient(cellName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, @@ -320,7 +320,7 @@ public void deleteUserDataList() { // ユーザデータの一覧取得 String sdEntityTypeName = "SalesDetail"; - DcResponse response = getUserDataWithDcClient(cellName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, @@ -344,7 +344,7 @@ public void deleteUserDataList() { // ユーザデータの一覧取得 String sdEntityTypeName = "SalesDetail"; - DcResponse response = getUserDataWithDcClient(cellName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, @@ -369,7 +369,7 @@ public void deleteUserDataList() { // ユーザデータの一覧取得 String sdEntityTypeName = "SalesDetail"; - DcResponse response = getUserDataWithDcClient(cellName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, @@ -399,7 +399,7 @@ public void deleteUserDataList() { .with("entityType", sdEntityTypeName) .with("query", "?\\$orderby=%27test%27") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -420,7 +420,7 @@ public void deleteUserDataList() { .with("entityType", sdEntityTypeName) .with("query", "?\\$orderby=test%20%27asc%27") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -441,7 +441,7 @@ public void deleteUserDataList() { .with("entityType", sdEntityTypeName) .with("query", "?\\$orderby=") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -462,7 +462,7 @@ public void deleteUserDataList() { .with("entityType", sdEntityTypeName) .with("query", "?\\$orderby=test%20test") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -483,7 +483,7 @@ public void deleteUserDataList() { .with("entityType", sdEntityTypeName) .with("query", "?\\$orderby=test%20ASC") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -756,8 +756,8 @@ public void deleteUserDataList() { UserDataUtils.list(cell, box, collection, entityType, query, MASTER_TOKEN_NAME, HttpStatus.SC_BAD_REQUEST); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); } /** @@ -776,8 +776,8 @@ public void deleteUserDataList() { UserDataUtils.list(cell, box, collection, entityType, query, MASTER_TOKEN_NAME, HttpStatus.SC_BAD_REQUEST); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); } /** @@ -796,8 +796,8 @@ public void deleteUserDataList() { UserDataUtils.list(cell, box, collection, entityType, query, MASTER_TOKEN_NAME, HttpStatus.SC_BAD_REQUEST); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); } /** @@ -816,8 +816,8 @@ public void deleteUserDataList() { UserDataUtils.list(cell, box, collection, entityType, query, MASTER_TOKEN_NAME, HttpStatus.SC_BAD_REQUEST); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); } /************************************************************************************************************/ @@ -949,8 +949,8 @@ public void deleteUserDataList() { UserDataUtils.list(cell, box, collection, entityType, query, MASTER_TOKEN_NAME, HttpStatus.SC_BAD_REQUEST); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); } /** @@ -969,8 +969,8 @@ public void deleteUserDataList() { UserDataUtils.list(cell, box, collection, entityType, query, MASTER_TOKEN_NAME, HttpStatus.SC_BAD_REQUEST); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); } /** @@ -989,8 +989,8 @@ public void deleteUserDataList() { UserDataUtils.list(cell, box, collection, entityType, query, MASTER_TOKEN_NAME, HttpStatus.SC_BAD_REQUEST); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); } /** @@ -1009,8 +1009,8 @@ public void deleteUserDataList() { UserDataUtils.list(cell, box, collection, entityType, query, MASTER_TOKEN_NAME, HttpStatus.SC_BAD_REQUEST); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); } /************************************************************************************************************/ @@ -1142,8 +1142,8 @@ public void deleteUserDataList() { UserDataUtils.list(cell, box, collection, entityType, query, MASTER_TOKEN_NAME, HttpStatus.SC_BAD_REQUEST); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); } /** @@ -1162,8 +1162,8 @@ public void deleteUserDataList() { UserDataUtils.list(cell, box, collection, entityType, query, MASTER_TOKEN_NAME, HttpStatus.SC_BAD_REQUEST); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); } /** @@ -1182,8 +1182,8 @@ public void deleteUserDataList() { UserDataUtils.list(cell, box, collection, entityType, query, MASTER_TOKEN_NAME, HttpStatus.SC_BAD_REQUEST); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); } /** @@ -1202,8 +1202,8 @@ public void deleteUserDataList() { UserDataUtils.list(cell, box, collection, entityType, query, MASTER_TOKEN_NAME, HttpStatus.SC_BAD_REQUEST); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); } /************************************************************************************************************/ @@ -1318,8 +1318,8 @@ public void deleteUserDataList() { UserDataUtils.list(cell, box, collection, entityType, query, MASTER_TOKEN_NAME, HttpStatus.SC_BAD_REQUEST); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); } /** @@ -1338,8 +1338,8 @@ public void deleteUserDataList() { UserDataUtils.list(cell, box, collection, entityType, query, MASTER_TOKEN_NAME, HttpStatus.SC_BAD_REQUEST); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); } /** @@ -1358,8 +1358,8 @@ public void deleteUserDataList() { UserDataUtils.list(cell, box, collection, entityType, query, MASTER_TOKEN_NAME, HttpStatus.SC_BAD_REQUEST); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); } /** @@ -1378,8 +1378,8 @@ public void deleteUserDataList() { UserDataUtils.list(cell, box, collection, entityType, query, MASTER_TOKEN_NAME, HttpStatus.SC_BAD_REQUEST); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), - DcCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getCode(), + PersoniumCoreException.OData.CANNOT_SPECIFY_THE_LIST_TYPE_TO_ORDERBY.getMessage()); } /************************************************************************************************************/ diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListSelectTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataListSelectTest.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListSelectTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataListSelectTest.java index 028713214..82671fd2f 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListSelectTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataListSelectTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -34,25 +34,25 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.odatacol.schema.property.PropertyUtils; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.odatacol.schema.property.PropertyUtils; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; /** * UserData一覧のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataListSelectTest extends AbstractUserDataTest { @@ -133,7 +133,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "?\\$select=dynamicProperty1") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -187,7 +187,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "?\\$select=intProperty") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -240,7 +240,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "?\\$select=floatProperty") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -293,7 +293,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "?\\$select=trueProperty") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -350,7 +350,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "?\\$select=__id") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -396,7 +396,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "?\\$select=__published") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -442,7 +442,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "?\\$select=__updated") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -488,7 +488,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "?\\$select=__metadata") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -536,7 +536,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "?\\$select=__id,__published,__updated,dynamicProperty1,dynamicProperty3") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -584,7 +584,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "?\\$select=onlyExistProperty201") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -635,7 +635,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "?\\$select=dummyProperty") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -686,7 +686,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "?\\$select=dummyProperty") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -741,7 +741,7 @@ public void deleteUserDataList() { + "falseProperty,nullStringProperty,intStringProperty," + "floatStringProperty,trueStringProperty,falseStringProperty") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -816,7 +816,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "?\\$select=dynamicProperty1,dinamicProperty2") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -869,7 +869,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "?\\$select=noneExistProperty1,noneExistProperty2") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -919,7 +919,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "?\\$select=*") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -976,7 +976,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "?\\$select=") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -1003,7 +1003,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "?\\$select=!") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -1034,7 +1034,7 @@ public void deleteUserDataList() { + "dynamicProperty2+eq+%27dynamicPropertyValueB%27" + "&\\$select=dynamicProperty1,dynamicProperty2") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -1086,7 +1086,7 @@ public void deleteUserDataList() { + "dynamicProperty2+eq+%27dynamicPropertyValue2%27" + "&\\$select=dynamicProperty1,dynamicProperty2") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -1144,7 +1144,7 @@ public void deleteUserDataList() { body.put("complexProperty", complexBody); body.put("dynamicProperty", "dynamicStringProperty"); complexBody.put("complexStringProperty", "complexStringProprty"); - DcResponse createResponse = createUserDataWithDcClient(Setup.TEST_CELL1, Setup.TEST_BOX1, + PersoniumResponse createResponse = createUserDataWithDcClient(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, "selectTestEntity", body); userdataUrl = createResponse.getFirstHeader(HttpHeaders.LOCATION); @@ -1193,7 +1193,7 @@ public void deleteUserDataList() { body.put("complexProperty", complexBody); body.put("dynamicProperty", "dynamicStringProperty"); complexBody.put("complexStringProperty", "complexStringProprty"); - DcResponse createResponse = createUserDataWithDcClient(Setup.TEST_CELL1, Setup.TEST_BOX1, + PersoniumResponse createResponse = createUserDataWithDcClient(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, "selectTestEntity", body); userdataUrl = createResponse.getFirstHeader(HttpHeaders.LOCATION); @@ -1242,7 +1242,7 @@ public void deleteUserDataList() { body.put("complexProperty", complexBody); body.put("dynamicProperty", "dynamicStringProperty"); complexBody.put("complexStringProperty", "complexStringProprty"); - DcResponse createResponse = createUserDataWithDcClient(Setup.TEST_CELL1, Setup.TEST_BOX1, + PersoniumResponse createResponse = createUserDataWithDcClient(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, "selectTestEntity", body); userdataUrl = createResponse.getFirstHeader(HttpHeaders.LOCATION); @@ -1291,7 +1291,7 @@ public void deleteUserDataList() { body.put("complexProperty", complexBody); body.put("dynamicProperty", "dynamicStringProperty"); complexBody.put("complexStringProperty", "complexStringProprty"); - DcResponse createResponse = createUserDataWithDcClient(Setup.TEST_CELL1, Setup.TEST_BOX1, + PersoniumResponse createResponse = createUserDataWithDcClient(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, "selectTestEntity", body); userdataUrl = createResponse.getFirstHeader(HttpHeaders.LOCATION); @@ -1340,7 +1340,7 @@ public void deleteUserDataList() { body.put("complexProperty", complexBody); body.put("dynamicProperty", "dynamicStringProperty"); complexBody.put("complexStringProperty", "complexStringProprty"); - DcResponse createResponse = createUserDataWithDcClient(Setup.TEST_CELL1, Setup.TEST_BOX1, + PersoniumResponse createResponse = createUserDataWithDcClient(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, "selectTestEntity", body); userdataUrl = createResponse.getFirstHeader(HttpHeaders.LOCATION); @@ -1389,7 +1389,7 @@ public void deleteUserDataList() { body.put("complexProperty", complexBody); body.put("dynamicProperty", "dynamicStringProperty"); complexBody.put("complexStringProperty", "complexStringProprty"); - DcResponse createResponse = createUserDataWithDcClient(Setup.TEST_CELL1, Setup.TEST_BOX1, + PersoniumResponse createResponse = createUserDataWithDcClient(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, "selectTestEntity", body); userdataUrl = createResponse.getFirstHeader(HttpHeaders.LOCATION); @@ -1559,7 +1559,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "?\\$select='dynamicProperty1'") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -1607,7 +1607,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "?\\$select=" + propertyDouble) .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -1697,7 +1697,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "?\\$select=" + propertyDouble) .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -1794,7 +1794,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "?\\$select=" + propertyDouble + "&\\$orderby=dynamicProperty1") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -1897,7 +1897,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "?\\$select=" + propertyDouble) .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataListTest.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataListTest.java index bd0135adc..efac2dd2b 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataListTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; @@ -33,25 +33,25 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.odatacol.schema.property.PropertyUtils; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.odatacol.schema.property.PropertyUtils; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; import java.util.Arrays; /** * UserData一覧のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataListTest extends AbstractUserDataTest { @@ -134,7 +134,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -199,7 +199,7 @@ public void deleteUserDataList() { ODataCommon.checkResponseBodyList(response.bodyAsJson(), null, nameSpace, additional); } finally { deleteUserData(cellName, boxName, linkColName, linkEntityTypeName, - "parent", DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + "parent", PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } // B(0..1) - A(0..1) | B(1) - D(*) @@ -223,7 +223,7 @@ public void deleteUserDataList() { ODataCommon.checkResponseBodyList(response.bodyAsJson(), null, nameSpace, additional); } finally { deleteUserData(cellName, boxName, linkColName, linkEntityTypeName, - "parent", DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + "parent", PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } // C(1) - A(0..1) |C(*) - D(*) @@ -247,7 +247,7 @@ public void deleteUserDataList() { ODataCommon.checkResponseBodyList(response.bodyAsJson(), null, nameSpace, additional); } finally { deleteUserData(cellName, boxName, linkColName, linkEntityTypeName, - "parent", DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + "parent", PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } // D(*) - A(0..1) | D(*) - B(1) | D(*) - C(*) @@ -272,7 +272,7 @@ public void deleteUserDataList() { ODataCommon.checkResponseBodyList(response.bodyAsJson(), null, nameSpace, additional); } finally { deleteUserData(cellName, boxName, linkColName, linkEntityTypeName, - "parent", DcCoreConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); + "parent", PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -290,7 +290,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -339,7 +339,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -385,7 +385,7 @@ public void deleteUserDataList() { // ユーザデータの一覧取得 String sdEntityTypeName = "SalesDetail"; - DcResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, ""); + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, ""); // レスポンスボディーのチェック.__countが存在しないことを確認する ODataCommon.checkResponseBodyCount(response.bodyAsJson(), ODataCommon.COUNT_NONE); @@ -399,7 +399,7 @@ public void deleteUserDataList() { // ユーザデータの一覧取得 String sdEntityTypeName = "SalesDetail"; - DcResponse response = getUserDataWithDcClient(cellName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, @@ -417,7 +417,7 @@ public void deleteUserDataList() { // ユーザデータの一覧取得 String sdEntityTypeName = "SalesDetail"; - DcResponse response = getUserDataWithDcClient(cellName, + PersoniumResponse response = getUserDataWithDcClient(cellName, boxName, colName, sdEntityTypeName, @@ -442,7 +442,7 @@ public void deleteUserDataList() { .with("entityType", sdEntityTypeName) .with("query", "?\\$inlinecount=") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -463,7 +463,7 @@ public void deleteUserDataList() { .with("entityType", sdEntityTypeName) .with("query", "?\\$inlinecount=xxx") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); @@ -494,7 +494,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "?\\$orderby=dynamicProperty") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -542,7 +542,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "?\\$format=atom") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -586,7 +586,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "?\\$format=json") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -630,7 +630,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "") .with("accept", MediaType.APPLICATION_ATOM_XML) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -673,7 +673,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "") .with("accept", MediaType.APPLICATION_XML) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -722,7 +722,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -786,7 +786,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -850,7 +850,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -914,7 +914,7 @@ public void deleteUserDataList() { .with("entityType", entityTypeName) .with("query", "") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListTopSkipTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataListTopSkipTest.java similarity index 79% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListTopSkipTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataListTopSkipTest.java index 1fac2743d..35621d36f 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListTopSkipTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataListTopSkipTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; @@ -31,25 +31,25 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * UserData一覧のテスト_$top_$skip. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataListTopSkipTest extends AbstractUserDataTest { - int topMaxNum = DcCoreConfig.getTopQueryMaxSize(); - int skipMaxNum = DcCoreConfig.getSkipQueryMaxSize(); + int topMaxNum = PersoniumUnitConfig.getTopQueryMaxSize(); + int skipMaxNum = PersoniumUnitConfig.getSkipQueryMaxSize(); /** * コンストラクタ. @@ -71,12 +71,12 @@ public UserDataListTopSkipTest() { .with("entityType", entityTypeName) .with("query", "?\\$top=-1") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.QUERY_INVALID_ERROR.getCode(), - DcCoreException.OData.QUERY_INVALID_ERROR.params("$top", -1).getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.QUERY_INVALID_ERROR.getCode(), + PersoniumCoreException.OData.QUERY_INVALID_ERROR.params("$top", -1).getMessage()); } /** @@ -106,7 +106,7 @@ public UserDataListTopSkipTest() { .with("entityType", entityTypeName) .with("query", "?\\$top=0") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -147,7 +147,7 @@ public UserDataListTopSkipTest() { .with("entityType", entityTypeName) .with("query", "?\\$top=" + top) .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -174,12 +174,12 @@ public UserDataListTopSkipTest() { .with("entityType", entityTypeName) .with("query", "?\\$top=" + top) .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.QUERY_INVALID_ERROR.getCode(), - DcCoreException.OData.QUERY_INVALID_ERROR.params("$top", top).getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.QUERY_INVALID_ERROR.getCode(), + PersoniumCoreException.OData.QUERY_INVALID_ERROR.params("$top", top).getMessage()); } /** @@ -195,12 +195,12 @@ public UserDataListTopSkipTest() { .with("entityType", entityTypeName) .with("query", "?\\$top=%27test%27") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.getCode(), - DcCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.params("$top").getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.getCode(), + PersoniumCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.params("$top").getMessage()); } /** @@ -216,12 +216,12 @@ public UserDataListTopSkipTest() { .with("entityType", entityTypeName) .with("query", "?\\$top=") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.getCode(), - DcCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.params("$top").getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.getCode(), + PersoniumCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.params("$top").getMessage()); } /** @@ -237,12 +237,12 @@ public UserDataListTopSkipTest() { .with("entityType", entityTypeName) .with("query", "?\\$skip=-1") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.QUERY_INVALID_ERROR.getCode(), - DcCoreException.OData.QUERY_INVALID_ERROR.params("$skip", "-1").getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.QUERY_INVALID_ERROR.getCode(), + PersoniumCoreException.OData.QUERY_INVALID_ERROR.params("$skip", "-1").getMessage()); } /** @@ -272,7 +272,7 @@ public UserDataListTopSkipTest() { .with("entityType", entityTypeName) .with("query", "?\\$skip=0") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -313,7 +313,7 @@ public UserDataListTopSkipTest() { .with("entityType", entityTypeName) .with("query", "?\\$skip=" + skip) .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -340,12 +340,12 @@ public UserDataListTopSkipTest() { .with("entityType", entityTypeName) .with("query", "?\\$skip=" + skip) .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.QUERY_INVALID_ERROR.getCode(), - DcCoreException.OData.QUERY_INVALID_ERROR.params("$skip", skip).getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.QUERY_INVALID_ERROR.getCode(), + PersoniumCoreException.OData.QUERY_INVALID_ERROR.params("$skip", skip).getMessage()); } /** @@ -361,12 +361,12 @@ public UserDataListTopSkipTest() { .with("entityType", entityTypeName) .with("query", "?\\$skip=%27test%27") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.getCode(), - DcCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.params("$skip").getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.getCode(), + PersoniumCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.params("$skip").getMessage()); } /** @@ -382,11 +382,11 @@ public UserDataListTopSkipTest() { .with("entityType", entityTypeName) .with("query", "?\\$skip=") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.getCode(), - DcCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.params("$skip").getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.getCode(), + PersoniumCoreException.OData.QUERY_PARSE_ERROR_WITH_PARAM.params("$skip").getMessage()); } } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListWithNPDeclaredDoubleTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataListWithNPDeclaredDoubleTest.java similarity index 85% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListWithNPDeclaredDoubleTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataListWithNPDeclaredDoubleTest.java index bc9c8e239..a50632f52 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListWithNPDeclaredDoubleTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataListWithNPDeclaredDoubleTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; @@ -31,24 +31,24 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.box.odatacol.schema.property.PropertyUtils; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AssociationEndUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.box.odatacol.schema.property.PropertyUtils; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AssociationEndUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.UserDataUtils; /** * UserDataのDouble型へのNP経由検索テスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataListWithNPDeclaredDoubleTest extends AbstractUserDataTest { @@ -70,9 +70,9 @@ public UserDataListWithNPDeclaredDoubleTest() { String srcId = "srcId"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, srcEntityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, srcEntityTypeName, HttpStatus.SC_CREATED); - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, targetEntityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, targetEntityTypeName, HttpStatus.SC_CREATED); // AssociationEndの作成と紐づけ @@ -93,10 +93,10 @@ public UserDataListWithNPDeclaredDoubleTest() { String searchRequestUrl = UrlUtils.userdataNP(cellName, boxName, colName, srcEntityTypeName, srcId, targetEntityTypeName) + "?$filter=" + propertyName + "+eq+12345.12345&$inlinecount=allpages"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -124,9 +124,9 @@ public UserDataListWithNPDeclaredDoubleTest() { String srcId = "srcId"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, srcEntityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, srcEntityTypeName, HttpStatus.SC_CREATED); - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, targetEntityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, targetEntityTypeName, HttpStatus.SC_CREATED); // AssociationEndの作成と紐づけ @@ -147,10 +147,10 @@ public UserDataListWithNPDeclaredDoubleTest() { String searchRequestUrl = UrlUtils.userdataNP(cellName, boxName, colName, srcEntityTypeName, srcId, targetEntityTypeName) + "?$filter=" + propertyName + "+eq+1&$inlinecount=allpages&$orderby=__id"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -181,9 +181,9 @@ public UserDataListWithNPDeclaredDoubleTest() { String srcId = "srcId"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, srcEntityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, srcEntityTypeName, HttpStatus.SC_CREATED); - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, targetEntityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, targetEntityTypeName, HttpStatus.SC_CREATED); // AssociationEndの作成と紐づけ @@ -204,10 +204,10 @@ public UserDataListWithNPDeclaredDoubleTest() { String searchRequestUrl = UrlUtils.userdataNP(cellName, boxName, colName, srcEntityTypeName, srcId, targetEntityTypeName) + "?$filter=" + propertyName + "+eq+1.0&$inlinecount=allpages&$orderby=__id"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -238,9 +238,9 @@ public UserDataListWithNPDeclaredDoubleTest() { String srcId = "srcId"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, srcEntityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, srcEntityTypeName, HttpStatus.SC_CREATED); - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, targetEntityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, targetEntityTypeName, HttpStatus.SC_CREATED); // AssociationEndの作成と紐づけ @@ -261,10 +261,10 @@ public UserDataListWithNPDeclaredDoubleTest() { String searchRequestUrl = UrlUtils.userdataNP(cellName, boxName, colName, srcEntityTypeName, srcId, targetEntityTypeName) + "?$filter=" + propertyName + "+gt+1.0&$inlinecount=allpages&$orderby=__id"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -299,9 +299,9 @@ public UserDataListWithNPDeclaredDoubleTest() { String srcId = "srcId"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, srcEntityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, srcEntityTypeName, HttpStatus.SC_CREATED); - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, targetEntityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, targetEntityTypeName, HttpStatus.SC_CREATED); // AssociationEndの作成と紐づけ @@ -322,10 +322,10 @@ public UserDataListWithNPDeclaredDoubleTest() { String searchRequestUrl = UrlUtils.userdataNP(cellName, boxName, colName, srcEntityTypeName, srcId, targetEntityTypeName) + "?$filter=" + propertyName + "+le+0&$inlinecount=allpages&$orderby=__id"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -357,9 +357,9 @@ public UserDataListWithNPDeclaredDoubleTest() { String srcId = "srcId"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, srcEntityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, srcEntityTypeName, HttpStatus.SC_CREATED); - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, targetEntityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, targetEntityTypeName, HttpStatus.SC_CREATED); // AssociationEndの作成と紐づけ @@ -380,10 +380,10 @@ public UserDataListWithNPDeclaredDoubleTest() { String searchRequestUrl = UrlUtils.userdataNP(cellName, boxName, colName, srcEntityTypeName, srcId, targetEntityTypeName) + "?$filter=" + propertyName + "+eq+null&$inlinecount=allpages&$orderby=__id"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -414,9 +414,9 @@ public UserDataListWithNPDeclaredDoubleTest() { String srcId = "srcId"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, srcEntityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, srcEntityTypeName, HttpStatus.SC_CREATED); - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, targetEntityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, targetEntityTypeName, HttpStatus.SC_CREATED); // AssociationEndの作成と紐づけ @@ -437,10 +437,10 @@ public UserDataListWithNPDeclaredDoubleTest() { String searchRequestUrl = UrlUtils.userdataNP(cellName, boxName, colName, srcEntityTypeName, srcId, targetEntityTypeName) + "?$filter=" + propertyName + "+eq+1.79E308&$inlinecount=allpages&$orderby=__id"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -470,9 +470,9 @@ public UserDataListWithNPDeclaredDoubleTest() { String srcId = "srcId"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, srcEntityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, srcEntityTypeName, HttpStatus.SC_CREATED); - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, targetEntityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, targetEntityTypeName, HttpStatus.SC_CREATED); // AssociationEndの作成と紐づけ @@ -493,10 +493,10 @@ public UserDataListWithNPDeclaredDoubleTest() { String searchRequestUrl = UrlUtils.userdataNP(cellName, boxName, colName, srcEntityTypeName, srcId, targetEntityTypeName) + "?$filter=" + propertyName + "+eq+--1.79E308&$inlinecount=allpages&$orderby=__id"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -524,9 +524,9 @@ public UserDataListWithNPDeclaredDoubleTest() { String srcId = "srcId"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, srcEntityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, srcEntityTypeName, HttpStatus.SC_CREATED); - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, targetEntityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, targetEntityTypeName, HttpStatus.SC_CREATED); // AssociationEndの作成と紐づけ @@ -555,10 +555,10 @@ public UserDataListWithNPDeclaredDoubleTest() { String searchRequestUrl = UrlUtils.userdataNP(cellName, boxName, colName, srcEntityTypeName, srcId, targetEntityTypeName) + "?$filter=" + propertyName + "+eq+1.0&$inlinecount=allpages&$orderby=__id"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -589,9 +589,9 @@ public UserDataListWithNPDeclaredDoubleTest() { String srcId = "srcId"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, srcEntityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, srcEntityTypeName, HttpStatus.SC_CREATED); - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, targetEntityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, targetEntityTypeName, HttpStatus.SC_CREATED); // AssociationEndの作成と紐づけ @@ -620,10 +620,10 @@ public UserDataListWithNPDeclaredDoubleTest() { String searchRequestUrl = UrlUtils.userdataNP(cellName, boxName, colName, srcEntityTypeName, srcId, targetEntityTypeName) + "?$filter=" + propertyName + "+gt+1.234&$inlinecount=allpages&$orderby=__id"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -657,9 +657,9 @@ public UserDataListWithNPDeclaredDoubleTest() { String srcId = "srcId"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, srcEntityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, srcEntityTypeName, HttpStatus.SC_CREATED); - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, targetEntityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, targetEntityTypeName, HttpStatus.SC_CREATED); // AssociationEndの作成と紐づけ @@ -680,10 +680,10 @@ public UserDataListWithNPDeclaredDoubleTest() { String searchRequestUrl = UrlUtils.userdataNP(cellName, boxName, colName, srcEntityTypeName, srcId, targetEntityTypeName) + "?$orderby=" + propertyName + "+asc,__id&$inlinecount=allpages"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -732,9 +732,9 @@ public UserDataListWithNPDeclaredDoubleTest() { String srcId = "srcId"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, srcEntityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, srcEntityTypeName, HttpStatus.SC_CREATED); - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, targetEntityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, targetEntityTypeName, HttpStatus.SC_CREATED); // AssociationEndの作成と紐づけ @@ -755,10 +755,10 @@ public UserDataListWithNPDeclaredDoubleTest() { String searchRequestUrl = UrlUtils.userdataNP(cellName, boxName, colName, srcEntityTypeName, srcId, targetEntityTypeName) + "?$orderby=" + propertyName + "+desc,__id&$inlinecount=allpages"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -807,9 +807,9 @@ public UserDataListWithNPDeclaredDoubleTest() { String srcId = "srcId"; try { // Doubleの検索のテスト用エンティティタイプ作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, srcEntityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, srcEntityTypeName, HttpStatus.SC_CREATED); - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, targetEntityTypeName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, targetEntityTypeName, HttpStatus.SC_CREATED); // AssociationEndの作成と紐づけ @@ -838,10 +838,10 @@ public UserDataListWithNPDeclaredDoubleTest() { String searchRequestUrl = UrlUtils.userdataNP(cellName, boxName, colName, srcEntityTypeName, srcId, targetEntityTypeName) + "?$orderby=" + propertyName + ",__id&$inlinecount=allpages"; - DcRequest req = DcRequest.get(searchRequestUrl); + PersoniumRequest req = PersoniumRequest.get(searchRequestUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse searchResponse = request(req); + PersoniumResponse searchResponse = request(req); assertEquals(HttpStatus.SC_OK, searchResponse.getStatusCode()); JSONObject responseBody = searchResponse.bodyAsJson(); @@ -897,42 +897,42 @@ protected void createTestData(String srcEntityTypeName, String srcId, JSONObject body = new JSONObject(); body.put("__id", "doubleMax"); body.put(targetPropertyName, 1.79E308); - UserDataUtils.createViaNP(DcCoreConfig.getMasterToken(), body, cellName, boxName, colName, + UserDataUtils.createViaNP(PersoniumUnitConfig.getMasterToken(), body, cellName, boxName, colName, srcEntityTypeName, srcId, targetEntityTypeName, HttpStatus.SC_CREATED); body.put("__id", "double"); body.put(targetPropertyName, 12345.12345); - UserDataUtils.createViaNP(DcCoreConfig.getMasterToken(), body, cellName, boxName, colName, + UserDataUtils.createViaNP(PersoniumUnitConfig.getMasterToken(), body, cellName, boxName, colName, srcEntityTypeName, srcId, targetEntityTypeName, HttpStatus.SC_CREATED); body.put("__id", "doubleString"); body.put(targetPropertyName, "1.2345"); - UserDataUtils.createViaNP(DcCoreConfig.getMasterToken(), body, cellName, boxName, colName, + UserDataUtils.createViaNP(PersoniumUnitConfig.getMasterToken(), body, cellName, boxName, colName, srcEntityTypeName, srcId, targetEntityTypeName, HttpStatus.SC_CREATED); body.put("__id", "doubleNatural"); body.put(targetPropertyName, 1); - UserDataUtils.createViaNP(DcCoreConfig.getMasterToken(), body, cellName, boxName, colName, + UserDataUtils.createViaNP(PersoniumUnitConfig.getMasterToken(), body, cellName, boxName, colName, srcEntityTypeName, srcId, targetEntityTypeName, HttpStatus.SC_CREATED); body.put("__id", "doubleDecimal"); body.put(targetPropertyName, 1.0); - UserDataUtils.createViaNP(DcCoreConfig.getMasterToken(), body, cellName, boxName, colName, + UserDataUtils.createViaNP(PersoniumUnitConfig.getMasterToken(), body, cellName, boxName, colName, srcEntityTypeName, srcId, targetEntityTypeName, HttpStatus.SC_CREATED); body.put("__id", "doubleZero"); body.put(targetPropertyName, 0.0); - UserDataUtils.createViaNP(DcCoreConfig.getMasterToken(), body, cellName, boxName, colName, + UserDataUtils.createViaNP(PersoniumUnitConfig.getMasterToken(), body, cellName, boxName, colName, srcEntityTypeName, srcId, targetEntityTypeName, HttpStatus.SC_CREATED); body.put("__id", "doubleMin"); body.put(targetPropertyName, -1.79e308); - UserDataUtils.createViaNP(DcCoreConfig.getMasterToken(), body, cellName, boxName, colName, + UserDataUtils.createViaNP(PersoniumUnitConfig.getMasterToken(), body, cellName, boxName, colName, srcEntityTypeName, srcId, targetEntityTypeName, HttpStatus.SC_CREATED); body.put("__id", "doubleNull"); body.put(targetPropertyName, null); - UserDataUtils.createViaNP(DcCoreConfig.getMasterToken(), body, cellName, boxName, colName, + UserDataUtils.createViaNP(PersoniumUnitConfig.getMasterToken(), body, cellName, boxName, colName, srcEntityTypeName, srcId, targetEntityTypeName, HttpStatus.SC_CREATED); } @@ -946,18 +946,18 @@ protected void createTestData(String srcEntityTypeName, String srcId, protected void deleteTestData(String srcEntityTypeName, String srcId, String targetEntityTypeName, String propertyName) { // ターゲット側のUserODataの削除 - UserDataUtils.delete(DcCoreConfig.getMasterToken(), -1, targetEntityTypeName, "doubleInt", colName); - UserDataUtils.delete(DcCoreConfig.getMasterToken(), -1, targetEntityTypeName, "double", colName); - UserDataUtils.delete(DcCoreConfig.getMasterToken(), -1, targetEntityTypeName, "doubleZero", colName); - UserDataUtils.delete(DcCoreConfig.getMasterToken(), -1, targetEntityTypeName, "doubleNull", colName); - UserDataUtils.delete(DcCoreConfig.getMasterToken(), -1, targetEntityTypeName, "doubleMax", colName); - UserDataUtils.delete(DcCoreConfig.getMasterToken(), -1, targetEntityTypeName, "doubleMin", colName); - UserDataUtils.delete(DcCoreConfig.getMasterToken(), -1, targetEntityTypeName, "doubleString", colName); - UserDataUtils.delete(DcCoreConfig.getMasterToken(), -1, targetEntityTypeName, "doubleNatural", colName); - UserDataUtils.delete(DcCoreConfig.getMasterToken(), -1, targetEntityTypeName, "doubleDecimal", colName); + UserDataUtils.delete(PersoniumUnitConfig.getMasterToken(), -1, targetEntityTypeName, "doubleInt", colName); + UserDataUtils.delete(PersoniumUnitConfig.getMasterToken(), -1, targetEntityTypeName, "double", colName); + UserDataUtils.delete(PersoniumUnitConfig.getMasterToken(), -1, targetEntityTypeName, "doubleZero", colName); + UserDataUtils.delete(PersoniumUnitConfig.getMasterToken(), -1, targetEntityTypeName, "doubleNull", colName); + UserDataUtils.delete(PersoniumUnitConfig.getMasterToken(), -1, targetEntityTypeName, "doubleMax", colName); + UserDataUtils.delete(PersoniumUnitConfig.getMasterToken(), -1, targetEntityTypeName, "doubleMin", colName); + UserDataUtils.delete(PersoniumUnitConfig.getMasterToken(), -1, targetEntityTypeName, "doubleString", colName); + UserDataUtils.delete(PersoniumUnitConfig.getMasterToken(), -1, targetEntityTypeName, "doubleNatural", colName); + UserDataUtils.delete(PersoniumUnitConfig.getMasterToken(), -1, targetEntityTypeName, "doubleDecimal", colName); // ソース側のUserODataの削除 - UserDataUtils.delete(DcCoreConfig.getMasterToken(), -1, srcEntityTypeName, srcId, colName); + UserDataUtils.delete(PersoniumUnitConfig.getMasterToken(), -1, srcEntityTypeName, srcId, colName); // AssociationEndの削除 AssociationEndUtils.delete(AbstractCase.MASTER_TOKEN_NAME, cellName, colName, srcEntityTypeName, boxName, @@ -970,9 +970,9 @@ protected void deleteTestData(String srcEntityTypeName, String srcId, propertyName, -1); // EntityTypeの削除 - EntityTypeUtils.delete(colName, DcCoreConfig.getMasterToken(), + EntityTypeUtils.delete(colName, PersoniumUnitConfig.getMasterToken(), MediaType.APPLICATION_JSON, srcEntityTypeName, boxName, cellName, -1); - EntityTypeUtils.delete(colName, DcCoreConfig.getMasterToken(), + EntityTypeUtils.delete(colName, PersoniumUnitConfig.getMasterToken(), MediaType.APPLICATION_JSON, targetEntityTypeName, boxName, cellName, -1); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListWithNPLimitTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataListWithNPLimitTest.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListWithNPLimitTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataListWithNPLimitTest.java index 0ac761c39..d5d557f07 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListWithNPLimitTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataListWithNPLimitTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; @@ -32,18 +32,18 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.utils.AssociationEndUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.utils.AssociationEndUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; @@ -51,16 +51,16 @@ * UserDataのNavigationProperty経由一覧のテスト. * たくさんデータを登録するので、「Integration.class, Regression.class」では動作しない。 */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class }) public class UserDataListWithNPLimitTest extends JerseyTest { private static final Map INIT_PARAMS = new HashMap(); static { - INIT_PARAMS.put("com.sun.jersey.config.property.packages", "com.fujitsu.dc.core.rs"); + INIT_PARAMS.put("com.sun.jersey.config.property.packages", "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } String masterToken = Setup.MASTER_TOKEN_NAME; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListWithNPQueryTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataListWithNPQueryTest.java similarity index 79% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListWithNPQueryTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataListWithNPQueryTest.java index 01c22fd91..15f7b9555 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListWithNPQueryTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataListWithNPQueryTest.java @@ -14,29 +14,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import org.apache.http.HttpStatus; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; /** * UserDataのNavigationProperty経由一覧のクエリに関するテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataListWithNPQueryTest extends AbstractCase { @@ -44,7 +44,7 @@ public class UserDataListWithNPQueryTest extends AbstractCase { * コンストラクタ. */ public UserDataListWithNPQueryTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -89,8 +89,8 @@ public UserDataListWithNPQueryTest() { TResponse res = UserDataUtils.listViaNP(cell, box, collection, fromEntity, fromUserDataId, toEntity, expands, HttpStatus.SC_BAD_REQUEST); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.EXPAND_COUNT_LIMITATION_EXCEEDED.getCode(), - DcCoreException.OData.EXPAND_COUNT_LIMITATION_EXCEEDED.getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.EXPAND_COUNT_LIMITATION_EXCEEDED.getCode(), + PersoniumCoreException.OData.EXPAND_COUNT_LIMITATION_EXCEEDED.getMessage()); } /** @@ -107,7 +107,7 @@ public UserDataListWithNPQueryTest() { String expandEntity1 = "Price"; String expandEntity2 = "Product"; String fromUserDataId = "userdata000"; - int top = DcCoreConfig.getTopQueryMaxSizeWithExpand(); + int top = PersoniumUnitConfig.getTopQueryMaxSizeWithExpand(); // NP経由一覧取得($expand) String query = String.format("?\\$expand=_%s,_%s&\\$top=%d", expandEntity1, expandEntity2, top); @@ -129,7 +129,7 @@ public UserDataListWithNPQueryTest() { String expandEntity1 = "Price"; String expandEntity2 = "Product"; String fromUserDataId = "userdata000"; - int top = DcCoreConfig.getTopQueryMaxSizeWithExpand() + 1; + int top = PersoniumUnitConfig.getTopQueryMaxSizeWithExpand() + 1; // NP経由一覧取得($expand) String query = String.format("?\\$expand=_%s,_%s&\\$top=%d", expandEntity1, expandEntity2, top); @@ -137,8 +137,8 @@ public UserDataListWithNPQueryTest() { HttpStatus.SC_BAD_REQUEST); ODataCommon.checkErrorResponseBody(res, - DcCoreException.OData.QUERY_INVALID_ERROR.params("$top", String.valueOf(top)).getCode(), - DcCoreException.OData.QUERY_INVALID_ERROR.params("$top", String.valueOf(top)).getMessage()); + PersoniumCoreException.OData.QUERY_INVALID_ERROR.params("$top", String.valueOf(top)).getCode(), + PersoniumCoreException.OData.QUERY_INVALID_ERROR.params("$top", String.valueOf(top)).getMessage()); } } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListWithNPTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataListWithNPTest.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListWithNPTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataListWithNPTest.java index dd784a420..fbdf3fada 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataListWithNPTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataListWithNPTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -31,26 +31,26 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * UserDataのNavigationProperty経由一覧のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataListWithNPTest extends AbstractUserDataWithNP { - int topMaxNum = DcCoreConfig.getTopQueryMaxSize(); - int skipMaxNum = DcCoreConfig.getSkipQueryMaxSize(); + int topMaxNum = PersoniumUnitConfig.getTopQueryMaxSize(); + int skipMaxNum = PersoniumUnitConfig.getSkipQueryMaxSize(); /** * コンストラクタ. @@ -75,12 +75,12 @@ public UserDataListWithNPTest() { .with("entityType", "_" + ENTITY_TYPE_B + "('xxx')") .with("query", "") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); } finally { - deleteUserData(cellName, boxName, colName, ENTITY_TYPE_A, "parent", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, ENTITY_TYPE_A, "parent", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -100,12 +100,12 @@ public UserDataListWithNPTest() { .with("entityType", "_test") .with("query", "") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_NOT_FOUND) .debug(); } finally { - deleteUserData(cellName, boxName, colName, ENTITY_TYPE_A, "parent", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, ENTITY_TYPE_A, "parent", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -122,7 +122,7 @@ public UserDataListWithNPTest() { .with("entityType", "_" + ENTITY_TYPE_B) .with("query", "") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_NOT_FOUND) .debug(); @@ -146,7 +146,7 @@ public UserDataListWithNPTest() { String nameSpace = getNameSpace(entityTypeName); ODataCommon.checkResponseBodyList(response.bodyAsJson(), null, nameSpace, null); } finally { - deleteUserData(cellName, boxName, colName, ENTITY_TYPE_A, "parent", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, ENTITY_TYPE_A, "parent", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -168,7 +168,7 @@ public UserDataListWithNPTest() { String nameSpace = getNameSpace(entityTypeName); ODataCommon.checkResponseBodyList(response.bodyAsJson(), null, nameSpace, null); } finally { - deleteUserData(cellName, boxName, colName, ENTITY_TYPE_A, "parent", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, ENTITY_TYPE_A, "parent", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -190,7 +190,7 @@ public UserDataListWithNPTest() { String nameSpace = getNameSpace(entityTypeName); ODataCommon.checkResponseBodyList(response.bodyAsJson(), null, nameSpace, null); } finally { - deleteUserData(cellName, boxName, colName, ENTITY_TYPE_A, "parent", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, ENTITY_TYPE_A, "parent", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -211,7 +211,7 @@ public UserDataListWithNPTest() { String nameSpace = getNameSpace(entityTypeName); ODataCommon.checkResponseBodyList(response.bodyAsJson(), null, nameSpace, null); } finally { - deleteUserData(cellName, boxName, colName, ENTITY_TYPE_C, "parent", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, ENTITY_TYPE_C, "parent", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -232,7 +232,7 @@ public UserDataListWithNPTest() { String nameSpace = getNameSpace(entityTypeName); ODataCommon.checkResponseBodyList(response.bodyAsJson(), null, nameSpace, null); } finally { - deleteUserData(cellName, boxName, colName, ENTITY_TYPE_B, "parent", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, ENTITY_TYPE_B, "parent", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -253,7 +253,7 @@ public UserDataListWithNPTest() { String nameSpace = getNameSpace(entityTypeName); ODataCommon.checkResponseBodyList(response.bodyAsJson(), null, nameSpace, null); } finally { - deleteUserData(cellName, boxName, colName, ENTITY_TYPE_D, "parent", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, ENTITY_TYPE_D, "parent", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -274,7 +274,7 @@ public UserDataListWithNPTest() { String nameSpace = getNameSpace(entityTypeName); ODataCommon.checkResponseBodyList(response.bodyAsJson(), null, nameSpace, null); } finally { - deleteUserData(cellName, boxName, colName, ENTITY_TYPE_D, "parent", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, ENTITY_TYPE_D, "parent", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -295,7 +295,7 @@ public UserDataListWithNPTest() { String nameSpace = getNameSpace(entityTypeName); ODataCommon.checkResponseBodyList(response.bodyAsJson(), null, nameSpace, null); } finally { - deleteUserData(cellName, boxName, colName, ENTITY_TYPE_C, "parent", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, ENTITY_TYPE_C, "parent", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -524,7 +524,7 @@ public UserDataListWithNPTest() { .with("entityType", "_" + ENTITY_TYPE_D) .with("query", "?\\$inlinecount=allpages") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -536,7 +536,7 @@ public UserDataListWithNPTest() { String nameSpace = getNameSpace(entityTypeName); ODataCommon.checkResponseBodyList(response.bodyAsJson(), null, nameSpace, null, 0); } finally { - deleteUserData(cellName, boxName, colName, ENTITY_TYPE_C, "parent", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, ENTITY_TYPE_C, "parent", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -667,12 +667,12 @@ public UserDataListWithNPTest() { .with("entityType", "_" + ENTITY_TYPE_D) .with("query", query) .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.QUERY_INVALID_ERROR.getCode(), - DcCoreException.OData.QUERY_INVALID_ERROR.params("$top", top).getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.QUERY_INVALID_ERROR.getCode(), + PersoniumCoreException.OData.QUERY_INVALID_ERROR.params("$top", top).getMessage()); } /** @@ -689,12 +689,12 @@ public UserDataListWithNPTest() { .with("entityType", "_" + ENTITY_TYPE_D) .with("query", query) .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.QUERY_INVALID_ERROR.getCode(), - DcCoreException.OData.QUERY_INVALID_ERROR.params("$top", "-1").getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.QUERY_INVALID_ERROR.getCode(), + PersoniumCoreException.OData.QUERY_INVALID_ERROR.params("$top", "-1").getMessage()); } /** @@ -761,12 +761,12 @@ public UserDataListWithNPTest() { .with("entityType", "_" + ENTITY_TYPE_D) .with("query", query) .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.QUERY_INVALID_ERROR.getCode(), - DcCoreException.OData.QUERY_INVALID_ERROR.params("$skip", "-1").getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.QUERY_INVALID_ERROR.getCode(), + PersoniumCoreException.OData.QUERY_INVALID_ERROR.params("$skip", "-1").getMessage()); } /** @@ -785,12 +785,12 @@ public UserDataListWithNPTest() { .with("entityType", "_" + ENTITY_TYPE_D) .with("query", query) .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) .debug(); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.QUERY_INVALID_ERROR.getCode(), - DcCoreException.OData.QUERY_INVALID_ERROR.params("$skip", skip).getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.QUERY_INVALID_ERROR.getCode(), + PersoniumCoreException.OData.QUERY_INVALID_ERROR.params("$skip", skip).getMessage()); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataMergeTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataMergeTest.java similarity index 93% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataMergeTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataMergeTest.java index 155f6aa6c..5099c5066 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataMergeTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataMergeTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; @@ -32,25 +32,25 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.UserDataUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.UserDataUtils; +import io.personium.test.utils.TResponse; /** * UserData更新のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataMergeTest extends AbstractUserDataTest { @@ -270,7 +270,7 @@ public UserDataMergeTest() { .with("id", userDataId) .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", updateReqBody.toJSONString()) .returns() .statusCode(HttpStatus.SC_PRECONDITION_FAILED) @@ -413,7 +413,7 @@ public UserDataMergeTest() { String userDataId = "userdata001"; // 最大要素数 - int maxPropNum = DcCoreConfig.getMaxPropertyCountInEntityType(); + int maxPropNum = PersoniumUnitConfig.getMaxPropertyCountInEntityType(); // 初期作成用のリクエストボディ JSONObject createReqBody = new JSONObject(); @@ -473,7 +473,7 @@ public UserDataMergeTest() { String userDataId = "userdata001"; // 最大要素数 - int maxPropNum = DcCoreConfig.getMaxPropertyCountInEntityType(); + int maxPropNum = PersoniumUnitConfig.getMaxPropertyCountInEntityType(); // 初期作成用のリクエストボディ JSONObject createReqBody = new JSONObject(); @@ -535,7 +535,7 @@ public UserDataMergeTest() { String userDataId = "userdata001"; // 最大要素数 - int maxPropNum = DcCoreConfig.getMaxPropertyCountInEntityType(); + int maxPropNum = PersoniumUnitConfig.getMaxPropertyCountInEntityType(); // 初期作成用のリクエストボディ JSONObject createReqBody = new JSONObject(); @@ -561,8 +561,8 @@ public UserDataMergeTest() { res.statusCode(HttpStatus.SC_BAD_REQUEST); ODataCommon.checkErrorResponseBody(res, - DcCoreException.OData.ENTITYTYPE_STRUCTUAL_LIMITATION_EXCEEDED.getCode(), - DcCoreException.OData.ENTITYTYPE_STRUCTUAL_LIMITATION_EXCEEDED.getMessage()); + PersoniumCoreException.OData.ENTITYTYPE_STRUCTUAL_LIMITATION_EXCEEDED.getCode(), + PersoniumCoreException.OData.ENTITYTYPE_STRUCTUAL_LIMITATION_EXCEEDED.getMessage()); } finally { deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, @@ -579,7 +579,7 @@ public UserDataMergeTest() { String userDataId = "userdata001"; // 最大要素数 - int maxPropNum = DcCoreConfig.getMaxPropertyCountInEntityType(); + int maxPropNum = PersoniumUnitConfig.getMaxPropertyCountInEntityType(); // 初期作成用のリクエストボディ // 最大要素数 - 1のプロパティを指定 @@ -640,7 +640,7 @@ public UserDataMergeTest() { String userDataId = "userdata001"; // 最大要素数 - int maxPropNum = DcCoreConfig.getMaxPropertyCountInEntityType(); + int maxPropNum = PersoniumUnitConfig.getMaxPropertyCountInEntityType(); // 初期作成用のリクエストボディ // 最大要素数 - 1のプロパティを指定 @@ -666,8 +666,8 @@ public UserDataMergeTest() { res.statusCode(HttpStatus.SC_BAD_REQUEST); ODataCommon.checkErrorResponseBody(res, - DcCoreException.OData.ENTITYTYPE_STRUCTUAL_LIMITATION_EXCEEDED.getCode(), - DcCoreException.OData.ENTITYTYPE_STRUCTUAL_LIMITATION_EXCEEDED.getMessage()); + PersoniumCoreException.OData.ENTITYTYPE_STRUCTUAL_LIMITATION_EXCEEDED.getCode(), + PersoniumCoreException.OData.ENTITYTYPE_STRUCTUAL_LIMITATION_EXCEEDED.getMessage()); } finally { deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, @@ -686,7 +686,7 @@ public UserDataMergeTest() { String locationUserData = null, locationProperty = null; // Nullable=flaseのPropertyを追加 - DcResponse resProperty = UserDataUtils.createProperty(cellName, boxName, Setup.TEST_ODATA, propName, + PersoniumResponse resProperty = UserDataUtils.createProperty(cellName, boxName, Setup.TEST_ODATA, propName, "Category", "Edm.String", false, "", "None", false, null); locationProperty = resProperty.getFirstHeader(HttpHeaders.LOCATION); @@ -750,7 +750,7 @@ public UserDataMergeTest() { String locationUserData = null, locationProperty = null; // Nullable=flaseのPropertyを追加 - DcResponse resProperty = UserDataUtils.createProperty(cellName, boxName, Setup.TEST_ODATA, propName, + PersoniumResponse resProperty = UserDataUtils.createProperty(cellName, boxName, Setup.TEST_ODATA, propName, "Category", "Edm.String", false, "", "None", false, null); locationProperty = resProperty.getFirstHeader(HttpHeaders.LOCATION); @@ -899,7 +899,7 @@ private TResponse mergeRequest(String userDataId, String ifMatch, JSONObject upd .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", ifMatch) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", updateReqBody.toJSONString()) .returns() .debug(); @@ -920,7 +920,7 @@ private TResponse mergeRequest(String cell, .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", "*") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", updateReqBody.toJSONString()) .returns() .debug(); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataPropertyDateTimeTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataPropertyDateTimeTest.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataPropertyDateTimeTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataPropertyDateTimeTest.java index f3ad345e1..b892de3fb 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataPropertyDateTimeTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataPropertyDateTimeTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -31,29 +31,29 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.utils.ODataUtils; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.odatacol.schema.property.PropertyUtils; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.Common; +import io.personium.core.utils.ODataUtils; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.odatacol.schema.property.PropertyUtils; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * UserDataComplexType登録のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataPropertyDateTimeTest extends AbstractUserDataTest { @@ -177,8 +177,8 @@ public UserDataPropertyDateTimeTest() { // ユーザデータ作成 TResponse response = createUserData(body, HttpStatus.SC_BAD_REQUEST, cellName, boxName, COL_NAME, ENTITY_TYPE_NAME); - String code = DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(); - String message = DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PROP_NAME).getMessage(); + String code = PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(); + String message = PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PROP_NAME).getMessage(); checkErrorResponse(response.bodyAsJson(), code, message); } finally { @@ -251,8 +251,8 @@ public UserDataPropertyDateTimeTest() { TResponse response = createUserData(body, HttpStatus.SC_BAD_REQUEST, cellName, boxName, COL_NAME, ENTITY_TYPE_NAME); - String code = DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(); - String message = DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PROP_NAME).getMessage(); + String code = PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(); + String message = PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PROP_NAME).getMessage(); checkErrorResponse(response.bodyAsJson(), code, message); } finally { @@ -694,7 +694,7 @@ protected TResponse createEntityType(String name, String odataName) { .with("boxPath", boxName) .with("odataSvcPath", odataName) .with("accept", MediaType.APPLICATION_JSON) - .with("token", "Bearer " + DcCoreConfig.getMasterToken()) + .with("token", "Bearer " + PersoniumUnitConfig.getMasterToken()) .with("Name", name) .returns() .debug(); @@ -704,7 +704,7 @@ protected TResponse createEntityType(String name, String odataName) { * テストに必要なEntityを作成する. */ protected void createEntities() { - DavResourceUtils.createODataCollection(DcCoreConfig.getMasterToken(), HttpStatus.SC_CREATED, cellName, boxName, + DavResourceUtils.createODataCollection(PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_CREATED, cellName, boxName, COL_NAME); createEntityType(ENTITY_TYPE_NAME, COL_NAME); @@ -736,7 +736,7 @@ private void createProperty(String type, String defValue) { private void createProperty(String type, String defValue, String colkindValue) { // リクエストパラメータ設定 String locationUrl = UrlUtils.property(cellName, boxName, COL_NAME, null, null); - DcRequest req = DcRequest.post(locationUrl); + PersoniumRequest req = PersoniumRequest.post(locationUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, PROP_NAME); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, ENTITY_TYPE_NAME); @@ -748,7 +748,7 @@ private void createProperty(String type, String defValue, String colkindValue) { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); @@ -766,7 +766,7 @@ protected void deleteUserData(String userDataId) { .with("collection", COL_NAME) .with("entityType", ENTITY_TYPE_NAME) .with("id", userDataId) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("ifMatch", "*") .returns() .debug(); @@ -781,7 +781,7 @@ protected void deleteEntities() { EntityTypeUtils.delete(COL_NAME, MASTER_TOKEN_NAME, "application/json", ENTITY_TYPE_NAME, cellName, -1); // コレクションを削除 - DavResourceUtils.deleteCollection(cellName, boxName, COL_NAME, DcCoreConfig.getMasterToken(), -1); + DavResourceUtils.deleteCollection(cellName, boxName, COL_NAME, PersoniumUnitConfig.getMasterToken(), -1); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataSpecificCharTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataSpecificCharTest.java similarity index 85% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataSpecificCharTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataSpecificCharTest.java index 5c5836b53..e0245408a 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataSpecificCharTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataSpecificCharTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -26,23 +26,23 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DaoException; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.DaoException; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; /** * UserDataの特殊文字のレスポンスチェックのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataSpecificCharTest extends AbstractUserDataTest { @@ -124,10 +124,10 @@ public static Fixture[] getFixture() { // ユーザデータの一件取得 String url = String.format("%s/%s/%s/%s/%s('%s')", UrlUtils.getBaseUrl(), cellName, boxName, colName, entityTypeName, userDataId); - DcRequest request = DcRequest.get(url); + PersoniumRequest request = PersoniumRequest.get(url); request.header("Accept", "application/json"); request.header("Authorization", "Bearer " + AbstractCase.MASTER_TOKEN_NAME); - DcResponse dres = ODataCommon.request(request); + PersoniumResponse dres = ODataCommon.request(request); assertEquals(f.testComment, dres.getStatusCode(), HttpStatus.SC_OK); // レスポンスボディーのチェック @@ -138,7 +138,7 @@ public static Fixture[] getFixture() { // ユーザデータの一覧取得 url = String.format("%s/%s/%s/%s/%s", UrlUtils.getBaseUrl(), cellName, boxName, colName, entityTypeName); - DcRequest listRequest = DcRequest.get(url); + PersoniumRequest listRequest = PersoniumRequest.get(url); listRequest.header("Accept", "application/json"); listRequest.header("Authorization", "Bearer " + AbstractCase.MASTER_TOKEN_NAME); dres = ODataCommon.request(listRequest); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataUpdateTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataUpdateTest.java similarity index 93% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataUpdateTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataUpdateTest.java index e35900c13..a8193012a 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataUpdateTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataUpdateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -34,27 +34,27 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; /** * UserData更新のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataUpdateTest extends AbstractUserDataWithNP { @@ -110,7 +110,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", "*") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", updateBody.toJSONString()) .returns() .statusCode(HttpStatus.SC_NO_CONTENT) @@ -175,7 +175,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", "*") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", updateBody.toJSONString()) .returns() .statusCode(HttpStatus.SC_NO_CONTENT) @@ -218,7 +218,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", "*") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", updateBody.toJSONString()) .returns() .statusCode(HttpStatus.SC_NO_CONTENT) @@ -246,7 +246,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", "*") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", updateBody.toJSONString()) .returns() .statusCode(HttpStatus.SC_NO_CONTENT) @@ -289,7 +289,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", "*") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", updateBody.toJSONString()) .returns() .statusCode(HttpStatus.SC_NO_CONTENT) @@ -317,7 +317,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", "*") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", updateBody.toJSONString()) .returns() .statusCode(HttpStatus.SC_NO_CONTENT) @@ -360,7 +360,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", "*") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", updateBody.toJSONString()) .returns() .statusCode(HttpStatus.SC_NO_CONTENT) @@ -390,7 +390,7 @@ public UserDataUpdateTest() { // リクエストボディを設定 colName = "setodata"; String userDataId = "userdata001"; - int maxPropNum = DcCoreConfig.getMaxPropertyCountInEntityType(); + int maxPropNum = PersoniumUnitConfig.getMaxPropertyCountInEntityType(); JSONObject body = new JSONObject(); body.put("__id", userDataId); @@ -418,7 +418,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", "*") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", updateBody.toJSONString()) .returns() .statusCode(HttpStatus.SC_NO_CONTENT) @@ -459,7 +459,7 @@ public UserDataUpdateTest() { // リクエストボディを設定 colName = "setodata"; String userDataId = "userdata001"; - int maxPropNum = DcCoreConfig.getMaxPropertyCountInEntityType(); + int maxPropNum = PersoniumUnitConfig.getMaxPropertyCountInEntityType(); JSONObject body = new JSONObject(); body.put("__id", userDataId); @@ -483,7 +483,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", "*") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", updateBody.toJSONString()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) @@ -525,7 +525,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", "*") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", updateBody.toJSONString()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) @@ -566,7 +566,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", "*") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", updateBody.toJSONString()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) @@ -607,7 +607,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", "*") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", updateBody.toJSONString()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) @@ -643,7 +643,7 @@ public UserDataUpdateTest() { .with("id", userDataId) .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", updateBody.toJSONString()) .returns() .statusCode(HttpStatus.SC_NO_CONTENT) @@ -687,7 +687,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", etag) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", updateBody.toJSONString()) .returns() .statusCode(HttpStatus.SC_NO_CONTENT) @@ -745,7 +745,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", etag) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", updateBody.toJSONString()) .returns() .statusCode(HttpStatus.SC_NO_CONTENT) @@ -801,7 +801,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", "W/\"" + String.valueOf(version + 1) + "-" + String.valueOf(updated) + "\"") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", updateBody.toJSONString()) .returns() .statusCode(HttpStatus.SC_PRECONDITION_FAILED) @@ -846,7 +846,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", "W/\"" + String.valueOf(version) + "-" + String.valueOf(updated + 1) + "\"") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", updateBody.toJSONString()) .returns() .statusCode(HttpStatus.SC_PRECONDITION_FAILED) @@ -891,7 +891,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", "\"" + String.valueOf(version) + "-" + String.valueOf(updated) + "\"") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", updateBody.toJSONString()) .returns() .statusCode(HttpStatus.SC_PRECONDITION_FAILED) @@ -935,7 +935,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", String.valueOf(updated)) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", updateBody.toJSONString()) .returns() .statusCode(HttpStatus.SC_PRECONDITION_FAILED) @@ -980,7 +980,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", "W/\"" + String.valueOf(version) + String.valueOf(updated) + "\"") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", updateBody.toJSONString()) .returns() .statusCode(HttpStatus.SC_PRECONDITION_FAILED) @@ -1024,7 +1024,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", "W/\"" + String.valueOf(version) + "-" + "test" + "\"") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", updateBody.toJSONString()) .returns() .statusCode(HttpStatus.SC_PRECONDITION_FAILED) @@ -1078,7 +1078,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", "*") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body.toJSONString()) .returns() .statusCode(HttpStatus.SC_NO_CONTENT) @@ -1167,7 +1167,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", "*") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body.toJSONString()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) @@ -1223,7 +1223,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", "*") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body.toJSONString()) .returns() .statusCode(HttpStatus.SC_NO_CONTENT) @@ -1279,7 +1279,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", "*") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body.toJSONString()) .returns() .statusCode(HttpStatus.SC_NO_CONTENT) @@ -1337,7 +1337,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", "*") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body.toJSONString()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) @@ -1393,7 +1393,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", "*") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body.toJSONString()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) @@ -1449,7 +1449,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", "*") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body.toJSONString()) .returns() .statusCode(HttpStatus.SC_NO_CONTENT) @@ -1505,7 +1505,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", "*") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body.toJSONString()) .returns() .statusCode(HttpStatus.SC_NO_CONTENT) @@ -1561,7 +1561,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", "*") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body.toJSONString()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) @@ -1617,7 +1617,7 @@ public UserDataUpdateTest() { .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", "*") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body.toJSONString()) .returns() .statusCode(HttpStatus.SC_NO_CONTENT) @@ -1651,19 +1651,19 @@ public UserDataUpdateTest() { // ユーザデータ更新 String requestURL = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, "Category(3830)", null); - DcRequest req = DcRequest.put(requestURL); + PersoniumRequest req = PersoniumRequest.put(requestURL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.header(HttpHeaders.IF_MATCH, "*"); req.addJsonBody("dynamicProperty", "dynamicPropertyValue"); // リクエスト実行 - DcResponse res = request(req); + PersoniumResponse res = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); checkErrorResponse(res.bodyAsJson(), - DcCoreException.OData.ENTITY_KEY_PARSE_ERROR.getCode(), - DcCoreException.OData.ENTITY_KEY_PARSE_ERROR.getMessage()); + PersoniumCoreException.OData.ENTITY_KEY_PARSE_ERROR.getCode(), + PersoniumCoreException.OData.ENTITY_KEY_PARSE_ERROR.getMessage()); } finally { deleteUserData(userDataId); } @@ -1761,7 +1761,7 @@ private TResponse createEntityType(String name, String odataName) { .with("boxPath", boxName) .with("odataSvcPath", odataName) .with("accept", MediaType.APPLICATION_JSON) - .with("token", "Bearer " + DcCoreConfig.getMasterToken()) + .with("token", "Bearer " + PersoniumUnitConfig.getMasterToken()) .with("Name", name) .returns() .debug(); @@ -1780,7 +1780,7 @@ protected void deleteUserData(String name, String userDataId) { .with("collection", colName) .with("entityType", name) .with("id", userDataId) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("ifMatch", "*") .returns() .statusCode(HttpStatus.SC_NO_CONTENT); @@ -1801,7 +1801,7 @@ protected TResponse createUserData(JSONObject body, String entityType, int sc) { .with("entityType", entityType) .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) - .with("token", "Bearer " + DcCoreConfig.getMasterToken()) + .with("token", "Bearer " + PersoniumUnitConfig.getMasterToken()) .with("body", body.toJSONString()) .returns() .statusCode(sc) diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataValidateTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataValidateTest.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataValidateTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataValidateTest.java index d0376ad9a..c1c5f104a 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataValidateTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataValidateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -31,27 +31,27 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcException; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRestAdapter; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumException; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumRestAdapter; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; /** * UserData登録のバリデートテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataValidateTest extends ODataCommon { @@ -61,7 +61,7 @@ public class UserDataValidateTest extends ODataCommon { * コンストラクタ. */ public UserDataValidateTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -265,7 +265,7 @@ public UserDataValidateTest() { String locationHeader = null; try { - DcResponse res = createUserDataWithDcClient(body); + PersoniumResponse res = createUserDataWithDcClient(body); locationHeader = res.getFirstHeader(HttpHeaders.LOCATION); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); @@ -475,7 +475,7 @@ public UserDataValidateTest() { String locationHeader = null; try { - DcResponse res = createUserDataWithDcClient(body); + PersoniumResponse res = createUserDataWithDcClient(body); locationHeader = res.getFirstHeader(HttpHeaders.LOCATION); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); @@ -575,7 +575,7 @@ public UserDataValidateTest() { locationHeader = null; try { - DcResponse res = createUserDataWithDcClient(body); + PersoniumResponse res = createUserDataWithDcClient(body); locationHeader = res.getFirstHeader(HttpHeaders.LOCATION); assertEquals(HttpStatus.SC_CREATED, res.getStatusCode()); @@ -619,7 +619,7 @@ public UserDataValidateTest() { locationHeader = null; try { - DcResponse res = createUserDataWithDcClient(body); + PersoniumResponse res = createUserDataWithDcClient(body); locationHeader = res.getFirstHeader(HttpHeaders.LOCATION); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); @@ -1309,7 +1309,7 @@ private TResponse createUserData(JSONObject body) { .with("entityType", "Category") .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) - .with("token", "Bearer " + DcCoreConfig.getMasterToken()) + .with("token", "Bearer " + PersoniumUnitConfig.getMasterToken()) .with("body", body.toJSONString()) .returns() .debug(); @@ -1320,19 +1320,19 @@ private TResponse createUserData(JSONObject body) { * @param body リクエストボディ * @return レスポンス */ - private DcResponse createUserDataWithDcClient(JSONObject body) { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + private PersoniumResponse createUserDataWithDcClient(JSONObject body) { + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); - requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + DcCoreConfig.getMasterToken()); + requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + PersoniumUnitConfig.getMasterToken()); requestheaders.put(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); try { res = rest.post(UrlUtils.userData("testcell1", "box1", "setodata", "Category"), body.toJSONString(), requestheaders); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataWithNPDeclaredDoublePropertyTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataWithNPDeclaredDoublePropertyTest.java similarity index 89% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataWithNPDeclaredDoublePropertyTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/UserDataWithNPDeclaredDoublePropertyTest.java index 2652221ea..0381d9694 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/UserDataWithNPDeclaredDoublePropertyTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/UserDataWithNPDeclaredDoublePropertyTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; import java.util.HashMap; import java.util.Map; @@ -28,30 +28,30 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.model.impl.es.odata.UserDataODataProducer; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.odatacol.schema.complextype.ComplexTypeUtils; -import com.fujitsu.dc.test.jersey.box.odatacol.schema.complextypeproperty.ComplexTypePropertyUtils; -import com.fujitsu.dc.test.jersey.box.odatacol.schema.property.PropertyUtils; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.utils.AssociationEndUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.model.impl.es.odata.UserDataODataProducer; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.odatacol.schema.complextype.ComplexTypeUtils; +import io.personium.test.jersey.box.odatacol.schema.complextypeproperty.ComplexTypePropertyUtils; +import io.personium.test.jersey.box.odatacol.schema.property.PropertyUtils; +import io.personium.test.setup.Setup; +import io.personium.test.utils.AssociationEndUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; import com.sun.jersey.test.framework.WebAppDescriptor; /** * UserODataのDouble型静的プロパティNP経由操作のテストクラス. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataWithNPDeclaredDoublePropertyTest extends ODataCommon { @@ -81,11 +81,11 @@ public class UserDataWithNPDeclaredDoublePropertyTest extends ODataCommon { private static final Map INIT_PARAMS = new HashMap(); static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/AbstractUserDataBatchTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/batch/AbstractUserDataBatchTest.java similarity index 90% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/AbstractUserDataBatchTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/batch/AbstractUserDataBatchTest.java index 038e71119..f078318b7 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/AbstractUserDataBatchTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/batch/AbstractUserDataBatchTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.batch; +package io.personium.test.jersey.box.odatacol.batch; import static org.junit.Assert.assertTrue; @@ -22,12 +22,12 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import com.fujitsu.dc.client.ODataBatchResponseParser; -import com.fujitsu.dc.client.ODataResponse; -import com.fujitsu.dc.test.jersey.box.odatacol.AbstractUserDataTest; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.utils.BatchUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.client.ODataBatchResponseParser; +import io.personium.client.ODataResponse; +import io.personium.test.jersey.box.odatacol.AbstractUserDataTest; +import io.personium.test.setup.Setup; +import io.personium.test.utils.BatchUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.WebAppDescriptor; /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/AllTests.java b/src/test/java/io/personium/test/jersey/box/odatacol/batch/AllTests.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/AllTests.java rename to src/test/java/io/personium/test/jersey/box/odatacol/batch/AllTests.java index 1c58e923c..ef3d1d659 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/AllTests.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/batch/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.batch; +package io.personium.test.jersey.box.odatacol.batch; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/BatchRequestShutterTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/batch/BatchRequestShutterTest.java similarity index 83% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/BatchRequestShutterTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/batch/BatchRequestShutterTest.java index c1137db0f..8136c40e8 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/BatchRequestShutterTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/batch/BatchRequestShutterTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.batch; +package io.personium.test.jersey.box.odatacol.batch; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -24,9 +24,9 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.rs.odata.BatchRequestShutter; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.core.PersoniumCoreException; +import io.personium.core.rs.odata.BatchRequestShutter; +import io.personium.test.categories.Unit; /** * BatchRequestShutterのテスト. @@ -48,7 +48,7 @@ public class BatchRequestShutterTest { */ @Test public void TooManyConcurrentが発生した場合シャッターONの状態になること() { - Exception e = DcCoreException.Misc.TOO_MANY_CONCURRENT_REQUESTS; + Exception e = PersoniumCoreException.Misc.TOO_MANY_CONCURRENT_REQUESTS; BatchRequestShutter shutter = new BatchRequestShutter(); assertFalse(shutter.isShuttered()); @@ -62,7 +62,7 @@ public class BatchRequestShutterTest { */ @Test public void TooManyConcurrent以外の例外が発生した場合シャッターONの状態にならないこと() { - Exception e = DcCoreException.Server.GET_LOCK_STATE_ERROR; + Exception e = PersoniumCoreException.Server.GET_LOCK_STATE_ERROR; BatchRequestShutter shutter = new BatchRequestShutter(); assertFalse(shutter.isShuttered()); @@ -76,8 +76,8 @@ public class BatchRequestShutterTest { */ @Test public void 一度でもTooManyConcurrentが発生した場合シャッターONの状態が継続すること() { - Exception e1 = DcCoreException.Misc.TOO_MANY_CONCURRENT_REQUESTS; - Exception e2 = DcCoreException.OData.CONFLICT_DUPLICATED_ENTITY; + Exception e1 = PersoniumCoreException.Misc.TOO_MANY_CONCURRENT_REQUESTS; + Exception e2 = PersoniumCoreException.OData.CONFLICT_DUPLICATED_ENTITY; BatchRequestShutter shutter = new BatchRequestShutter(); assertFalse(shutter.isShuttered()); @@ -108,7 +108,7 @@ public class BatchRequestShutterTest { */ @Test public void シャッターONの場合GETメソッドのみ許可されること() { - Exception e = DcCoreException.Misc.TOO_MANY_CONCURRENT_REQUESTS; + Exception e = PersoniumCoreException.Misc.TOO_MANY_CONCURRENT_REQUESTS; BatchRequestShutter shutter = new BatchRequestShutter(); assertFalse(shutter.isShuttered()); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/BatchResponseExtractor.java b/src/test/java/io/personium/test/jersey/box/odatacol/batch/BatchResponseExtractor.java similarity index 95% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/BatchResponseExtractor.java rename to src/test/java/io/personium/test/jersey/box/odatacol/batch/BatchResponseExtractor.java index be1743fee..07935d25a 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/BatchResponseExtractor.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/batch/BatchResponseExtractor.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.batch; +package io.personium.test.jersey.box.odatacol.batch; import java.util.ArrayList; import java.util.List; @@ -24,7 +24,7 @@ import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.test.utils.TResponse; /** * バッチリクエストのレスポンスから個々のレスポンスを集めるクラス. diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/UserDataBatchDynamicPropertyTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/batch/UserDataBatchDynamicPropertyTest.java similarity index 85% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/UserDataBatchDynamicPropertyTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/batch/UserDataBatchDynamicPropertyTest.java index 833fa69fa..09d28e9e3 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/UserDataBatchDynamicPropertyTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/batch/UserDataBatchDynamicPropertyTest.java @@ -14,14 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.batch; +package io.personium.test.jersey.box.odatacol.batch; -import static com.fujitsu.dc.test.utils.BatchUtils.BOUNDARY; -import static com.fujitsu.dc.test.utils.BatchUtils.END_BOUNDARY; -import static com.fujitsu.dc.test.utils.BatchUtils.START_BOUNDARY; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveGetBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrievePostWithBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrievePutBody; +import static io.personium.test.utils.BatchUtils.BOUNDARY; +import static io.personium.test.utils.BatchUtils.END_BOUNDARY; +import static io.personium.test.utils.BatchUtils.START_BOUNDARY; +import static io.personium.test.utils.BatchUtils.retrieveGetBody; +import static io.personium.test.utils.BatchUtils.retrievePostWithBody; +import static io.personium.test.utils.BatchUtils.retrievePutBody; import javax.ws.rs.core.MediaType; @@ -32,26 +32,26 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.model.impl.es.odata.UserDataODataProducer; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.model.impl.es.odata.UserDataODataProducer; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.UserDataUtils; /** * UserData$batchのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataBatchDynamicPropertyTest extends AbstractUserDataBatchTest { @@ -105,17 +105,17 @@ public UserDataBatchDynamicPropertyTest() { .with("box", Setup.TEST_BOX1) .with("collection", colPath) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", batchBody) .returns() .statusCode(HttpStatus.SC_ACCEPTED); // Property一覧 String locationUrlGet = UrlUtils.property(Setup.TEST_CELL1, Setup.TEST_BOX1, colPath, null, null); - DcRequest req = DcRequest.get(locationUrlGet + "?$inlinecount=allpages"); + PersoniumRequest req = PersoniumRequest.get(locationUrlGet + "?$inlinecount=allpages"); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse res = request(req); + PersoniumResponse res = request(req); ODataCommon.checkResponseBodyCount(res.bodyAsJson(), 1); // UserData取得 @@ -130,9 +130,9 @@ public UserDataBatchDynamicPropertyTest() { } finally { deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, colPath, entityTypeName, "001", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, colPath, entityTypeName, "002", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); EntityTypeUtils.delete(colPath, MASTER_TOKEN_NAME, MediaType.APPLICATION_JSON, entityTypeName, Setup.TEST_BOX1, Setup.TEST_CELL1, -1); DavResourceUtils.deleteCollection(Setup.TEST_CELL1, Setup.TEST_BOX1, colPath, MASTER_TOKEN_NAME, -1); @@ -175,17 +175,17 @@ public UserDataBatchDynamicPropertyTest() { .with("box", boxName) .with("collection", colPath) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", batchBody) .returns() .statusCode(HttpStatus.SC_ACCEPTED); // Property一覧 String locationUrlGet = UrlUtils.property(Setup.TEST_CELL1, Setup.TEST_BOX1, colPath, null, null); - DcRequest req = DcRequest.get(locationUrlGet + "?$inlinecount=allpages"); + PersoniumRequest req = PersoniumRequest.get(locationUrlGet + "?$inlinecount=allpages"); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse res = request(req); + PersoniumResponse res = request(req); ODataCommon.checkResponseBodyCount(res.bodyAsJson(), 1); // UserData取得 @@ -200,9 +200,9 @@ public UserDataBatchDynamicPropertyTest() { } finally { deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, colPath, entityTypeName, "001", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, colPath, entityTypeName, "002", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); EntityTypeUtils.delete(colPath, MASTER_TOKEN_NAME, MediaType.APPLICATION_JSON, entityTypeName, Setup.TEST_BOX1, Setup.TEST_CELL1, -1); DavResourceUtils.deleteCollection(Setup.TEST_CELL1, Setup.TEST_BOX1, colPath, MASTER_TOKEN_NAME, -1); @@ -245,17 +245,17 @@ public UserDataBatchDynamicPropertyTest() { .with("box", boxName) .with("collection", colPath) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", batchBody) .returns() .statusCode(HttpStatus.SC_ACCEPTED); // Property一覧 String locationUrlGet = UrlUtils.property(Setup.TEST_CELL1, Setup.TEST_BOX1, colPath, null, null); - DcRequest req = DcRequest.get(locationUrlGet + "?$inlinecount=allpages"); + PersoniumRequest req = PersoniumRequest.get(locationUrlGet + "?$inlinecount=allpages"); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse res = request(req); + PersoniumResponse res = request(req); ODataCommon.checkResponseBodyCount(res.bodyAsJson(), 1); // UserData取得 @@ -265,9 +265,9 @@ public UserDataBatchDynamicPropertyTest() { + entityTypeName, batchBody2, null, null); } finally { deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, colPath, entityTypeName, "001", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, colPath, entityTypeName, "002", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); EntityTypeUtils.delete(colPath, MASTER_TOKEN_NAME, MediaType.APPLICATION_JSON, entityTypeName, Setup.TEST_BOX1, Setup.TEST_CELL1, -1); DavResourceUtils.deleteCollection(Setup.TEST_CELL1, Setup.TEST_BOX1, colPath, MASTER_TOKEN_NAME, -1); @@ -313,17 +313,17 @@ public UserDataBatchDynamicPropertyTest() { .with("box", boxName) .with("collection", colPath) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", batchBody) .returns() .statusCode(HttpStatus.SC_ACCEPTED); // Property一覧 String locationUrlGet = UrlUtils.property(Setup.TEST_CELL1, Setup.TEST_BOX1, colPath, null, null); - DcRequest req = DcRequest.get(locationUrlGet + "?$inlinecount=allpages"); + PersoniumRequest req = PersoniumRequest.get(locationUrlGet + "?$inlinecount=allpages"); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse res = request(req); + PersoniumResponse res = request(req); ODataCommon.checkResponseBodyCount(res.bodyAsJson(), 1); // UserData取得 @@ -334,9 +334,9 @@ public UserDataBatchDynamicPropertyTest() { } finally { deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, colPath, entityTypeName, "001", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, colPath, entityTypeName, "002", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); EntityTypeUtils.delete(colPath, MASTER_TOKEN_NAME, MediaType.APPLICATION_JSON, entityTypeName, Setup.TEST_BOX1, Setup.TEST_CELL1, -1); DavResourceUtils.deleteCollection(Setup.TEST_CELL1, Setup.TEST_BOX1, colPath, MASTER_TOKEN_NAME, -1); @@ -382,17 +382,17 @@ public UserDataBatchDynamicPropertyTest() { .with("box", boxName) .with("collection", colPath) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", batchBody) .returns() .statusCode(HttpStatus.SC_ACCEPTED); // Property一覧 String locationUrlGet = UrlUtils.property(Setup.TEST_CELL1, Setup.TEST_BOX1, colPath, null, null); - DcRequest req = DcRequest.get(locationUrlGet + "?$inlinecount=allpages"); + PersoniumRequest req = PersoniumRequest.get(locationUrlGet + "?$inlinecount=allpages"); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse res = request(req); + PersoniumResponse res = request(req); ODataCommon.checkResponseBodyCount(res.bodyAsJson(), 1); // UserData取得 @@ -407,9 +407,9 @@ public UserDataBatchDynamicPropertyTest() { } finally { deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, colPath, entityTypeName, "001", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, colPath, entityTypeName, "002", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); EntityTypeUtils.delete(colPath, MASTER_TOKEN_NAME, MediaType.APPLICATION_JSON, entityTypeName, Setup.TEST_BOX1, Setup.TEST_CELL1, -1); DavResourceUtils.deleteCollection(Setup.TEST_CELL1, Setup.TEST_BOX1, colPath, MASTER_TOKEN_NAME, -1); @@ -459,17 +459,17 @@ public UserDataBatchDynamicPropertyTest() { .with("box", boxName) .with("collection", colPath) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", batchBody) .returns() .statusCode(HttpStatus.SC_ACCEPTED); // Property一覧 String locationUrlGet = UrlUtils.property(Setup.TEST_CELL1, Setup.TEST_BOX1, colPath, null, null); - DcRequest req = DcRequest.get(locationUrlGet + "?$inlinecount=allpages"); + PersoniumRequest req = PersoniumRequest.get(locationUrlGet + "?$inlinecount=allpages"); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse res = request(req); + PersoniumResponse res = request(req); ODataCommon.checkResponseBodyCount(res.bodyAsJson(), 2); // UserData取得 @@ -488,11 +488,11 @@ public UserDataBatchDynamicPropertyTest() { } finally { deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, colPath, entityTypeName, "001", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, colPath, entityTypeName, "002", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); deleteUserData(Setup.TEST_CELL1, Setup.TEST_BOX1, colPath, entityTypeName, "003", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); EntityTypeUtils.delete(colPath, MASTER_TOKEN_NAME, MediaType.APPLICATION_JSON, entityTypeName, Setup.TEST_BOX1, Setup.TEST_CELL1, -1); DavResourceUtils.deleteCollection(Setup.TEST_CELL1, Setup.TEST_BOX1, colPath, MASTER_TOKEN_NAME, -1); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/UserDataBatchLinkTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/batch/UserDataBatchLinkTest.java similarity index 76% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/UserDataBatchLinkTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/batch/UserDataBatchLinkTest.java index 346c69b02..0f4c33f5a 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/UserDataBatchLinkTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/batch/UserDataBatchLinkTest.java @@ -14,17 +14,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.batch; +package io.personium.test.jersey.box.odatacol.batch; -import static com.fujitsu.dc.test.utils.BatchUtils.BOUNDARY; -import static com.fujitsu.dc.test.utils.BatchUtils.END_BOUNDARY; -import static com.fujitsu.dc.test.utils.BatchUtils.START_BOUNDARY; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveChangeSetResErrorBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveDeleteBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveGetBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveLinksPostBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveLinksPostResBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrievePostBody; +import static io.personium.test.utils.BatchUtils.BOUNDARY; +import static io.personium.test.utils.BatchUtils.END_BOUNDARY; +import static io.personium.test.utils.BatchUtils.START_BOUNDARY; +import static io.personium.test.utils.BatchUtils.retrieveChangeSetResErrorBody; +import static io.personium.test.utils.BatchUtils.retrieveDeleteBody; +import static io.personium.test.utils.BatchUtils.retrieveGetBody; +import static io.personium.test.utils.BatchUtils.retrieveLinksPostBody; +import static io.personium.test.utils.BatchUtils.retrieveLinksPostResBody; +import static io.personium.test.utils.BatchUtils.retrievePostBody; import java.util.ArrayList; import java.util.regex.Pattern; @@ -36,23 +36,23 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; /** * UserData$batchでの$linkAPIテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataBatchLinkTest extends AbstractUserDataBatchTest { @@ -85,7 +85,7 @@ public UserDataBatchLinkTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -110,8 +110,8 @@ public UserDataBatchLinkTest() { } finally { ResourceUtils.deleteUserDataLinks( "srcKey", "tgtKey", "Supplier", cellName, boxName, colName, "Sales", -1); - deleteUserData(cellName, boxName, colName, "Supplier", "tgtKey", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Supplier", "tgtKey", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -166,7 +166,7 @@ public UserDataBatchLinkTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -178,48 +178,48 @@ public UserDataBatchLinkTest() { + retrievePostResBodyToSetODataCol("Supplier", "tgtKey", true) // $links元に存在しないEntitySet名を指定 + START_BOUNDARY + retrieveChangesetErrorResponse(HttpStatus.SC_NOT_FOUND, - DcCoreException.OData.NO_SUCH_ENTITY_SET.getCode(), - DcCoreException.OData.NO_SUCH_ENTITY_SET.getMessage()) + PersoniumCoreException.OData.NO_SUCH_ENTITY_SET.getCode(), + PersoniumCoreException.OData.NO_SUCH_ENTITY_SET.getMessage()) // $links元に存在しないEntityキーを指定 + START_BOUNDARY + retrieveChangesetErrorResponse(HttpStatus.SC_NOT_FOUND, - DcCoreException.OData.NOT_FOUND.getCode(), - DcCoreException.OData.NOT_FOUND.getMessage()) + PersoniumCoreException.OData.NOT_FOUND.getCode(), + PersoniumCoreException.OData.NOT_FOUND.getMessage()) // $links先に存在しないEntitySet名を指定 + START_BOUNDARY + retrieveChangesetErrorResponse(HttpStatus.SC_BAD_REQUEST, - DcCoreException.OData.NO_SUCH_ASSOCIATION.getCode(), - DcCoreException.OData.NO_SUCH_ASSOCIATION.getMessage()) + PersoniumCoreException.OData.NO_SUCH_ASSOCIATION.getCode(), + PersoniumCoreException.OData.NO_SUCH_ASSOCIATION.getMessage()) // リクエストボディに空文字を指定 + START_BOUNDARY + retrieveChangesetErrorResponse(HttpStatus.SC_BAD_REQUEST, - DcCoreException.OData.JSON_PARSE_ERROR.getCode(), - DcCoreException.OData.JSON_PARSE_ERROR.getMessage()) + PersoniumCoreException.OData.JSON_PARSE_ERROR.getCode(), + PersoniumCoreException.OData.JSON_PARSE_ERROR.getMessage()) // リクエストボディにuri以外のキーを指定 + START_BOUNDARY + retrieveChangesetErrorResponse(HttpStatus.SC_BAD_REQUEST, - DcCoreException.OData.JSON_PARSE_ERROR.getCode(), - DcCoreException.OData.JSON_PARSE_ERROR.getMessage()) + PersoniumCoreException.OData.JSON_PARSE_ERROR.getCode(), + PersoniumCoreException.OData.JSON_PARSE_ERROR.getMessage()) // リクエストボディの値が空文字 + START_BOUNDARY + retrieveChangesetErrorResponse(HttpStatus.SC_BAD_REQUEST, - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("uri").getMessage()) + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("uri").getMessage()) // リクエストボディがurl形式でない + START_BOUNDARY + retrieveChangesetErrorResponse(HttpStatus.SC_BAD_REQUEST, - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("uri").getMessage()) + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("uri").getMessage()) // リクエストボディで指定したEntitySetが存在しない + START_BOUNDARY + retrieveChangesetErrorResponse(HttpStatus.SC_BAD_REQUEST, - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("uri").getMessage()) + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("uri").getMessage()) // リクエストボディで指定したEntityキーが存在しない + START_BOUNDARY + retrieveChangesetErrorResponse(HttpStatus.SC_BAD_REQUEST, - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("uri").getMessage()) + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("uri").getMessage()) + END_BOUNDARY; checkBatchResponseBody(response, expectedBody); } finally { ResourceUtils.deleteUserDataLinks( "srcKey", "tgtKey", "Supplier", cellName, boxName, colName, "Sales", -1); - deleteUserData(cellName, boxName, colName, "Supplier", "tgtKey", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Supplier", "tgtKey", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -250,7 +250,7 @@ public UserDataBatchLinkTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -261,24 +261,24 @@ public UserDataBatchLinkTest() { + START_BOUNDARY + retrievePostResBodyToSetODataCol("Supplier", "tgtKey", true) // $links の一覧取得 + START_BOUNDARY + retrieveQueryOperationResErrorBody(HttpStatus.SC_NOT_IMPLEMENTED, - DcCoreException.Misc.METHOD_NOT_IMPLEMENTED.getCode(), - DcCoreException.Misc.METHOD_NOT_IMPLEMENTED.getMessage()) + PersoniumCoreException.Misc.METHOD_NOT_IMPLEMENTED.getCode(), + PersoniumCoreException.Misc.METHOD_NOT_IMPLEMENTED.getMessage()) // $links の更新 + START_BOUNDARY + retrieveChangesetErrorResponse(HttpStatus.SC_NOT_IMPLEMENTED, - DcCoreException.Misc.METHOD_NOT_IMPLEMENTED.getCode(), - DcCoreException.Misc.METHOD_NOT_IMPLEMENTED.getMessage()) + PersoniumCoreException.Misc.METHOD_NOT_IMPLEMENTED.getCode(), + PersoniumCoreException.Misc.METHOD_NOT_IMPLEMENTED.getMessage()) // $links の削除 + START_BOUNDARY + retrieveChangesetErrorResponse(HttpStatus.SC_NOT_IMPLEMENTED, - DcCoreException.Misc.METHOD_NOT_IMPLEMENTED.getCode(), - DcCoreException.Misc.METHOD_NOT_IMPLEMENTED.getMessage()) + PersoniumCoreException.Misc.METHOD_NOT_IMPLEMENTED.getCode(), + PersoniumCoreException.Misc.METHOD_NOT_IMPLEMENTED.getMessage()) + END_BOUNDARY; checkBatchResponseBody(response, expectedBody); } finally { ResourceUtils.deleteUserDataLinks( "srcKey", "tgtKey", "Supplier", cellName, boxName, colName, "Sales", -1); - deleteUserData(cellName, boxName, colName, "Supplier", "tgtKey", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Supplier", "tgtKey", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -296,7 +296,7 @@ public UserDataBatchLinkTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/UserDataBatchListQueryTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/batch/UserDataBatchListQueryTest.java similarity index 89% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/UserDataBatchListQueryTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/batch/UserDataBatchListQueryTest.java index 55efc9393..a0cf75967 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/UserDataBatchListQueryTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/batch/UserDataBatchListQueryTest.java @@ -14,19 +14,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.batch; - -import static com.fujitsu.dc.test.utils.BatchUtils.BOUNDARY; -import static com.fujitsu.dc.test.utils.BatchUtils.END_BOUNDARY; -import static com.fujitsu.dc.test.utils.BatchUtils.START_BOUNDARY; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveDeleteBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveDeleteResBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveListResBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveListResBodyWithCount; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveListResBodyWithExpand; -import static com.fujitsu.dc.test.utils.BatchUtils.retrievePostBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrievePostWithBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveQueryOperationResErrorBody; +package io.personium.test.jersey.box.odatacol.batch; + +import static io.personium.test.utils.BatchUtils.BOUNDARY; +import static io.personium.test.utils.BatchUtils.END_BOUNDARY; +import static io.personium.test.utils.BatchUtils.START_BOUNDARY; +import static io.personium.test.utils.BatchUtils.retrieveDeleteBody; +import static io.personium.test.utils.BatchUtils.retrieveDeleteResBody; +import static io.personium.test.utils.BatchUtils.retrieveListResBody; +import static io.personium.test.utils.BatchUtils.retrieveListResBodyWithCount; +import static io.personium.test.utils.BatchUtils.retrieveListResBodyWithExpand; +import static io.personium.test.utils.BatchUtils.retrievePostBody; +import static io.personium.test.utils.BatchUtils.retrievePostWithBody; +import static io.personium.test.utils.BatchUtils.retrieveQueryOperationResErrorBody; import java.util.ArrayList; import java.util.List; @@ -42,28 +42,28 @@ import org.odata4j.edm.EdmSimpleType; import org.odata4j.producer.resources.ODataBatchProvider; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.box.odatacol.schema.property.PropertyUtils; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.box.odatacol.schema.property.PropertyUtils; +import io.personium.test.setup.Setup; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; /** * UserData$batchのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataBatchListQueryTest extends AbstractUserDataBatchTest { - int topMaxNum = DcCoreConfig.getTopQueryMaxSize(); - int skipMaxNum = DcCoreConfig.getSkipQueryMaxSize(); + int topMaxNum = PersoniumUnitConfig.getTopQueryMaxSize(); + int skipMaxNum = PersoniumUnitConfig.getSkipQueryMaxSize(); /** * コンストラクタ. @@ -82,7 +82,7 @@ public UserDataBatchListQueryTest() { try { // 事前準備 // EntityType作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); @@ -96,7 +96,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -117,9 +117,9 @@ public UserDataBatchListQueryTest() { } finally { // UserODataの削除 deleteUserData(cellName, boxName, colName, entityTypeName, entityIdPrefix + "1", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); deleteUserData(cellName, boxName, colName, entityTypeName, entityIdPrefix + "2", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); // EntityTypeの削除 Setup.entityTypeDelete(colName, entityTypeName, cellName, boxName); @@ -139,7 +139,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -167,7 +167,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -195,7 +195,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -220,7 +220,7 @@ public UserDataBatchListQueryTest() { try { // 事前準備 // EntityType作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); @@ -235,7 +235,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -257,9 +257,9 @@ public UserDataBatchListQueryTest() { } finally { // UserODataの削除 deleteUserData(cellName, boxName, colName, entityTypeName, entityIdPrefix + "1", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); deleteUserData(cellName, boxName, colName, entityTypeName, entityIdPrefix + "2", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); // EntityTypeの削除 Setup.entityTypeDelete(colName, entityTypeName, cellName, boxName); @@ -281,7 +281,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) @@ -298,7 +298,7 @@ public UserDataBatchListQueryTest() { try { // 事前準備 // EntityType作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); @@ -312,7 +312,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -333,9 +333,9 @@ public UserDataBatchListQueryTest() { } finally { // UserODataの削除 deleteUserData(cellName, boxName, colName, entityTypeName, entityIdPrefix + "1", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); deleteUserData(cellName, boxName, colName, entityTypeName, entityIdPrefix + "2", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); // EntityTypeの削除 Setup.entityTypeDelete(colName, entityTypeName, cellName, boxName); @@ -355,7 +355,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -383,7 +383,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -411,7 +411,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -436,7 +436,7 @@ public UserDataBatchListQueryTest() { try { // 事前準備 // EntityType作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); @@ -449,7 +449,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -469,7 +469,7 @@ public UserDataBatchListQueryTest() { } finally { // UserODataの削除 deleteUserData(cellName, boxName, colName, entityTypeName, entityIdPrefix + "1", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); // EntityTypeの削除 Setup.entityTypeDelete(colName, entityTypeName, cellName, boxName); } @@ -488,7 +488,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -513,7 +513,7 @@ public UserDataBatchListQueryTest() { try { // 事前準備 // EntityType作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); @@ -527,7 +527,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -549,9 +549,9 @@ public UserDataBatchListQueryTest() { } finally { // UserODataの削除 deleteUserData(cellName, boxName, colName, entityTypeName, entityIdPrefix + "11", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); deleteUserData(cellName, boxName, colName, entityTypeName, entityIdPrefix + "21", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); // EntityTypeの削除 Setup.entityTypeDelete(colName, entityTypeName, cellName, boxName); } @@ -567,7 +567,7 @@ public UserDataBatchListQueryTest() { try { // 事前準備 // EntityType作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); @@ -581,7 +581,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -603,9 +603,9 @@ public UserDataBatchListQueryTest() { } finally { // UserODataの削除 deleteUserData(cellName, boxName, colName, entityTypeName, entityIdPrefix + "11", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); deleteUserData(cellName, boxName, colName, entityTypeName, entityIdPrefix + "21", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); // EntityTypeの削除 Setup.entityTypeDelete(colName, entityTypeName, cellName, boxName); @@ -625,7 +625,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -650,7 +650,7 @@ public UserDataBatchListQueryTest() { try { // 事前準備 // EntityType作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); @@ -664,7 +664,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -686,9 +686,9 @@ public UserDataBatchListQueryTest() { } finally { // UserODataの削除 deleteUserData(cellName, boxName, colName, entityTypeName, entityIdPrefix + "1", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); deleteUserData(cellName, boxName, colName, entityTypeName, entityIdPrefix + "2", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); // EntityTypeの削除 Setup.entityTypeDelete(colName, entityTypeName, cellName, boxName); } @@ -707,7 +707,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -732,7 +732,7 @@ public UserDataBatchListQueryTest() { try { // 事前準備 // EntityType作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); @@ -746,7 +746,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -767,10 +767,10 @@ public UserDataBatchListQueryTest() { } finally { // UserODataの削除 deleteUserData(cellName, boxName, colName, entityTypeName, entityIdPrefix + "111", - DcCoreConfig.getMasterToken(), + PersoniumUnitConfig.getMasterToken(), -1); deleteUserData(cellName, boxName, colName, entityTypeName, entityIdPrefix + "211", - DcCoreConfig.getMasterToken(), + PersoniumUnitConfig.getMasterToken(), -1); // EntityTypeの削除 Setup.entityTypeDelete(colName, entityTypeName, cellName, boxName); @@ -790,7 +790,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -836,7 +836,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", bodyBatch) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -895,7 +895,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", bodyBatch) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -947,7 +947,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", bodyBatch) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -978,7 +978,7 @@ public UserDataBatchListQueryTest() { String targetEntity2 = "Product"; String userDataId = "npdata"; - int top = DcCoreConfig.getTopQueryMaxSizeWithExpand(); + int top = PersoniumUnitConfig.getTopQueryMaxSizeWithExpand(); try { // 事前にデータを登録する @@ -996,7 +996,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", bodyBatch) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -1030,7 +1030,7 @@ public UserDataBatchListQueryTest() { String targetEntity2 = "Product"; String userDataId = "npdata"; - int top = DcCoreConfig.getTopQueryMaxSizeWithExpand() + 1; + int top = PersoniumUnitConfig.getTopQueryMaxSizeWithExpand() + 1; try { // 事前にデータを登録する @@ -1048,7 +1048,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", bodyBatch) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -1081,7 +1081,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -1106,7 +1106,7 @@ public UserDataBatchListQueryTest() { try { // 事前準備 // EntityType作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); @@ -1120,7 +1120,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -1142,9 +1142,9 @@ public UserDataBatchListQueryTest() { } finally { // UserODataの削除 deleteUserData(cellName, boxName, colName, entityTypeName, entityIdPrefix + "1", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); deleteUserData(cellName, boxName, colName, entityTypeName, entityIdPrefix + "2", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); // EntityTypeの削除 Setup.entityTypeDelete(colName, entityTypeName, cellName, boxName); } @@ -1163,7 +1163,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -1188,7 +1188,7 @@ public UserDataBatchListQueryTest() { try { // 事前準備 // EntityType作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); @@ -1202,7 +1202,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -1223,9 +1223,9 @@ public UserDataBatchListQueryTest() { } finally { // UserODataの削除 deleteUserData(cellName, boxName, colName, entityTypeName, entityIdPrefix + "11", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); deleteUserData(cellName, boxName, colName, entityTypeName, entityIdPrefix + "21", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); // EntityTypeの削除 Setup.entityTypeDelete(colName, entityTypeName, cellName, boxName); } @@ -1247,7 +1247,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -1272,7 +1272,7 @@ public UserDataBatchListQueryTest() { try { // 事前準備 // EntityType作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); @@ -1286,7 +1286,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -1307,9 +1307,9 @@ public UserDataBatchListQueryTest() { } finally { // UserODataの削除 deleteUserData(cellName, boxName, colName, entityTypeName, entityIdPrefix + "11", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); deleteUserData(cellName, boxName, colName, entityTypeName, entityIdPrefix + "21", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); // EntityTypeの削除 Setup.entityTypeDelete(colName, entityTypeName, cellName, boxName); } @@ -1325,7 +1325,7 @@ public UserDataBatchListQueryTest() { try { // 事前準備 // EntityType作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); @@ -1339,7 +1339,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -1360,9 +1360,9 @@ public UserDataBatchListQueryTest() { } finally { // UserODataの削除 deleteUserData(cellName, boxName, colName, entityTypeName, entityIdPrefix + "1", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); deleteUserData(cellName, boxName, colName, entityTypeName, entityIdPrefix + "2", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); // EntityTypeの削除 Setup.entityTypeDelete(colName, entityTypeName, cellName, boxName); } @@ -1408,7 +1408,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", reqBody) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -1431,7 +1431,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -1443,7 +1443,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -1500,7 +1500,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", reqBody) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -1524,7 +1524,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -1536,7 +1536,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -1593,7 +1593,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", reqBody) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -1617,7 +1617,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -1629,7 +1629,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -1686,7 +1686,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", reqBody) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -1710,7 +1710,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -1722,7 +1722,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -1779,7 +1779,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", reqBody) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -1802,7 +1802,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -1814,7 +1814,7 @@ public UserDataBatchListQueryTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/UserDataBatchMultiRequestTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/batch/UserDataBatchMultiRequestTest.java similarity index 80% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/UserDataBatchMultiRequestTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/batch/UserDataBatchMultiRequestTest.java index 6eac36699..357eba73f 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/UserDataBatchMultiRequestTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/batch/UserDataBatchMultiRequestTest.java @@ -14,15 +14,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.batch; +package io.personium.test.jersey.box.odatacol.batch; -import static com.fujitsu.dc.test.utils.BatchUtils.BOUNDARY; -import static com.fujitsu.dc.test.utils.BatchUtils.END_BOUNDARY; -import static com.fujitsu.dc.test.utils.BatchUtils.START_BOUNDARY; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveChangeSetResErrorBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveGetBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveGetResBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrievePostBody; +import static io.personium.test.utils.BatchUtils.BOUNDARY; +import static io.personium.test.utils.BatchUtils.END_BOUNDARY; +import static io.personium.test.utils.BatchUtils.START_BOUNDARY; +import static io.personium.test.utils.BatchUtils.retrieveChangeSetResErrorBody; +import static io.personium.test.utils.BatchUtils.retrieveGetBody; +import static io.personium.test.utils.BatchUtils.retrieveGetResBody; +import static io.personium.test.utils.BatchUtils.retrievePostBody; import java.util.ArrayList; @@ -31,23 +31,23 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; /** * UserData$batch内に複数のリクエストが指定された場合のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataBatchMultiRequestTest extends AbstractUserDataBatchTest { @@ -73,7 +73,7 @@ public UserDataBatchMultiRequestTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -86,7 +86,7 @@ public UserDataBatchMultiRequestTest() { checkBatchResponseBody(response, expectedBody); // ユーザデータ取得 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "SalesDetail", "npTest1", HttpStatus.SC_OK); // リンク情報のチェック(SalesDetail→Sales) TResponse resList = UserDataUtils.listLink(cellName, boxName, colName, @@ -104,8 +104,8 @@ public UserDataBatchMultiRequestTest() { } finally { ResourceUtils.deleteUserDataLinks("srcKey", "npTest1", "SalesDetail", cellName, boxName, colName, "Sales", -1); - deleteUserData(cellName, boxName, colName, "SalesDetail", "npTest1", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "SalesDetail", "npTest1", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -115,8 +115,8 @@ public UserDataBatchMultiRequestTest() { @Test public final void 正しいリクエストが1つと文法に誤りのあるリクエストが1つ指定された場合$batch全体が400エラーとなること() { String path = "Sales('srcKey')/"; - String code = DcCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.getCode(); - String err = DcCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.params("POST " + path + " HTTP/1.1") + String code = PersoniumCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.getCode(); + String err = PersoniumCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.params("POST " + path + " HTTP/1.1") .getMessage(); String body = START_BOUNDARY + retrievePostBody("Sales", "srcKey") @@ -127,7 +127,7 @@ public UserDataBatchMultiRequestTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -135,7 +135,7 @@ public UserDataBatchMultiRequestTest() { .checkErrorResponse(code, err); // ユーザデータ取得 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", "srcKey", HttpStatus.SC_NOT_FOUND); } @@ -154,7 +154,7 @@ public UserDataBatchMultiRequestTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -167,10 +167,10 @@ public UserDataBatchMultiRequestTest() { checkBatchResponseBody(response, expectedBody); // ユーザデータ取得 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", "srcKey", HttpStatus.SC_OK); } finally { - deleteUserData(cellName, boxName, colName, "Sales", "srcKey", DcCoreConfig.getMasterToken(), + deleteUserData(cellName, boxName, colName, "Sales", "srcKey", PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -181,8 +181,8 @@ public UserDataBatchMultiRequestTest() { @Test public final void 文法に誤りのあるリクエストが1つとデータに誤りのあるリクエストが1つ指定された場合$batch全体が400エラーとなること() { String path = "Sales('srcKey')/"; - String code = DcCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.getCode(); - String err = DcCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.params("POST " + path + " HTTP/1.1") + String code = PersoniumCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.getCode(); + String err = PersoniumCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.params("POST " + path + " HTTP/1.1") .getMessage(); String body = START_BOUNDARY + retrievePostBody("Sales", "__srcKey") + START_BOUNDARY + retrievePostBody(path, "npTest1") @@ -192,7 +192,7 @@ public UserDataBatchMultiRequestTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -225,7 +225,7 @@ public UserDataBatchMultiRequestTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -273,12 +273,12 @@ public UserDataBatchMultiRequestTest() { "Sales", -1); // UserODataの削除 - deleteUserData(cellName, boxName, colName, "SalesDetail", "npTest1", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "SalesDetail", "npTest2", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "SalesDetail", "npTest3", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "srcKey1", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "srcKey2", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "srcKey3", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "SalesDetail", "npTest1", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "SalesDetail", "npTest2", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "SalesDetail", "npTest3", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "srcKey1", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "srcKey2", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "srcKey3", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -290,8 +290,8 @@ public UserDataBatchMultiRequestTest() { String path1 = "Sales('srcKey1')/_SalesDetail"; String invalidPath = "Sales('srcKey2')/"; String path3 = "Sales('srcKey3')/_SalesDetail"; - String code = DcCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.getCode(); - String err = DcCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.params("POST " + invalidPath + " HTTP/1.1") + String code = PersoniumCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.getCode(); + String err = PersoniumCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.params("POST " + invalidPath + " HTTP/1.1") .getMessage(); String body = START_BOUNDARY + retrievePostBody("Sales", "srcKey1") @@ -310,7 +310,7 @@ public UserDataBatchMultiRequestTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -318,17 +318,17 @@ public UserDataBatchMultiRequestTest() { .checkErrorResponse(code, err); // ユーザデータが作成されていないことを確認 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", "srcKey1", HttpStatus.SC_NOT_FOUND); - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", "srcKey2", HttpStatus.SC_NOT_FOUND); - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", "srcKey3", HttpStatus.SC_NOT_FOUND); - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "SalesDetail", "npTest1", HttpStatus.SC_NOT_FOUND); - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "SalesDetail", "npTest2", HttpStatus.SC_NOT_FOUND); - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "SalesDetail", "npTest3", HttpStatus.SC_NOT_FOUND); } @@ -357,7 +357,7 @@ public UserDataBatchMultiRequestTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -402,11 +402,11 @@ public UserDataBatchMultiRequestTest() { "Sales", -1); // UserODataの削除 - deleteUserData(cellName, boxName, colName, "SalesDetail", "npTest1", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "SalesDetail", "npTest3", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "srcKey1", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "srcKey2", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "srcKey3", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "SalesDetail", "npTest1", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "SalesDetail", "npTest3", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "srcKey1", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "srcKey2", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "srcKey3", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -418,8 +418,8 @@ public UserDataBatchMultiRequestTest() { String path1 = "Sales('srcKey1')/_SalesDetail"; String invalidEntityPath = "Sales('srcKey3')/_InvalidEntity"; String invalidPath = "Sales('srcKey2')/"; - String code = DcCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.getCode(); - String err = DcCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.params("POST " + invalidPath + " HTTP/1.1") + String code = PersoniumCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.getCode(); + String err = PersoniumCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.params("POST " + invalidPath + " HTTP/1.1") .getMessage(); String body = START_BOUNDARY + retrievePostBody("Sales", "srcKey1") @@ -438,7 +438,7 @@ public UserDataBatchMultiRequestTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -446,17 +446,17 @@ public UserDataBatchMultiRequestTest() { .checkErrorResponse(code, err); // ユーザデータが作成されていないことを確認 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", "srcKey1", HttpStatus.SC_NOT_FOUND); - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", "srcKey2", HttpStatus.SC_NOT_FOUND); - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", "srcKey3", HttpStatus.SC_NOT_FOUND); - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "SalesDetail", "npTest1", HttpStatus.SC_NOT_FOUND); - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "SalesDetail", "npTest2", HttpStatus.SC_NOT_FOUND); - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "SalesDetail", "npTest3", HttpStatus.SC_NOT_FOUND); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/UserDataBatchTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/batch/UserDataBatchTest.java similarity index 88% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/UserDataBatchTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/batch/UserDataBatchTest.java index 650fb34e9..912ded289 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/UserDataBatchTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/batch/UserDataBatchTest.java @@ -14,11 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.batch; +package io.personium.test.jersey.box.odatacol.batch; -import static com.fujitsu.dc.test.utils.BatchUtils.BOUNDARY; -import static com.fujitsu.dc.test.utils.BatchUtils.START_BOUNDARY; -import static com.fujitsu.dc.test.utils.BatchUtils.END_BOUNDARY; +import static io.personium.test.utils.BatchUtils.BOUNDARY; +import static io.personium.test.utils.BatchUtils.START_BOUNDARY; +import static io.personium.test.utils.BatchUtils.END_BOUNDARY; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertFalse; @@ -45,29 +45,29 @@ import org.odata4j.edm.EdmSimpleType; import org.odata4j.producer.resources.ODataBatchProvider; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.CompareJSON; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.odatacol.schema.property.PropertyUtils; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.BatchUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.test.CompareJSON; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.odatacol.schema.property.PropertyUtils; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.BatchUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; /** * UserData$batchのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataBatchTest extends AbstractUserDataBatchTest { @@ -91,7 +91,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED); @@ -106,7 +106,7 @@ public UserDataBatchTest() { Matcher matcher = pattern.matcher(listResponse); matcher.find(); String id = matcher.group(1); - deleteUserData(cellName, boxName, colName, "Supplier", id, DcCoreConfig.getMasterToken(), + deleteUserData(cellName, boxName, colName, "Supplier", id, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } @@ -144,7 +144,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED); @@ -196,7 +196,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED); @@ -206,7 +206,7 @@ public UserDataBatchTest() { + START_BOUNDARY + BatchUtils.retrieveGetResBody("Supplier", "refresh") + END_BOUNDARY; checkBatchResponseBody(response, expectedBody); } finally { - deleteUserData(cellName, boxName, colName, "Supplier", "refresh", DcCoreConfig.getMasterToken(), + deleteUserData(cellName, boxName, colName, "Supplier", "refresh", PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -234,7 +234,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED); @@ -251,7 +251,7 @@ public UserDataBatchTest() { String expectedBody = START_BOUNDARY + BatchUtils.retrievePutResBody() + END_BOUNDARY; checkBatchResponseBody(bulkResponse, expectedBody); } finally { - deleteUserData(cellName, boxName, colName, "Category", "pubTest", DcCoreConfig.getMasterToken(), + deleteUserData(cellName, boxName, colName, "Category", "pubTest", PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -280,7 +280,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED); @@ -320,7 +320,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -341,7 +341,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -379,7 +379,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -436,7 +436,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -489,7 +489,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", reqBody) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -539,7 +539,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -552,7 +552,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -580,7 +580,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -605,7 +605,7 @@ public UserDataBatchTest() { try { // 事前準備 // EntityType作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, entityTypeName, HttpStatus.SC_CREATED); @@ -618,7 +618,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -638,8 +638,8 @@ public UserDataBatchTest() { checkBatchResponseBody(res, expectedBody); } finally { // UserODataの削除 - deleteUserData(cellName, boxName, colName, entityTypeName, "testBatch1", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, entityTypeName, "testBatch2", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, entityTypeName, "testBatch1", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, entityTypeName, "testBatch2", PersoniumUnitConfig.getMasterToken(), -1); // EntityTypeの削除 Setup.entityTypeDelete(colName, entityTypeName, cellName, boxName); @@ -674,7 +674,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -690,8 +690,8 @@ public UserDataBatchTest() { checkBatchResponseBody(res, expectedBody); } finally { - deleteUserData(cellName, boxName, colName, "Sales", "id0001", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "SalesDetail", "id0001", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "id0001", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "SalesDetail", "id0001", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -722,7 +722,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -737,14 +737,14 @@ public UserDataBatchTest() { checkBatchResponseBody(res, expectedBody); // ユーザOData取得 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, "Sales", + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", "id0001", HttpStatus.SC_OK); - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, "SalesDetail", + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "SalesDetail", "id0001", HttpStatus.SC_NOT_FOUND); } finally { - deleteUserData(cellName, boxName, colName, "Sales", "id0001", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "SalesDetail", "id0001", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "id0001", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "SalesDetail", "id0001", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -768,9 +768,9 @@ public UserDataBatchTest() { super.createUserData(srcBody, HttpStatus.SC_CREATED, cellName, boxName, colName, "SalesDetail"); // 更新前ユーザOData取得 - TResponse originalSales = UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, + TResponse originalSales = UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", "id0001", HttpStatus.SC_OK); - TResponse originalSalesDetail = UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, + TResponse originalSalesDetail = UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "SalesDetail", "id0001", HttpStatus.SC_OK); // $batch @@ -783,7 +783,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -798,14 +798,14 @@ public UserDataBatchTest() { checkBatchResponseBody(res, expectedBody); // ユーザOData取得(Salesが更新されていないこと) - TResponse afterSales = UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, + TResponse afterSales = UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", "id0001", HttpStatus.SC_OK); CompareJSON.Result compareRes = CompareJSON.compareJSON( originalSales.bodyAsJson(), afterSales.bodyAsJson()); assertNull(compareRes); // ユーザOData取得(SalesDetailが更新されていること) - TResponse afterSalesDetail = UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, + TResponse afterSalesDetail = UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "SalesDetail", "id0001", HttpStatus.SC_OK); compareRes = CompareJSON.compareJSON( originalSalesDetail.bodyAsJson(), afterSalesDetail.bodyAsJson()); @@ -814,8 +814,8 @@ public UserDataBatchTest() { assertEquals("updated", compareRes.getMismatchValue("Name")); } finally { - deleteUserData(cellName, boxName, colName, "Sales", "id0001", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "SalesDetail", "id0001", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "id0001", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "SalesDetail", "id0001", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -843,7 +843,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -884,14 +884,14 @@ public UserDataBatchTest() { @Test public final void $batchの登録で不正フォーマットのデータを指定した場合に400が返却されること() { String body = START_BOUNDARY; - String code = DcCoreException.OData.BATCH_BODY_PARSE_ERROR.getCode(); - String err = DcCoreException.OData.BATCH_BODY_PARSE_ERROR.getMessage(); + String code = PersoniumCoreException.OData.BATCH_BODY_PARSE_ERROR.getCode(); + String err = PersoniumCoreException.OData.BATCH_BODY_PARSE_ERROR.getMessage(); Http.request("box/odatacol/batch.txt") .with("cell", cellName) .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) @@ -911,7 +911,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED); @@ -936,14 +936,14 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() .statusCode(HttpStatus.SC_BAD_REQUEST); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.getCode(), - DcCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.params(HttpHeaders.CONTENT_TYPE).getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.getCode(), + PersoniumCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.params(HttpHeaders.CONTENT_TYPE).getMessage()); } /** @@ -951,15 +951,15 @@ public UserDataBatchTest() { */ @Test public final void $batchの登録でリクエストヘッダのContentTypeに誤ったバウンダリーを指定した場合に400が返却されること() { - String code = DcCoreException.OData.BATCH_BODY_PARSE_ERROR.getCode(); - String err = DcCoreException.OData.BATCH_BODY_PARSE_ERROR.getMessage(); + String code = PersoniumCoreException.OData.BATCH_BODY_PARSE_ERROR.getCode(); + String err = PersoniumCoreException.OData.BATCH_BODY_PARSE_ERROR.getMessage(); String body = START_BOUNDARY + BatchUtils.retrieveDeleteBody("Supplier('testBatch1')") + END_BOUNDARY; Http.request("box/odatacol/batch.txt") .with("cell", cellName) .with("box", boxName) .with("collection", colName) .with("boundary", "changeset_cLzcDEEVPwvvoxS3yJTFTpRauSK_FAQ6mQtyo0aby93-SDP3lAs2A19a2uBb") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) @@ -973,15 +973,15 @@ public UserDataBatchTest() { */ @Test public final void $batchの登録でリクエストボディの末尾にバウンダリーがない場合に400が返却されること() { - String code = DcCoreException.OData.BATCH_BODY_PARSE_ERROR.getCode(); - String err = DcCoreException.OData.BATCH_BODY_PARSE_ERROR.getMessage(); + String code = PersoniumCoreException.OData.BATCH_BODY_PARSE_ERROR.getCode(); + String err = PersoniumCoreException.OData.BATCH_BODY_PARSE_ERROR.getMessage(); String body = START_BOUNDARY + BatchUtils.retrieveDeleteBody("Supplier('testBatch1')"); Http.request("box/odatacol/batch.txt") .with("cell", cellName) .with("box", boxName) .with("collection", colName) .with("boundary", "changeset_cLzcDEEVPwvvoxS3yJTFTpRauSK_FAQ6mQtyo0aby93-SDP3lAs2A19a2uBb") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) @@ -1004,14 +1004,14 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() .statusCode(HttpStatus.SC_BAD_REQUEST); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.getCode(), - DcCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.params(HttpHeaders.CONTENT_TYPE).getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.getCode(), + PersoniumCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.params(HttpHeaders.CONTENT_TYPE).getMessage()); } /** @@ -1029,14 +1029,14 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() .statusCode(HttpStatus.SC_BAD_REQUEST); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.getCode(), - DcCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.params(HttpHeaders.CONTENT_TYPE).getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.getCode(), + PersoniumCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.params(HttpHeaders.CONTENT_TYPE).getMessage()); } /** @@ -1053,14 +1053,14 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() .statusCode(HttpStatus.SC_BAD_REQUEST); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.getCode(), - DcCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.params(HttpHeaders.CONTENT_TYPE).getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.getCode(), + PersoniumCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.params(HttpHeaders.CONTENT_TYPE).getMessage()); } /** @@ -1078,14 +1078,14 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() .statusCode(HttpStatus.SC_BAD_REQUEST); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.getCode(), - DcCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.params(HttpHeaders.CONTENT_TYPE).getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.getCode(), + PersoniumCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.params(HttpHeaders.CONTENT_TYPE).getMessage()); } /** @@ -1102,14 +1102,14 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() .statusCode(HttpStatus.SC_BAD_REQUEST); - ODataCommon.checkErrorResponseBody(res, DcCoreException.OData.BATCH_BODY_FORMAT_CHANGESET_NEST_ERROR.getCode(), - DcCoreException.OData.BATCH_BODY_FORMAT_CHANGESET_NEST_ERROR.getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreException.OData.BATCH_BODY_FORMAT_CHANGESET_NEST_ERROR.getCode(), + PersoniumCoreException.OData.BATCH_BODY_FORMAT_CHANGESET_NEST_ERROR.getMessage()); } /** @@ -1133,7 +1133,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED); @@ -1143,7 +1143,7 @@ public UserDataBatchTest() { + END_BOUNDARY; checkBatchResponseBody(response, expectedBody); } finally { - deleteUserData(cellName, boxName, colName, "Category", "pubTest", DcCoreConfig.getMasterToken(), + deleteUserData(cellName, boxName, colName, "Category", "pubTest", PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -1168,7 +1168,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED); @@ -1178,7 +1178,7 @@ public UserDataBatchTest() { + END_BOUNDARY; checkBatchResponseBody(response, expectedBody); } finally { - deleteUserData(cellName, boxName, colName, "Category", "pubTest", DcCoreConfig.getMasterToken(), + deleteUserData(cellName, boxName, colName, "Category", "pubTest", PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -1203,7 +1203,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED); @@ -1213,7 +1213,7 @@ public UserDataBatchTest() { + END_BOUNDARY; checkBatchResponseBody(response, expectedBody); } finally { - deleteUserData(cellName, boxName, colName, "Category", "pubTest", DcCoreConfig.getMasterToken(), + deleteUserData(cellName, boxName, colName, "Category", "pubTest", PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -1234,7 +1234,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED); @@ -1265,7 +1265,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED); @@ -1281,8 +1281,8 @@ public UserDataBatchTest() { */ @Test public final void $batchの登録で不正なMethodを指定した場合に400が返却されること() { - String code = DcCoreException.OData.BATCH_BODY_FORMAT_METHOD_ERROR.getCode(); - String err = DcCoreException.OData.BATCH_BODY_FORMAT_METHOD_ERROR.params("POT").getMessage(); + String code = PersoniumCoreException.OData.BATCH_BODY_FORMAT_METHOD_ERROR.getCode(); + String err = PersoniumCoreException.OData.BATCH_BODY_FORMAT_METHOD_ERROR.params("POT").getMessage(); String body = START_BOUNDARY + BatchUtils.retrievePostBodyNoId("Supplier", "POT") + END_BOUNDARY; @@ -1291,7 +1291,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) @@ -1317,7 +1317,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED); @@ -1327,7 +1327,7 @@ public UserDataBatchTest() { + END_BOUNDARY; checkBatchResponseBody(response, expectedBody); } finally { - deleteUserData(cellName, boxName, colName, "Supplier", userDataId, DcCoreConfig.getMasterToken(), + deleteUserData(cellName, boxName, colName, "Supplier", userDataId, PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -1346,7 +1346,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED); @@ -1356,7 +1356,7 @@ public UserDataBatchTest() { + START_BOUNDARY + BatchUtils.retrieveChangeSetResErrorBody(HttpStatus.SC_CONFLICT) + END_BOUNDARY; checkBatchResponseBody(response, expectedBody); } finally { - deleteUserData(cellName, boxName, colName, "Supplier", "conflict", DcCoreConfig.getMasterToken(), + deleteUserData(cellName, boxName, colName, "Supplier", "conflict", PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -1376,7 +1376,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED); @@ -1388,15 +1388,15 @@ public UserDataBatchTest() { checkBatchResponseBody(response, expectedBody); // ユーザOData取得 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, "Sales", "id0001", + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", "id0001", HttpStatus.SC_OK); - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, "Supplier", "id0001", + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Supplier", "id0001", HttpStatus.SC_OK); } finally { - deleteUserData(cellName, boxName, colName, "Sales", "id0001", DcCoreConfig.getMasterToken(), + deleteUserData(cellName, boxName, colName, "Sales", "id0001", PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); - deleteUserData(cellName, boxName, colName, "Supplier", "id0001", DcCoreConfig.getMasterToken(), + deleteUserData(cellName, boxName, colName, "Supplier", "id0001", PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_NO_CONTENT); } } @@ -1469,7 +1469,7 @@ public UserDataBatchTest() { for (int i = 0; i < registerNumber * 2; i++) { String id = String.format("testBatch%02d", i); String url = UrlUtils.userdata(cellName, boxName, colName, "Supplier", id); - DcResponse res = ODataCommon.getOdataResource(url); + PersoniumResponse res = ODataCommon.getOdataResource(url); assertEquals(res.getStatusCode(), HttpStatus.SC_OK); } } finally { @@ -1544,15 +1544,15 @@ public UserDataBatchTest() { } sb.append(END_BOUNDARY); - String code = DcCoreException.OData.TOO_MANY_REQUESTS.getCode(); - String err = DcCoreException.OData.TOO_MANY_REQUESTS.params("1,001").getMessage(); + String code = PersoniumCoreException.OData.TOO_MANY_REQUESTS.getCode(); + String err = PersoniumCoreException.OData.TOO_MANY_REQUESTS.params("1,001").getMessage(); Http.request("box/odatacol/batch.txt") .with("cell", cellName) .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", sb.toString()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) @@ -1574,7 +1574,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED); @@ -1591,8 +1591,8 @@ public UserDataBatchTest() { @Test public final void $batchでPOSTメソッドのパスにIDを指定した場合400レスポンスが返却されること() { String path = "Sales('srcKey')"; - String code = DcCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.getCode(); - String err = DcCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.params("POST " + path + " HTTP/1.1") + String code = PersoniumCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.getCode(); + String err = PersoniumCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.params("POST " + path + " HTTP/1.1") .getMessage(); String body = START_BOUNDARY @@ -1603,7 +1603,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) @@ -1617,8 +1617,8 @@ public UserDataBatchTest() { @Test public final void $batchでPUTメソッドのパスにIDを指定しない場合400レスポンスが返却されること() { String path = "Sales"; - String code = DcCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.getCode(); - String err = DcCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.params("PUT " + path + " HTTP/1.1") + String code = PersoniumCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.getCode(); + String err = PersoniumCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.params("PUT " + path + " HTTP/1.1") .getMessage(); String body = START_BOUNDARY @@ -1629,7 +1629,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) @@ -1643,8 +1643,8 @@ public UserDataBatchTest() { @Test public final void $batchでDELETEメソッドのパスにIDを指定しない場合400レスポンスが返却されること() { String path = "Sales"; - String code = DcCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.getCode(); - String err = DcCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.params("DELETE " + path + " HTTP/1.1") + String code = PersoniumCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.getCode(); + String err = PersoniumCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.params("DELETE " + path + " HTTP/1.1") .getMessage(); String body = START_BOUNDARY @@ -1655,7 +1655,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) @@ -1668,8 +1668,8 @@ public UserDataBatchTest() { */ @Test public final void $batchで空のバッチリクエストを送信した場合400レスポンスが返却されること() { - String code = DcCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.getCode(); - String err = DcCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.params("Content-Type") + String code = PersoniumCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.getCode(); + String err = PersoniumCoreException.OData.BATCH_BODY_FORMAT_HEADER_ERROR.params("Content-Type") .getMessage(); String body = START_BOUNDARY + END_BOUNDARY; @@ -1679,7 +1679,7 @@ public UserDataBatchTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) @@ -1697,7 +1697,7 @@ private void checkRetrieveUserData(final int offset, final int registerNumber) { for (int i = 0; i < registerNumber; i++) { String id = String.format("testBatch%02d", i + offset); String url = UrlUtils.userdata(cellName, boxName, colName, "Supplier", id); - DcResponse res = ODataCommon.getOdataResource(url); + PersoniumResponse res = ODataCommon.getOdataResource(url); assertEquals(res.getStatusCode(), HttpStatus.SC_OK); } } @@ -1722,7 +1722,7 @@ private TResponse requestBatchPost(final int offset, final int count) { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", sbuf.toString()) .returns() .statusCode(HttpStatus.SC_ACCEPTED); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/UserDataBatchWithNPLimitTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/batch/UserDataBatchWithNPLimitTest.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/UserDataBatchWithNPLimitTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/batch/UserDataBatchWithNPLimitTest.java index 476092ba7..1096a7f6b 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/UserDataBatchWithNPLimitTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/batch/UserDataBatchWithNPLimitTest.java @@ -14,16 +14,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.batch; - -import static com.fujitsu.dc.test.utils.BatchUtils.BOUNDARY; -import static com.fujitsu.dc.test.utils.BatchUtils.END_BOUNDARY; -import static com.fujitsu.dc.test.utils.BatchUtils.START_BOUNDARY; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveChangeSetResErrorBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveLinksPostBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveLinksPostResBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrievePostBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrievePostResBody; +package io.personium.test.jersey.box.odatacol.batch; + +import static io.personium.test.utils.BatchUtils.BOUNDARY; +import static io.personium.test.utils.BatchUtils.END_BOUNDARY; +import static io.personium.test.utils.BatchUtils.START_BOUNDARY; +import static io.personium.test.utils.BatchUtils.retrieveChangeSetResErrorBody; +import static io.personium.test.utils.BatchUtils.retrieveLinksPostBody; +import static io.personium.test.utils.BatchUtils.retrieveLinksPostResBody; +import static io.personium.test.utils.BatchUtils.retrievePostBody; +import static io.personium.test.utils.BatchUtils.retrievePostResBody; import static org.junit.Assert.assertEquals; import java.util.HashMap; @@ -43,36 +43,36 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AssociationEndUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AssociationEndUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; import com.sun.jersey.test.framework.WebAppDescriptor; /** * UserData $batchのNavigationProperty経由登録の上限値テスト. たくさんデータを登録するので、「Integration.class, Regression.class」では動作しない。 */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class }) public class UserDataBatchWithNPLimitTest extends AbstractUserDataBatchTest { private static final Map INIT_PARAMS = new HashMap(); static { - INIT_PARAMS.put("com.sun.jersey.config.property.packages", "com.fujitsu.dc.core.rs"); + INIT_PARAMS.put("com.sun.jersey.config.property.packages", "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } String masterToken = Setup.MASTER_TOKEN_NAME; @@ -93,7 +93,7 @@ public class UserDataBatchWithNPLimitTest extends AbstractUserDataBatchTest { String srcId = "id"; // 登録するユーザODataの件数(N:Nの$linksで登録可能な上限値) - int maxUserDataCount = DcCoreConfig.getLinksNtoNMaxSize(); + int maxUserDataCount = PersoniumUnitConfig.getLinksNtoNMaxSize(); int registUserDataCount = maxUserDataCount - 10; /** @@ -120,7 +120,7 @@ public UserDataBatchWithNPLimitTest() { + retrievePostBody(path, String.format("id%03d", index++)) + END_BOUNDARY; TResponse response = Http.request("box/odatacol/batch.txt").with("cell", cellName).with("box", boxName) .with("collection", colName).with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()).with("body", body).returns().debug() + .with("token", PersoniumUnitConfig.getMasterToken()).with("body", body).returns().debug() .statusCode(HttpStatus.SC_ACCEPTED); // レスポンスボディのチェック @@ -183,7 +183,7 @@ public UserDataBatchWithNPLimitTest() { + retrievePostBody(path, String.format("id%03d", index++)) + END_BOUNDARY; TResponse response = Http.request("box/odatacol/batch.txt").with("cell", cellName).with("box", boxName) .with("collection", colName).with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()).with("body", body).returns().debug() + .with("token", PersoniumUnitConfig.getMasterToken()).with("body", body).returns().debug() .statusCode(HttpStatus.SC_ACCEPTED); // レスポンスボディのチェック @@ -244,7 +244,7 @@ public UserDataBatchWithNPLimitTest() { + retrievePostBody(path, String.format("id%03d", index++)) + END_BOUNDARY; TResponse response = Http.request("box/odatacol/batch.txt").with("cell", cellName).with("box", boxName) .with("collection", colName).with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()).with("body", body).returns().debug() + .with("token", PersoniumUnitConfig.getMasterToken()).with("body", body).returns().debug() .statusCode(HttpStatus.SC_ACCEPTED); // レスポンスボディのチェック @@ -319,7 +319,7 @@ public UserDataBatchWithNPLimitTest() { + END_BOUNDARY; TResponse response = Http.request("box/odatacol/batch.txt").with("cell", cellName).with("box", boxName) .with("collection", colName).with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()).with("body", body).returns().debug() + .with("token", PersoniumUnitConfig.getMasterToken()).with("body", body).returns().debug() .statusCode(HttpStatus.SC_ACCEPTED); // レスポンスボディのチェック @@ -389,7 +389,7 @@ public UserDataBatchWithNPLimitTest() { + END_BOUNDARY; TResponse response = Http.request("box/odatacol/batch.txt").with("cell", cellName).with("box", boxName) .with("collection", colName).with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()).with("body", body).returns().debug() + .with("token", PersoniumUnitConfig.getMasterToken()).with("body", body).returns().debug() .statusCode(HttpStatus.SC_ACCEPTED); // レスポンスボディのチェック @@ -466,7 +466,7 @@ public UserDataBatchWithNPLimitTest() { + END_BOUNDARY; TResponse response = Http.request("box/odatacol/batch.txt").with("cell", cellName).with("box", boxName) .with("collection", colName).with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()).with("body", body).returns().debug() + .with("token", PersoniumUnitConfig.getMasterToken()).with("body", body).returns().debug() .statusCode(HttpStatus.SC_ACCEPTED); // レスポンスボディのチェック @@ -530,7 +530,7 @@ public UserDataBatchWithNPLimitTest() { + retrievePostBody(path, String.format("id%03d", index++)) + END_BOUNDARY; TResponse response = Http.request("box/odatacol/batch.txt").with("cell", cellName).with("box", boxName) .with("collection", colName).with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()).with("body", body).returns().debug() + .with("token", PersoniumUnitConfig.getMasterToken()).with("body", body).returns().debug() .statusCode(HttpStatus.SC_ACCEPTED); // レスポンスボディのチェック @@ -582,7 +582,7 @@ public UserDataBatchWithNPLimitTest() { + END_BOUNDARY; TResponse response = Http.request("box/odatacol/batch.txt").with("cell", cellName).with("box", boxName) .with("collection", colName).with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()).with("body", body).returns().debug() + .with("token", PersoniumUnitConfig.getMasterToken()).with("body", body).returns().debug() .statusCode(HttpStatus.SC_ACCEPTED); // レスポンスボディのチェック @@ -644,7 +644,7 @@ public UserDataBatchWithNPLimitTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -727,7 +727,7 @@ public UserDataBatchWithNPLimitTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/UserDataBatchWithNPMethodValiationTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/batch/UserDataBatchWithNPMethodValiationTest.java similarity index 83% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/UserDataBatchWithNPMethodValiationTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/batch/UserDataBatchWithNPMethodValiationTest.java index bfa988358..ef0e2418c 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/UserDataBatchWithNPMethodValiationTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/batch/UserDataBatchWithNPMethodValiationTest.java @@ -14,16 +14,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.batch; +package io.personium.test.jersey.box.odatacol.batch; -import static com.fujitsu.dc.test.utils.BatchUtils.BOUNDARY; -import static com.fujitsu.dc.test.utils.BatchUtils.END_BOUNDARY; -import static com.fujitsu.dc.test.utils.BatchUtils.START_BOUNDARY; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveDeleteBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveDeleteResBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrievePostBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrievePutBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrievePutResBody; +import static io.personium.test.utils.BatchUtils.BOUNDARY; +import static io.personium.test.utils.BatchUtils.END_BOUNDARY; +import static io.personium.test.utils.BatchUtils.START_BOUNDARY; +import static io.personium.test.utils.BatchUtils.retrieveDeleteBody; +import static io.personium.test.utils.BatchUtils.retrieveDeleteResBody; +import static io.personium.test.utils.BatchUtils.retrievePostBody; +import static io.personium.test.utils.BatchUtils.retrievePutBody; +import static io.personium.test.utils.BatchUtils.retrievePutResBody; import java.util.ArrayList; @@ -33,22 +33,22 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; /** * UserData$batchのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataBatchWithNPMethodValiationTest extends AbstractUserDataBatchTest { @@ -78,7 +78,7 @@ public UserDataBatchWithNPMethodValiationTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -94,9 +94,9 @@ public UserDataBatchWithNPMethodValiationTest() { checkBatchResponseBody(response, expectedBody); // ユーザデータ取得 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "SalesDetail", "npTest1", HttpStatus.SC_OK); - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "SalesDetail", "npTest2", HttpStatus.SC_OK); // リンク情報のチェック(SalesDetail→Sales) TResponse resList = UserDataUtils.listLink(cellName, boxName, colName, @@ -123,9 +123,9 @@ public UserDataBatchWithNPMethodValiationTest() { "Sales", -1); ResourceUtils.deleteUserDataLinks("srcKey", "npTest2", "SalesDetail", cellName, boxName, colName, "Sales", -1); - deleteUserData(cellName, boxName, colName, "SalesDetail", "npTest1", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "SalesDetail", "npTest2", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "SalesDetail", "npTest1", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "SalesDetail", "npTest2", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -148,7 +148,7 @@ public UserDataBatchWithNPMethodValiationTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -164,11 +164,11 @@ public UserDataBatchWithNPMethodValiationTest() { checkBatchResponseBody(response, expectedBody); // ユーザデータ取得 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "SalesDetail", "npTest1", HttpStatus.SC_NOT_FOUND); - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "SalesDetail", "npTest2", HttpStatus.SC_OK); - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "SalesDetail", "npTest3", HttpStatus.SC_OK); // リンク情報のチェック(SalesDetail→Sales) TResponse resList = UserDataUtils.listLink(cellName, boxName, colName, @@ -195,9 +195,9 @@ public UserDataBatchWithNPMethodValiationTest() { "Sales", -1); ResourceUtils.deleteUserDataLinks("srcKey", "npTest3", "SalesDetail", cellName, boxName, colName, "Sales", -1); - deleteUserData(cellName, boxName, colName, "SalesDetail", "npTest2", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "SalesDetail", "npTest3", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "SalesDetail", "npTest2", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "SalesDetail", "npTest3", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -220,7 +220,7 @@ public UserDataBatchWithNPMethodValiationTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -236,10 +236,10 @@ public UserDataBatchWithNPMethodValiationTest() { checkBatchResponseBody(response, expectedBody); // ユーザデータ取得 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "SalesDetail", "npTest1", HttpStatus.SC_NOT_FOUND); } finally { - deleteUserData(cellName, boxName, colName, "Sales", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -265,7 +265,7 @@ public UserDataBatchWithNPMethodValiationTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -280,10 +280,10 @@ public UserDataBatchWithNPMethodValiationTest() { checkBatchResponseBody(response, expectedBody); // ユーザデータ取得 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "SalesDetail", "npTest1", HttpStatus.SC_NOT_FOUND); } finally { - deleteUserData(cellName, boxName, colName, "Sales", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -313,7 +313,7 @@ public UserDataBatchWithNPMethodValiationTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -331,10 +331,10 @@ public UserDataBatchWithNPMethodValiationTest() { checkBatchResponseBody(response, expectedBody); // ユーザデータ取得 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "SalesDetail", "npTest1", HttpStatus.SC_NOT_FOUND); } finally { - deleteUserData(cellName, boxName, colName, "Sales", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/UserDataBatchWithNPRelationTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/batch/UserDataBatchWithNPRelationTest.java similarity index 86% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/UserDataBatchWithNPRelationTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/batch/UserDataBatchWithNPRelationTest.java index 767eeb0ad..d3050c598 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/UserDataBatchWithNPRelationTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/batch/UserDataBatchWithNPRelationTest.java @@ -14,14 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.batch; - -import static com.fujitsu.dc.test.utils.BatchUtils.BOUNDARY; -import static com.fujitsu.dc.test.utils.BatchUtils.END_BOUNDARY; -import static com.fujitsu.dc.test.utils.BatchUtils.START_BOUNDARY; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveChangeSetResErrorBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrievePostBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrievePostBodyNoId; +package io.personium.test.jersey.box.odatacol.batch; + +import static io.personium.test.utils.BatchUtils.BOUNDARY; +import static io.personium.test.utils.BatchUtils.END_BOUNDARY; +import static io.personium.test.utils.BatchUtils.START_BOUNDARY; +import static io.personium.test.utils.BatchUtils.retrieveChangeSetResErrorBody; +import static io.personium.test.utils.BatchUtils.retrievePostBody; +import static io.personium.test.utils.BatchUtils.retrievePostBodyNoId; import static org.junit.Assert.assertEquals; import java.util.ArrayList; @@ -35,26 +35,26 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AssociationEndUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AssociationEndUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; /** * UserData$batchNP経由登録 関係性のバリエーションのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataBatchWithNPRelationTest extends AbstractUserDataBatchTest { @@ -81,7 +81,7 @@ public UserDataBatchWithNPRelationTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -96,9 +96,9 @@ public UserDataBatchWithNPRelationTest() { checkBatchResponseBody(response, expectedBody); // ユーザデータ取得 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, "Sales", "id0001", + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", "id0001", HttpStatus.SC_OK); - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, "Sales", "id0002", + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", "id0002", HttpStatus.SC_NOT_FOUND); // リンク情報のチェック(Sales→Price) @@ -116,9 +116,9 @@ public UserDataBatchWithNPRelationTest() { } finally { ResourceUtils.deleteUserDataLinks("srcKey", "id0001", "Sales", cellName, boxName, colName, "Price", -1); - deleteUserData(cellName, boxName, colName, "Sales", "id0001", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "id0002", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Price", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "id0001", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "id0002", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Price", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -142,7 +142,7 @@ public UserDataBatchWithNPRelationTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -157,9 +157,9 @@ public UserDataBatchWithNPRelationTest() { checkBatchResponseBody(response, expectedBody); // ユーザデータ取得 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, "Product", "id0001", + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Product", "id0001", HttpStatus.SC_OK); - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, "Product", "id0002", + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Product", "id0002", HttpStatus.SC_NOT_FOUND); // リンク情報のチェック(Supplier→Product) @@ -177,9 +177,9 @@ public UserDataBatchWithNPRelationTest() { } finally { ResourceUtils.deleteUserDataLinks( "srcKey", "id0001", "Product", cellName, boxName, colName, "Supplier", -1); - deleteUserData(cellName, boxName, colName, "Product", "id0001", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Product", "id0002", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Supplier", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "id0001", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "id0002", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Supplier", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -203,7 +203,7 @@ public UserDataBatchWithNPRelationTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -217,9 +217,9 @@ public UserDataBatchWithNPRelationTest() { checkBatchResponseBody(response, expectedBody); // ユーザデータ取得 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, "Supplier", "id0001", + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Supplier", "id0001", HttpStatus.SC_OK); - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, "Supplier", "id0002", + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Supplier", "id0002", HttpStatus.SC_OK); // リンク情報のチェック(Sales→Supplier) @@ -249,9 +249,9 @@ public UserDataBatchWithNPRelationTest() { "srcKey", "id0001", "Supplier", cellName, boxName, colName, "Sales", -1); ResourceUtils.deleteUserDataLinks( "srcKey", "id0002", "Supplier", cellName, boxName, colName, "Sales", -1); - deleteUserData(cellName, boxName, colName, "Supplier", "id0001", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Supplier", "id0002", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Supplier", "id0001", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Supplier", "id0002", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -275,7 +275,7 @@ public UserDataBatchWithNPRelationTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -290,9 +290,9 @@ public UserDataBatchWithNPRelationTest() { checkBatchResponseBody(response, expectedBody); // ユーザデータ取得 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, "Supplier", "id0001", + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Supplier", "id0001", HttpStatus.SC_OK); - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, "Supplier", "id0002", + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Supplier", "id0002", HttpStatus.SC_NOT_FOUND); // リンク情報のチェック(Product→Supplier) @@ -314,9 +314,9 @@ public UserDataBatchWithNPRelationTest() { "srcKey", "id0001", "Supplier", cellName, boxName, colName, "Product", -1); ResourceUtils.deleteUserDataLinks( "srcKey", "id0002", "Supplier", cellName, boxName, colName, "Product", -1); - deleteUserData(cellName, boxName, colName, "Supplier", "id0001", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Supplier", "id0002", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Product", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Supplier", "id0001", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Supplier", "id0002", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -340,7 +340,7 @@ public UserDataBatchWithNPRelationTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -354,9 +354,9 @@ public UserDataBatchWithNPRelationTest() { checkBatchResponseBody(response, expectedBody); // ユーザデータ取得 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, "SalesDetail", + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "SalesDetail", "id0001", HttpStatus.SC_OK); - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, "SalesDetail", + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "SalesDetail", "id0002", HttpStatus.SC_OK); // リンク情報のチェック(Sales→SalesDetail) @@ -386,9 +386,9 @@ public UserDataBatchWithNPRelationTest() { "srcKey", "id0001", "SalesDetail", cellName, boxName, colName, "Sales", -1); ResourceUtils.deleteUserDataLinks( "srcKey", "id0002", "SalesDetail", cellName, boxName, colName, "Sales", -1); - deleteUserData(cellName, boxName, colName, "SalesDetail", "id0001", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "SalesDetail", "id0002", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "SalesDetail", "id0001", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "SalesDetail", "id0002", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -412,7 +412,7 @@ public UserDataBatchWithNPRelationTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -427,9 +427,9 @@ public UserDataBatchWithNPRelationTest() { checkBatchResponseBody(response, expectedBody); // ユーザデータ取得 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, "Sales", "id0001", + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", "id0001", HttpStatus.SC_OK); - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, "Sales", "id0002", + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", "id0002", HttpStatus.SC_NOT_FOUND); // リンク情報のチェック(Supplier→Sales) @@ -451,9 +451,9 @@ public UserDataBatchWithNPRelationTest() { "srcKey", "id0001", "Sales", cellName, boxName, colName, "Supplier", -1); ResourceUtils.deleteUserDataLinks( "srcKey", "id0002", "Sales", cellName, boxName, colName, "Supplier", -1); - deleteUserData(cellName, boxName, colName, "Sales", "id0001", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "id0002", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Supplier", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "id0001", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "id0002", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Supplier", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -477,7 +477,7 @@ public UserDataBatchWithNPRelationTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -492,9 +492,9 @@ public UserDataBatchWithNPRelationTest() { checkBatchResponseBody(response, expectedBody); // ユーザデータ取得 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, "Sales", "id0001", + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", "id0001", HttpStatus.SC_OK); - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, "Sales", "id0002", + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", "id0002", HttpStatus.SC_NOT_FOUND); // リンク情報のチェック(SalesDetail→Sales) @@ -516,9 +516,9 @@ public UserDataBatchWithNPRelationTest() { "srcKey", "id0001", "Sales", cellName, boxName, colName, "SalesDetail", -1); ResourceUtils.deleteUserDataLinks( "srcKey", "id0002", "Sales", cellName, boxName, colName, "SalesDetail", -1); - deleteUserData(cellName, boxName, colName, "Sales", "id0001", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "id0002", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "SalesDetail", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "id0001", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "id0002", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "SalesDetail", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -542,7 +542,7 @@ public UserDataBatchWithNPRelationTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -556,9 +556,9 @@ public UserDataBatchWithNPRelationTest() { checkBatchResponseBody(response, expectedBody); // ユーザデータ取得 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, "Sales", "id0001", + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", "id0001", HttpStatus.SC_OK); - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, "Sales", "id0002", + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", "id0002", HttpStatus.SC_OK); // リンク情報のチェック(Product→Sales) @@ -587,9 +587,9 @@ public UserDataBatchWithNPRelationTest() { "srcKey", "id0001", "Sales", cellName, boxName, colName, "Product", -1); ResourceUtils.deleteUserDataLinks( "srcKey", "id0002", "Sales", cellName, boxName, colName, "Product", -1); - deleteUserData(cellName, boxName, colName, "Sales", "id0001", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "id0002", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Product", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "id0001", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "id0002", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -610,7 +610,7 @@ public UserDataBatchWithNPRelationTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -626,7 +626,7 @@ public UserDataBatchWithNPRelationTest() { // ユーザデータ一覧取得 response = UserDataUtils.list(cellName, boxName, colName, "Sales", "", - DcCoreConfig.getMasterToken(), HttpStatus.SC_OK); + PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_OK); // ID取得 JSONArray results = (JSONArray) ((JSONObject) response.bodyAsJson().get("d")).get("results"); assertEquals(1, results.size()); @@ -647,8 +647,8 @@ public UserDataBatchWithNPRelationTest() { } finally { ResourceUtils.deleteUserDataLinks("srcKey", id, "Sales", cellName, boxName, colName, "Price", -1); - deleteUserData(cellName, boxName, colName, "Sales", id, DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Price", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", id, PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Price", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -669,7 +669,7 @@ public UserDataBatchWithNPRelationTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -685,7 +685,7 @@ public UserDataBatchWithNPRelationTest() { // ユーザデータ一覧取得 response = UserDataUtils.list(cellName, boxName, colName, "Product", "", - DcCoreConfig.getMasterToken(), HttpStatus.SC_OK); + PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_OK); // ID取得 JSONArray results = (JSONArray) ((JSONObject) response.bodyAsJson().get("d")).get("results"); assertEquals(1, results.size()); @@ -706,8 +706,8 @@ public UserDataBatchWithNPRelationTest() { } finally { ResourceUtils.deleteUserDataLinks( "srcKey", id, "Product", cellName, boxName, colName, "Supplier", -1); - deleteUserData(cellName, boxName, colName, "Product", id, DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Supplier", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", id, PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Supplier", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -729,7 +729,7 @@ public UserDataBatchWithNPRelationTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -744,7 +744,7 @@ public UserDataBatchWithNPRelationTest() { // ユーザデータ一覧取得 response = UserDataUtils.list(cellName, boxName, colName, "Supplier", "", - DcCoreConfig.getMasterToken(), HttpStatus.SC_OK); + PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_OK); // ID取得 JSONArray results = (JSONArray) ((JSONObject) response.bodyAsJson().get("d")).get("results"); assertEquals(2, results.size()); @@ -778,9 +778,9 @@ public UserDataBatchWithNPRelationTest() { "srcKey", id1, "Supplier", cellName, boxName, colName, "Sales", -1); ResourceUtils.deleteUserDataLinks( "srcKey", id2, "Supplier", cellName, boxName, colName, "Sales", -1); - deleteUserData(cellName, boxName, colName, "Supplier", id1, DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Supplier", id2, DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Supplier", id1, PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Supplier", id2, PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -801,7 +801,7 @@ public UserDataBatchWithNPRelationTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -817,7 +817,7 @@ public UserDataBatchWithNPRelationTest() { // ユーザデータ一覧取得 response = UserDataUtils.list(cellName, boxName, colName, "Supplier", "", - DcCoreConfig.getMasterToken(), HttpStatus.SC_OK); + PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_OK); // ID取得 JSONArray results = (JSONArray) ((JSONObject) response.bodyAsJson().get("d")).get("results"); assertEquals(1, results.size()); @@ -840,8 +840,8 @@ public UserDataBatchWithNPRelationTest() { } finally { ResourceUtils.deleteUserDataLinks( "srcKey", id, "Supplier", cellName, boxName, colName, "Product", -1); - deleteUserData(cellName, boxName, colName, "Supplier", id, DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Product", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Supplier", id, PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -856,14 +856,14 @@ public UserDataBatchWithNPRelationTest() { try { // 事前準備 // EntityType作成 - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, "srcEntity", + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "srcEntity", HttpStatus.SC_CREATED); - EntityTypeUtils.create(cellName, DcCoreConfig.getMasterToken(), boxName, colName, "tgtEntity", + EntityTypeUtils.create(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "tgtEntity", HttpStatus.SC_CREATED); // AssociationEnd作成 - AssociationEndUtils.create(DcCoreConfig.getMasterToken(), "1", cellName, boxName, colName, + AssociationEndUtils.create(PersoniumUnitConfig.getMasterToken(), "1", cellName, boxName, colName, HttpStatus.SC_CREATED, "ae1", "srcEntity"); - AssociationEndUtils.create(DcCoreConfig.getMasterToken(), "*", cellName, boxName, colName, + AssociationEndUtils.create(PersoniumUnitConfig.getMasterToken(), "*", cellName, boxName, colName, HttpStatus.SC_CREATED, "ae2", "tgtEntity"); AssociationEndUtils.createLink(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, "srcEntity", "tgtEntity", "ae1", "ae2", HttpStatus.SC_NO_CONTENT); @@ -886,7 +886,7 @@ public UserDataBatchWithNPRelationTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -902,7 +902,7 @@ public UserDataBatchWithNPRelationTest() { // ユーザデータ一覧取得 response = UserDataUtils.list(cellName, boxName, colName, "tgtEntity", "", - DcCoreConfig.getMasterToken(), HttpStatus.SC_OK); + PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_OK); // ID取得 JSONArray results = (JSONArray) ((JSONObject) response.bodyAsJson().get("d")).get("results"); assertEquals(2, results.size()); @@ -922,9 +922,9 @@ public UserDataBatchWithNPRelationTest() { "srcEntity", -1); ResourceUtils.deleteUserDataLinks("srcKey", id2, "tgtEntity", cellName, boxName, colName, "srcEntity", -1); - deleteUserData(cellName, boxName, colName, "tgtEntity", id1, DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "tgtEntity", id2, DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "srcEntity", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "tgtEntity", id1, PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "tgtEntity", id2, PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "srcEntity", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); // AssociationEndの削除 String url = UrlUtils .associationEndLink(cellName, boxName, colName, "ae1", "srcEntity", "ae2", "tgtEntity"); @@ -954,7 +954,7 @@ public UserDataBatchWithNPRelationTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -970,7 +970,7 @@ public UserDataBatchWithNPRelationTest() { // ユーザデータ一覧取得 response = UserDataUtils.list(cellName, boxName, colName, "Sales", "", - DcCoreConfig.getMasterToken(), HttpStatus.SC_OK); + PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_OK); // ID取得 JSONArray results = (JSONArray) ((JSONObject) response.bodyAsJson().get("d")).get("results"); assertEquals(1, results.size()); @@ -993,8 +993,8 @@ public UserDataBatchWithNPRelationTest() { } finally { ResourceUtils.deleteUserDataLinks( "srcKey", id, "Sales", cellName, boxName, colName, "Supplier", -1); - deleteUserData(cellName, boxName, colName, "Sales", id, DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Supplier", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", id, PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Supplier", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -1015,7 +1015,7 @@ public UserDataBatchWithNPRelationTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -1031,7 +1031,7 @@ public UserDataBatchWithNPRelationTest() { // ユーザデータ一覧取得 response = UserDataUtils.list(cellName, boxName, colName, "Sales", "", - DcCoreConfig.getMasterToken(), HttpStatus.SC_OK); + PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_OK); // ID取得 JSONArray results = (JSONArray) ((JSONObject) response.bodyAsJson().get("d")).get("results"); assertEquals(1, results.size()); @@ -1054,8 +1054,8 @@ public UserDataBatchWithNPRelationTest() { } finally { ResourceUtils.deleteUserDataLinks( "srcKey", id, "Sales", cellName, boxName, colName, "SalesDetail", -1); - deleteUserData(cellName, boxName, colName, "Sales", id, DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "SalesDetail", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", id, PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "SalesDetail", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -1077,7 +1077,7 @@ public UserDataBatchWithNPRelationTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -1092,7 +1092,7 @@ public UserDataBatchWithNPRelationTest() { // ユーザデータ一覧取得 response = UserDataUtils.list(cellName, boxName, colName, "Sales", "", - DcCoreConfig.getMasterToken(), HttpStatus.SC_OK); + PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_OK); // ID取得 JSONArray results = (JSONArray) ((JSONObject) response.bodyAsJson().get("d")).get("results"); assertEquals(2, results.size()); @@ -1125,9 +1125,9 @@ public UserDataBatchWithNPRelationTest() { "srcKey", id1, "Sales", cellName, boxName, colName, "Product", -1); ResourceUtils.deleteUserDataLinks( "srcKey", id2, "Sales", cellName, boxName, colName, "Product", -1); - deleteUserData(cellName, boxName, colName, "Sales", id1, DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", id2, DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Product", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", id1, PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", id2, PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -1172,7 +1172,7 @@ public UserDataBatchWithNPRelationTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -1241,16 +1241,16 @@ public UserDataBatchWithNPRelationTest() { ResourceUtils.deleteUserDataLinks("srcKey004", "id0021", "Sales", cellName, boxName, colName, "Supplier", -1); - deleteUserData(cellName, boxName, colName, "Sales", "id0001", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "id0011", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "id0012", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Supplier", "id0031", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "id0021", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "id0001", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "id0011", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "id0012", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Supplier", "id0031", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "id0021", PersoniumUnitConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Price", "srcKey001", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Product", "srcKey002", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "srcKey003", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Supplier", "srcKey004", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Price", "srcKey001", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "srcKey002", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "srcKey003", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Supplier", "srcKey004", PersoniumUnitConfig.getMasterToken(), -1); } } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/UserDataBatchWithNPTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/batch/UserDataBatchWithNPTest.java similarity index 85% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/UserDataBatchWithNPTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/batch/UserDataBatchWithNPTest.java index c62493778..0bb43fcb9 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/batch/UserDataBatchWithNPTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/batch/UserDataBatchWithNPTest.java @@ -14,22 +14,22 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.batch; - -import static com.fujitsu.dc.test.utils.BatchUtils.BOUNDARY; -import static com.fujitsu.dc.test.utils.BatchUtils.END_BOUNDARY; -import static com.fujitsu.dc.test.utils.BatchUtils.START_BOUNDARY; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveChangeSetResErrorBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveDeleteBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveGetBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveListBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrievePostBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrievePostBodyOfProperty; -import static com.fujitsu.dc.test.utils.BatchUtils.retrievePostNoneBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrievePostWithBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrievePutBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrievePutResBody; -import static com.fujitsu.dc.test.utils.BatchUtils.retrieveQueryOperationResErrorBody; +package io.personium.test.jersey.box.odatacol.batch; + +import static io.personium.test.utils.BatchUtils.BOUNDARY; +import static io.personium.test.utils.BatchUtils.END_BOUNDARY; +import static io.personium.test.utils.BatchUtils.START_BOUNDARY; +import static io.personium.test.utils.BatchUtils.retrieveChangeSetResErrorBody; +import static io.personium.test.utils.BatchUtils.retrieveDeleteBody; +import static io.personium.test.utils.BatchUtils.retrieveGetBody; +import static io.personium.test.utils.BatchUtils.retrieveListBody; +import static io.personium.test.utils.BatchUtils.retrievePostBody; +import static io.personium.test.utils.BatchUtils.retrievePostBodyOfProperty; +import static io.personium.test.utils.BatchUtils.retrievePostNoneBody; +import static io.personium.test.utils.BatchUtils.retrievePostWithBody; +import static io.personium.test.utils.BatchUtils.retrievePutBody; +import static io.personium.test.utils.BatchUtils.retrievePutResBody; +import static io.personium.test.utils.BatchUtils.retrieveQueryOperationResErrorBody; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; @@ -44,27 +44,27 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.CompareJSON; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.odatacol.schema.property.PropertyUtils; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.test.CompareJSON; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.odatacol.schema.property.PropertyUtils; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; /** * UserData$batchのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UserDataBatchWithNPTest extends AbstractUserDataBatchTest { @@ -98,7 +98,7 @@ public UserDataBatchWithNPTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -122,9 +122,9 @@ public UserDataBatchWithNPTest() { } finally { ResourceUtils.deleteUserDataLinks("srcKey", "id0001", "Product", cellName, boxName, colName, "Sales", -1); ResourceUtils.deleteUserDataLinks("srcKey", "id0002", "Product", cellName, boxName, colName, "Sales", -1); - deleteUserData(cellName, boxName, colName, "Product", "id0001", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Product", "id0002", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "id0001", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "id0002", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -151,7 +151,7 @@ public UserDataBatchWithNPTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -177,9 +177,9 @@ public UserDataBatchWithNPTest() { } finally { ResourceUtils.deleteUserDataLinks("srcKey", "id0001", "Product", cellName, boxName, colName, "Sales", -1); ResourceUtils.deleteUserDataLinks("srcKey", "id0002", "Product", cellName, boxName, colName, "Sales", -1); - deleteUserData(cellName, boxName, colName, "Product", "id0001", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Product", "id0002", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "id0001", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "id0002", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -204,7 +204,7 @@ public UserDataBatchWithNPTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -219,16 +219,16 @@ public UserDataBatchWithNPTest() { checkBatchResponseBody(response, expectedBody); // ユーザデータが登録されていないことの確認 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, "Product", "id0001", + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Product", "id0001", HttpStatus.SC_NOT_FOUND); - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, "Product", "id0002", + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Product", "id0002", HttpStatus.SC_NOT_FOUND); } finally { ResourceUtils.deleteUserDataLinks("srcKey", "id0001", "Product", cellName, boxName, colName, "Sales", -1); ResourceUtils.deleteUserDataLinks("srcKey", "id0002", "Product", cellName, boxName, colName, "Sales", -1); - deleteUserData(cellName, boxName, colName, "Product", "id0001", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Product", "id0002", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "id0001", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "id0002", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -253,7 +253,7 @@ public UserDataBatchWithNPTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -267,16 +267,16 @@ public UserDataBatchWithNPTest() { checkBatchResponseBody(response, expectedBody); // ユーザデータが登録されていないことの確認 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, "Product", "id0001", + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Product", "id0001", HttpStatus.SC_NOT_FOUND); - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, "Product", "id0002", + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Product", "id0002", HttpStatus.SC_NOT_FOUND); } finally { ResourceUtils.deleteUserDataLinks("srcKey", "id0001", "Product", cellName, boxName, colName, "Sales", -1); ResourceUtils.deleteUserDataLinks("srcKey", "id0002", "Product", cellName, boxName, colName, "Sales", -1); - deleteUserData(cellName, boxName, colName, "Product", "id0001", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Product", "id0002", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "id0001", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "id0002", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -302,7 +302,7 @@ public UserDataBatchWithNPTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -325,9 +325,9 @@ public UserDataBatchWithNPTest() { } finally { ResourceUtils.deleteUserDataLinks("srcKey", "id0001", "Product", cellName, boxName, colName, "Sales", -1); ResourceUtils.deleteUserDataLinks("srcKey", "id0002", "Product", cellName, boxName, colName, "Sales", -1); - deleteUserData(cellName, boxName, colName, "Product", "id0001", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Product", "id0002", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "id0001", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "id0002", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -350,7 +350,7 @@ public UserDataBatchWithNPTest() { super.createUserData(srcBody, HttpStatus.SC_CREATED, cellName, boxName, colName, "Product"); // $batch前のデータ取得 - TResponse original = UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + TResponse original = UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Product", "id0001", HttpStatus.SC_OK); // $batch @@ -363,7 +363,7 @@ public UserDataBatchWithNPTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -376,7 +376,7 @@ public UserDataBatchWithNPTest() { checkBatchResponseBody(response, expectedBody); // ユーザデータ取得 書き換わっていない - TResponse after = UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + TResponse after = UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Product", "id0001", HttpStatus.SC_OK); CompareJSON.Result res = CompareJSON.compareJSON(original.bodyAsJson(), after.bodyAsJson()); assertNull(res); @@ -389,8 +389,8 @@ public UserDataBatchWithNPTest() { } finally { ResourceUtils.deleteUserDataLinks("srcKey", "id0001", "Product", cellName, boxName, colName, "Sales", -1); - deleteUserData(cellName, boxName, colName, "Product", "id0001", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "id0001", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -405,7 +405,7 @@ public UserDataBatchWithNPTest() { srcBody.put("__id", "srcKey"); srcBody.put("Name", "key0001"); - int maxPropNum = DcCoreConfig.getMaxPropertyCountInEntityType(); + int maxPropNum = PersoniumUnitConfig.getMaxPropertyCountInEntityType(); super.createUserData(srcBody, HttpStatus.SC_CREATED, cellName, boxName, colName, Setup.TEST_ENTITYTYPE_MN); String path = Setup.TEST_ENTITYTYPE_MN + "('srcKey')/_" + Setup.TEST_ENTITYTYPE_MDP; String body = START_BOUNDARY @@ -416,7 +416,7 @@ public UserDataBatchWithNPTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -439,9 +439,9 @@ public UserDataBatchWithNPTest() { ResourceUtils.deleteUserDataLinks("srcKey", "id0001", Setup.TEST_ENTITYTYPE_MDP, cellName, boxName, colName, Setup.TEST_ENTITYTYPE_MN, -1); deleteUserData(cellName, boxName, colName, Setup.TEST_ENTITYTYPE_MDP, "id0001", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); deleteUserData(cellName, boxName, colName, Setup.TEST_ENTITYTYPE_MN, "srcKey", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); } } @@ -456,7 +456,7 @@ public UserDataBatchWithNPTest() { srcBody.put("__id", "srcKey"); srcBody.put("Name", "key0001"); - int maxPropNum = DcCoreConfig.getMaxPropertyCountInEntityType() + 1; + int maxPropNum = PersoniumUnitConfig.getMaxPropertyCountInEntityType() + 1; super.createUserData(srcBody, HttpStatus.SC_CREATED, cellName, boxName, colName, "Sales"); String path = "Sales('srcKey')/_Product"; String body = START_BOUNDARY @@ -467,7 +467,7 @@ public UserDataBatchWithNPTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -486,8 +486,8 @@ public UserDataBatchWithNPTest() { } finally { ResourceUtils.deleteUserDataLinks("srcKey", "id0001", "Product", cellName, boxName, colName, "Sales", -1); - deleteUserData(cellName, boxName, colName, "Product", "id0001", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "id0001", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -514,7 +514,7 @@ public UserDataBatchWithNPTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -530,7 +530,7 @@ public UserDataBatchWithNPTest() { + END_BOUNDARY; checkBatchResponseBody(response, expectedBody); } finally { - deleteUserData(cellName, boxName, colName, "Sales", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -561,7 +561,7 @@ public UserDataBatchWithNPTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -589,9 +589,9 @@ public UserDataBatchWithNPTest() { } finally { ResourceUtils.deleteUserDataLinks("srcKey", "id0001", "Product", cellName, boxName, colName, "Sales", -1); ResourceUtils.deleteUserDataLinks("srcKey", "id0002", "Product", cellName, boxName, colName, "Sales", -1); - deleteUserData(cellName, boxName, colName, "Product", "id0001", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Product", "id0002", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "id0001", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "id0002", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -622,7 +622,7 @@ public UserDataBatchWithNPTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -650,9 +650,9 @@ public UserDataBatchWithNPTest() { } finally { ResourceUtils.deleteUserDataLinks("srcKey", "id0001", "Product", cellName, boxName, colName, "Sales", -1); ResourceUtils.deleteUserDataLinks("srcKey", "id0002", "Product", cellName, boxName, colName, "Sales", -1); - deleteUserData(cellName, boxName, colName, "Product", "id0001", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Product", "id0002", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "id0001", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "id0002", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -676,7 +676,7 @@ public UserDataBatchWithNPTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -691,9 +691,9 @@ public UserDataBatchWithNPTest() { checkBatchResponseBody(response, expectedBody); // ユーザデータ取得 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, "Supplier", "id0001", + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Supplier", "id0001", HttpStatus.SC_OK); - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, "Sales", "id0001", + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", "id0001", HttpStatus.SC_OK); // リンク情報のチェック(Sales→Supplier) @@ -727,10 +727,10 @@ public UserDataBatchWithNPTest() { } finally { ResourceUtils.deleteUserDataLinks("srcKey", "id0001", "Supplier", cellName, boxName, colName, "Sales", -1); ResourceUtils.deleteUserDataLinks("srcKey", "id0001", "Sales", cellName, boxName, colName, "Product", -1); - deleteUserData(cellName, boxName, colName, "Supplier", "id0001", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "id0001", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", "srcKey", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Product", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Supplier", "id0001", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "id0001", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -753,7 +753,7 @@ public UserDataBatchWithNPTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -766,13 +766,13 @@ public UserDataBatchWithNPTest() { checkBatchResponseBody(response, expectedBody); // ユーザデータ取得 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "SalesDetail", "id0001", HttpStatus.SC_NOT_FOUND); } finally { - deleteUserData(cellName, boxName, colName, "SalesDetail", "id0001", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "SalesDetail", "id0002", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Product", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "SalesDetail", "id0001", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "SalesDetail", "id0002", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -793,7 +793,7 @@ public UserDataBatchWithNPTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -808,14 +808,14 @@ public UserDataBatchWithNPTest() { checkBatchResponseBody(response, expectedBody); // ユーザデータ取得 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", "src/Key", HttpStatus.SC_NOT_FOUND); - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", "src@Key", HttpStatus.SC_NOT_FOUND); - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", "_srcKey", HttpStatus.SC_NOT_FOUND); } finally { - deleteUserData(cellName, boxName, colName, "Product", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -834,7 +834,7 @@ public UserDataBatchWithNPTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -847,10 +847,10 @@ public UserDataBatchWithNPTest() { checkBatchResponseBody(response, expectedBody); // ユーザデータ取得 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", "src%20Key", HttpStatus.SC_NOT_FOUND); } finally { - deleteUserData(cellName, boxName, colName, "Product", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -869,7 +869,7 @@ public UserDataBatchWithNPTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -882,10 +882,10 @@ public UserDataBatchWithNPTest() { checkBatchResponseBody(response, expectedBody); // ユーザデータ取得 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", "", HttpStatus.SC_NOT_FOUND); } finally { - deleteUserData(cellName, boxName, colName, "Product", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -909,7 +909,7 @@ public UserDataBatchWithNPTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -921,7 +921,7 @@ public UserDataBatchWithNPTest() { checkBatchResponseBody(response, expectedBody); // ユーザデータ取得 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", id, HttpStatus.SC_OK); // リンク情報のチェック(Product→Sales) TResponse resList = UserDataUtils.listLink(cellName, boxName, colName, "Product", "srcKey", @@ -939,8 +939,8 @@ public UserDataBatchWithNPTest() { } finally { ResourceUtils.deleteUserDataLinks("srcKey", id, "Sales", cellName, boxName, colName, "Product", -1); - deleteUserData(cellName, boxName, colName, "Sales", id, DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Product", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", id, PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -964,7 +964,7 @@ public UserDataBatchWithNPTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -977,10 +977,10 @@ public UserDataBatchWithNPTest() { checkBatchResponseBody(response, expectedBody); // ユーザデータ取得 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", id, HttpStatus.SC_NOT_FOUND); } finally { - deleteUserData(cellName, boxName, colName, "Product", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -999,7 +999,7 @@ public UserDataBatchWithNPTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -1011,7 +1011,7 @@ public UserDataBatchWithNPTest() { checkBatchResponseBody(response, expectedBody); // ユーザデータ取得 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", "null", HttpStatus.SC_OK); // リンク情報のチェック(Product→Sales) TResponse resList = UserDataUtils.listLink(cellName, boxName, colName, "Product", "srcKey", @@ -1029,8 +1029,8 @@ public UserDataBatchWithNPTest() { } finally { ResourceUtils.deleteUserDataLinks("srcKey", "null", "Sales", cellName, boxName, colName, "Product", -1); - deleteUserData(cellName, boxName, colName, "Sales", "null", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Product", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "null", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -1049,7 +1049,7 @@ public UserDataBatchWithNPTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -1060,7 +1060,7 @@ public UserDataBatchWithNPTest() { + START_BOUNDARY + retrieveChangeSetResErrorBody(HttpStatus.SC_BAD_REQUEST) + END_BOUNDARY; checkBatchResponseBody(response, expectedBody); } finally { - deleteUserData(cellName, boxName, colName, "Product", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } @@ -1081,7 +1081,7 @@ public UserDataBatchWithNPTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -1094,7 +1094,7 @@ public UserDataBatchWithNPTest() { // ユーザデータ一覧取得 response = UserDataUtils.list(cellName, boxName, colName, "Sales", "", - DcCoreConfig.getMasterToken(), HttpStatus.SC_OK); + PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_OK); // ID取得 JSONArray results = (JSONArray) ((JSONObject) response.bodyAsJson().get("d")).get("results"); id = (String) ((JSONObject) results.get(0)).get("__id"); @@ -1109,8 +1109,8 @@ public UserDataBatchWithNPTest() { } finally { ResourceUtils.deleteUserDataLinks("srcKey", id, "Sales", cellName, boxName, colName, "Product", -1); - deleteUserData(cellName, boxName, colName, "Product", "srcKey", DcCoreConfig.getMasterToken(), -1); - deleteUserData(cellName, boxName, colName, "Sales", id, DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", id, PersoniumUnitConfig.getMasterToken(), -1); } } @@ -1126,7 +1126,7 @@ public UserDataBatchWithNPTest() { "Sales"); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, "Sales"); @@ -1147,7 +1147,7 @@ public UserDataBatchWithNPTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .debug() @@ -1159,10 +1159,10 @@ public UserDataBatchWithNPTest() { checkBatchResponseBody(response, expectedBody); // ユーザデータ取得 - UserDataUtils.get(cellName, DcCoreConfig.getMasterToken(), boxName, colName, + UserDataUtils.get(cellName, PersoniumUnitConfig.getMasterToken(), boxName, colName, "Sales", "test_invalid_propValue", HttpStatus.SC_NOT_FOUND); } finally { - deleteUserData(cellName, boxName, colName, "Product", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Product", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); // 作成したPropertyを削除 assertEquals(HttpStatus.SC_NO_CONTENT, ODataCommon.deleteOdataResource(locationUrl).getStatusCode()); } @@ -1174,8 +1174,8 @@ public UserDataBatchWithNPTest() { @Test public final void $batchのNP経由ユーザデータ登録でNavProp名が指定されていない場合400レスポンスが返却されること() { String path = "Sales('srcKey')/"; - String code = DcCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.getCode(); - String err = DcCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.params("POST " + path + " HTTP/1.1") + String code = PersoniumCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.getCode(); + String err = PersoniumCoreException.OData.BATCH_BODY_FORMAT_PATH_ERROR.params("POST " + path + " HTTP/1.1") .getMessage(); String body = START_BOUNDARY @@ -1186,7 +1186,7 @@ public UserDataBatchWithNPTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) @@ -1209,7 +1209,7 @@ public UserDataBatchWithNPTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -1238,7 +1238,7 @@ public UserDataBatchWithNPTest() { .with("box", boxName) .with("collection", colName) .with("boundary", BOUNDARY) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body) .returns() .statusCode(HttpStatus.SC_ACCEPTED) @@ -1250,7 +1250,7 @@ public UserDataBatchWithNPTest() { + END_BOUNDARY; checkBatchResponseBody(response, expectedBody); } finally { - deleteUserData(cellName, boxName, colName, "Sales", "srcKey", DcCoreConfig.getMasterToken(), -1); + deleteUserData(cellName, boxName, colName, "Sales", "srcKey", PersoniumUnitConfig.getMasterToken(), -1); } } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/package-info.java b/src/test/java/io/personium/test/jersey/box/odatacol/package-info.java similarity index 90% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/package-info.java rename to src/test/java/io/personium/test/jersey/box/odatacol/package-info.java index 6eb2b2786..bad96f619 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/package-info.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/package-info.java @@ -17,5 +17,5 @@ /** * UserData CRUD test. */ -package com.fujitsu.dc.test.jersey.box.odatacol; +package io.personium.test.jersey.box.odatacol; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AllTests.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AllTests.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AllTests.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AllTests.java index 4b25dbcb0..cf2972027 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AllTests.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.assocend; +package io.personium.test.jersey.box.odatacol.schema.assocend; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AssociationEndCreateLinkTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AssociationEndCreateLinkTest.java similarity index 93% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AssociationEndCreateLinkTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AssociationEndCreateLinkTest.java index 64f528a64..89b4233c4 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AssociationEndCreateLinkTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AssociationEndCreateLinkTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.assocend; +package io.personium.test.jersey.box.odatacol.schema.assocend; import javax.ws.rs.core.MediaType; @@ -27,26 +27,26 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmMultiplicity; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AssociationEndUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AssociationEndUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; /** * AssociationEnd登録のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class AssociationEndCreateLinkTest extends AbstractCase { @@ -54,7 +54,7 @@ public class AssociationEndCreateLinkTest extends AbstractCase { * コンストラクタ. */ public AssociationEndCreateLinkTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -313,8 +313,8 @@ public AssociationEndCreateLinkTest() { // メッセージチェック ODataCommon.checkErrorResponseBody(response, - DcCoreException.OData.NOT_FOUND.getCode(), - DcCoreException.OData.NOT_FOUND.getMessage()); + PersoniumCoreException.OData.NOT_FOUND.getCode(), + PersoniumCoreException.OData.NOT_FOUND.getMessage()); } finally { // AssociationEndの削除 deleteAssociationEnd(linkName, linkEntityTypeName); @@ -352,8 +352,8 @@ public AssociationEndCreateLinkTest() { // メッセージチェック ODataCommon.checkErrorResponseBody(response, - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("uri").getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("uri").getMessage()); } finally { // AssociationEndの削除 deleteAssociationEnd(name, entityTypeName); @@ -403,8 +403,8 @@ public AssociationEndCreateLinkTest() { // メッセージチェック ODataCommon.checkErrorResponseBody(response, - DcCoreException.OData.INVALID_MULTIPLICITY.getCode(), - DcCoreException.OData.INVALID_MULTIPLICITY.getMessage()); + PersoniumCoreException.OData.INVALID_MULTIPLICITY.getCode(), + PersoniumCoreException.OData.INVALID_MULTIPLICITY.getMessage()); } finally { // AssociationEnd削除 @@ -573,8 +573,8 @@ public AssociationEndCreateLinkTest() { AbstractCase.MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, entityType1, entityType2, assocEntity1of2, assocEntity2of2, HttpStatus.SC_CONFLICT); ODataCommon.checkErrorResponseBody(res, - DcCoreException.OData.CONFLICT_DUPLICATED_ENTITY_RELATION.getCode(), - DcCoreException.OData.CONFLICT_DUPLICATED_ENTITY_RELATION.getMessage()); + PersoniumCoreException.OData.CONFLICT_DUPLICATED_ENTITY_RELATION.getCode(), + PersoniumCoreException.OData.CONFLICT_DUPLICATED_ENTITY_RELATION.getMessage()); // UserOData登録 JSONObject body1 = (JSONObject) new JSONParser().parse("{\"__id\":\"id\", \"name\":\"pochi\"}"); @@ -739,7 +739,7 @@ public AssociationEndCreateLinkTest() { private void createAssociationEnd(String name, String entityTypeName) { Http.request("box/odatacol/schema/assocend/create.txt").with("cell", "testcell1").with("box", "box1") .with("collection", "setodata").with("accept", MediaType.APPLICATION_JSON) - .with("contentType", MediaType.APPLICATION_JSON).with("token", DcCoreConfig.getMasterToken()) + .with("contentType", MediaType.APPLICATION_JSON).with("token", PersoniumUnitConfig.getMasterToken()) .with("name", name).with("multiplicity", EdmMultiplicity.MANY.getSymbolString()) .with("entityTypeName", entityTypeName).returns().statusCode(HttpStatus.SC_CREATED).debug(); } @@ -749,7 +749,7 @@ private void createAssociationEnd(String name, String entityTypeName) { */ private void deleteAssociationEnd(String name, String entityTypeName) { Http.request("box/odatacol/schema/assocend/delete.txt").with("cell", "testcell1").with("box", "box1") - .with("collection", "setodata").with("token", DcCoreConfig.getMasterToken()).with("name", name) + .with("collection", "setodata").with("token", PersoniumUnitConfig.getMasterToken()).with("name", name) .with("entityTypeName", entityTypeName).with("ifMatch", "*").returns() .statusCode(HttpStatus.SC_NO_CONTENT).debug(); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AssociationEndCreateTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AssociationEndCreateTest.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AssociationEndCreateTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AssociationEndCreateTest.java index ad723c0e7..b451de92e 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AssociationEndCreateTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AssociationEndCreateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.assocend; +package io.personium.test.jersey.box.odatacol.schema.assocend; import java.util.HashMap; import java.util.Map; @@ -29,21 +29,21 @@ import org.odata4j.core.ODataConstants; import org.odata4j.edm.EdmMultiplicity; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * AssociationEnd登録のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class AssociationEndCreateTest extends ODataCommon { @@ -61,7 +61,7 @@ public class AssociationEndCreateTest extends ODataCommon { * コンストラクタ. */ public AssociationEndCreateTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); location = UrlUtils.associationEnd("testcell1", "box1", "setodata", ASSOCIATION_END_NAME, ENTITY_TYPE_NAME); } @@ -76,7 +76,7 @@ public AssociationEndCreateTest() { .with("collection", "setodata") .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("name", ASSOCIATION_END_NAME) .with("multiplicity", EdmMultiplicity.MANY.getSymbolString()) .with("entityTypeName", ENTITY_TYPE_NAME) @@ -109,7 +109,7 @@ public AssociationEndCreateTest() { .with("collection", "setodata") .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("name", ASSOCIATION_END_NAME) .with("multiplicity", EdmMultiplicity.MANY.getSymbolString()) .with("entityTypeName", ENTITY_TYPE_NAME) @@ -136,7 +136,7 @@ public AssociationEndCreateTest() { .with("collection", "setodata") .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("name", ASSOCIATION_END_NAME) .with("multiplicity", EdmMultiplicity.MANY.getSymbolString()) .with("entityTypeName", ENTITY_TYPE_NAME) @@ -164,7 +164,7 @@ public AssociationEndCreateTest() { .with("collection", "test") .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("name", ASSOCIATION_END_NAME) .with("multiplicity", EdmMultiplicity.MANY.getSymbolString()) .with("entityTypeName", ENTITY_TYPE_NAME) @@ -188,7 +188,7 @@ public AssociationEndCreateTest() { .with("collection", "setodata") .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("name", ASSOCIATION_END_NAME) .with("multiplicity", EdmMultiplicity.MANY.getSymbolString()) .with("entityTypeName", ENTITY_TYPE_NAME) @@ -202,7 +202,7 @@ public AssociationEndCreateTest() { .with("collection", "setodata") .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("name", ASSOCIATION_END_NAME) .with("multiplicity", EdmMultiplicity.MANY.getSymbolString()) .with("entityTypeName", ENTITY_TYPE_NAME) @@ -236,7 +236,7 @@ public AssociationEndCreateTest() { .with("collection", "setodata") .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body.toJSONString()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) @@ -261,7 +261,7 @@ public AssociationEndCreateTest() { .with("collection", "setodata") .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body.toJSONString()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) @@ -286,7 +286,7 @@ public AssociationEndCreateTest() { .with("collection", "setodata") .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", body.toJSONString()) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST) @@ -776,7 +776,7 @@ public AssociationEndCreateTest() { .with("collection", "setodata") .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("name", assocName) .with("multiplicity", multiplicity) .with("entityTypeName", entityTypeName) @@ -788,8 +788,8 @@ public AssociationEndCreateTest() { // メッセージチェック ODataCommon.checkErrorResponseBody(res, - DcCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.getCode(), - DcCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.params(entityTypeName).getMessage()); + PersoniumCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.getCode(), + PersoniumCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.params(entityTypeName).getMessage()); } finally { if (locationHeader != null) { @@ -809,7 +809,7 @@ private TResponse createEntityType(String entityTypeName) { .with("boxPath", "box1") .with("odataSvcPath", "setodata") .with("accept", MediaType.APPLICATION_JSON) - .with("token", "Bearer " + DcCoreConfig.getMasterToken()) + .with("token", "Bearer " + PersoniumUnitConfig.getMasterToken()) .with("Name", entityTypeName) .returns() .debug(); @@ -829,7 +829,7 @@ private TResponse createAssociationEnd(String assocName, String multiplicity, St .with("collection", "setodata") .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("name", assocName) .with("multiplicity", multiplicity) .with("entityTypeName", entityTypeName) @@ -845,7 +845,7 @@ private void deleteAssociationEnd() { .with("cell", "testcell1") .with("box", "box1") .with("collection", "setodata") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("name", ASSOCIATION_END_NAME) .with("entityTypeName", ENTITY_TYPE_NAME) .with("ifMatch", "*") diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AssociationEndCreateViaNPTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AssociationEndCreateViaNPTest.java similarity index 88% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AssociationEndCreateViaNPTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AssociationEndCreateViaNPTest.java index d01a8dd85..6eda74183 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AssociationEndCreateViaNPTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AssociationEndCreateViaNPTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.assocend; +package io.personium.test.jersey.box.odatacol.schema.assocend; import static org.junit.Assert.assertEquals; @@ -29,23 +29,23 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.utils.AssociationEndUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.utils.AssociationEndUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; /** * AssociationEnd NP経由登録のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class AssociationEndCreateViaNPTest extends AbstractCase { @@ -53,7 +53,7 @@ public class AssociationEndCreateViaNPTest extends AbstractCase { * コンストラクタ. */ public AssociationEndCreateViaNPTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -143,8 +143,8 @@ public AssociationEndCreateViaNPTest() { assocEntity1of2, entityType1, assocEntity2of2, "*", entityType2, HttpStatus.SC_CONFLICT); ODataCommon.checkErrorResponseBody(res, - DcCoreException.OData.CONFLICT_DUPLICATED_ENTITY_RELATION.getCode(), - DcCoreException.OData.CONFLICT_DUPLICATED_ENTITY_RELATION.getMessage()); + PersoniumCoreException.OData.CONFLICT_DUPLICATED_ENTITY_RELATION.getCode(), + PersoniumCoreException.OData.CONFLICT_DUPLICATED_ENTITY_RELATION.getMessage()); // UserOData登録 JSONObject body1 = (JSONObject) new JSONParser().parse("{\"__id\":\"id\", \"name\":\"pochi\"}"); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AssociationEndDeleteLinkTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AssociationEndDeleteLinkTest.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AssociationEndDeleteLinkTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AssociationEndDeleteLinkTest.java index e7c03de9c..c8aabe18e 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AssociationEndDeleteLinkTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AssociationEndDeleteLinkTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.assocend; +package io.personium.test.jersey.box.odatacol.schema.assocend; import javax.ws.rs.HttpMethod; import javax.ws.rs.core.MediaType; @@ -25,24 +25,24 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmMultiplicity; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AssociationEndUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AssociationEndUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * AssociationEndの$ink削除のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class AssociationEndDeleteLinkTest extends AbstractCase { @@ -50,7 +50,7 @@ public class AssociationEndDeleteLinkTest extends AbstractCase { * コンストラクタ. */ public AssociationEndDeleteLinkTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -426,7 +426,7 @@ private TResponse createLink(String entityTypeName, String linkEntityTypeName, S private void createAssociationEnd(String name, String entityTypeName) { Http.request("box/odatacol/schema/assocend/create.txt").with("cell", "testcell1").with("box", "box1") .with("collection", "setodata").with("accept", MediaType.APPLICATION_JSON) - .with("contentType", MediaType.APPLICATION_JSON).with("token", DcCoreConfig.getMasterToken()) + .with("contentType", MediaType.APPLICATION_JSON).with("token", PersoniumUnitConfig.getMasterToken()) .with("name", name).with("multiplicity", EdmMultiplicity.MANY.getSymbolString()) .with("entityTypeName", entityTypeName).returns().statusCode(HttpStatus.SC_CREATED).debug(); } @@ -436,7 +436,7 @@ private void createAssociationEnd(String name, String entityTypeName) { */ private void deleteAssociationEnd(String name, String entityTypeName) { Http.request("box/odatacol/schema/assocend/delete.txt").with("cell", "testcell1").with("box", "box1") - .with("collection", "setodata").with("token", DcCoreConfig.getMasterToken()).with("name", name) + .with("collection", "setodata").with("token", PersoniumUnitConfig.getMasterToken()).with("name", name) .with("entityTypeName", entityTypeName).with("ifMatch", "*").returns() .statusCode(HttpStatus.SC_NO_CONTENT).debug(); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AssociationEndDeleteTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AssociationEndDeleteTest.java similarity index 86% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AssociationEndDeleteTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AssociationEndDeleteTest.java index fb5af8b9d..a10862004 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AssociationEndDeleteTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AssociationEndDeleteTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.assocend; +package io.personium.test.jersey.box.odatacol.schema.assocend; import javax.ws.rs.core.MediaType; @@ -26,19 +26,19 @@ import org.odata4j.core.ODataVersion; import org.odata4j.edm.EdmMultiplicity; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * AssociationEnd登録のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class AssociationEndDeleteTest extends AbstractCase { @@ -50,7 +50,7 @@ public class AssociationEndDeleteTest extends AbstractCase { * コンストラクタ. */ public AssociationEndDeleteTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -66,7 +66,7 @@ public AssociationEndDeleteTest() { .with("cell", "testcell1") .with("box", "box1") .with("collection", "setodata") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("name", ASSOCIATION_END_NAME) .with("entityTypeName", ENTITY_TYPE_NAME) .with("ifMatch", "*") @@ -89,7 +89,7 @@ public AssociationEndDeleteTest() { .with("cell", "dummyTestCell") .with("box", "box1") .with("collection", "setodata") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("name", ASSOCIATION_END_NAME) .with("entityTypeName", ENTITY_TYPE_NAME) .with("ifMatch", "*") @@ -115,7 +115,7 @@ public AssociationEndDeleteTest() { .with("cell", "testcell1") .with("box", "test") .with("collection", "setodata") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("name", ASSOCIATION_END_NAME) .with("entityTypeName", ENTITY_TYPE_NAME) .with("ifMatch", "*") @@ -141,7 +141,7 @@ public AssociationEndDeleteTest() { .with("cell", "testcell1") .with("box", "box1") .with("collection", "test") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("name", ASSOCIATION_END_NAME) .with("entityTypeName", ENTITY_TYPE_NAME) .with("ifMatch", "*") @@ -164,7 +164,7 @@ public AssociationEndDeleteTest() { .with("cell", "testcell1") .with("box", "box1") .with("collection", "setodata") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("name", "test") .with("entityTypeName", ENTITY_TYPE_NAME) .with("ifMatch", "*") @@ -190,7 +190,7 @@ public AssociationEndDeleteTest() { .with("cell", "testcell1") .with("box", "box1") .with("collection", "setodata") - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("name", ASSOCIATION_END_NAME) .with("entityTypeName", "test") .with("ifMatch", "*") @@ -216,7 +216,7 @@ private void createAssociationEnd() { .with("collection", "setodata") .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("name", ASSOCIATION_END_NAME) .with("multiplicity", EdmMultiplicity.MANY.getSymbolString()) .with("entityTypeName", ENTITY_TYPE_NAME) diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AssociationEndListLinkTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AssociationEndListLinkTest.java similarity index 87% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AssociationEndListLinkTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AssociationEndListLinkTest.java index 09c025509..dbfa0586d 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AssociationEndListLinkTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AssociationEndListLinkTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.assocend; +package io.personium.test.jersey.box.odatacol.schema.assocend; import java.util.ArrayList; import java.util.HashMap; @@ -28,25 +28,25 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmMultiplicity; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.model.ctl.AssociationEnd; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AssociationEndUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.model.ctl.AssociationEnd; +import io.personium.core.model.ctl.Common; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AssociationEndUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * AssociationEnd登録のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class AssociationEndListLinkTest extends AbstractCase { @@ -54,7 +54,7 @@ public class AssociationEndListLinkTest extends AbstractCase { * コンストラクタ. */ public AssociationEndListLinkTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -201,7 +201,7 @@ private TResponse createLink(String entityTypeName, String linkEntityTypeName, S private TResponse createAssociationEnd(String name, String entityTypeName) { return Http.request("box/odatacol/schema/assocend/create.txt").with("cell", "testcell1").with("box", "box1") .with("collection", "setodata").with("accept", MediaType.APPLICATION_JSON) - .with("contentType", MediaType.APPLICATION_JSON).with("token", DcCoreConfig.getMasterToken()) + .with("contentType", MediaType.APPLICATION_JSON).with("token", PersoniumUnitConfig.getMasterToken()) .with("name", name).with("multiplicity", EdmMultiplicity.MANY.getSymbolString()) .with("entityTypeName", entityTypeName).returns().statusCode(HttpStatus.SC_CREATED).debug(); } @@ -211,7 +211,7 @@ private TResponse createAssociationEnd(String name, String entityTypeName) { */ private void deleteAssociationEnd(String name, String entityTypeName) { Http.request("box/odatacol/schema/assocend/delete.txt").with("cell", "testcell1").with("box", "box1") - .with("collection", "setodata").with("token", DcCoreConfig.getMasterToken()).with("name", name) + .with("collection", "setodata").with("token", PersoniumUnitConfig.getMasterToken()).with("name", name) .with("entityTypeName", entityTypeName).with("ifMatch", "*").returns() .statusCode(HttpStatus.SC_NO_CONTENT).debug(); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AssociationEndReadLinkTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AssociationEndReadLinkTest.java similarity index 83% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AssociationEndReadLinkTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AssociationEndReadLinkTest.java index 1588fec45..d002f59d2 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AssociationEndReadLinkTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AssociationEndReadLinkTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.assocend; +package io.personium.test.jersey.box.odatacol.schema.assocend; import static org.junit.Assert.assertEquals; @@ -29,25 +29,25 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmMultiplicity; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcException; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRestAdapter; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AssociationEndUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumException; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumRestAdapter; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AssociationEndUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * AssociationEndの$ink削除のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class AssociationEndReadLinkTest extends AbstractCase { @@ -55,7 +55,7 @@ public class AssociationEndReadLinkTest extends AbstractCase { * コンストラクタ. */ public AssociationEndReadLinkTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -120,7 +120,7 @@ public AssociationEndReadLinkTest() { // リクエストヘッダをセット HashMap requestheaders = new HashMap(); - requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + DcCoreConfig.getMasterToken()); + requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + PersoniumUnitConfig.getMasterToken()); String linksNavKey = URLEncoder.encode("'" + UrlUtils.associationEnd(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, linkName, @@ -128,11 +128,11 @@ public AssociationEndReadLinkTest() { String requestUrl = UrlUtils.associationEnd(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, name, entityTypeName) + "/$links/_AssociationEnd(" + linksNavKey + ")"; - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = rest.getAcceptEncodingGzip(requestUrl, requestheaders); + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = rest.getAcceptEncodingGzip(requestUrl, requestheaders); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); @@ -167,7 +167,7 @@ private TResponse createLink(String entityTypeName, String linkEntityTypeName, S * AssociationEndを新規作成. */ private void createAssociationEnd(String name, String entityTypeName) { - AssociationEndUtils.create(DcCoreConfig.getMasterToken(), + AssociationEndUtils.create(PersoniumUnitConfig.getMasterToken(), EdmMultiplicity.MANY.getSymbolString(), Setup.TEST_CELL1, Setup.TEST_BOX1, diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AssociationEndReadTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AssociationEndReadTest.java similarity index 84% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AssociationEndReadTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AssociationEndReadTest.java index e990ea5e8..433a11b22 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AssociationEndReadTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AssociationEndReadTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.assocend; +package io.personium.test.jersey.box.odatacol.schema.assocend; import java.util.HashMap; import java.util.Map; @@ -27,22 +27,22 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmMultiplicity; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * AssociationEnd登録のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class AssociationEndReadTest extends ODataCommon { @@ -56,7 +56,7 @@ public class AssociationEndReadTest extends ODataCommon { * コンストラクタ. */ public AssociationEndReadTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -121,8 +121,8 @@ public AssociationEndReadTest() { // メッセージチェック ODataCommon.checkErrorResponseBody(resGet, - DcCoreException.OData.NO_SUCH_ENTITY.getCode(), - DcCoreException.OData.NO_SUCH_ENTITY.getMessage()); + PersoniumCoreException.OData.NO_SUCH_ENTITY.getCode(), + PersoniumCoreException.OData.NO_SUCH_ENTITY.getMessage()); } finally { if (res.getLocationHeader() != null) { @@ -145,7 +145,7 @@ private TResponse createAssociationEnd(String assocName, String multiplicity, St .with("collection", "setodata") .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("name", assocName) .with("multiplicity", multiplicity) .with("entityTypeName", entityTypeName) diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AssociationEndUpdateTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AssociationEndUpdateTest.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AssociationEndUpdateTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AssociationEndUpdateTest.java index 907e486af..c9311d58b 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/AssociationEndUpdateTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/AssociationEndUpdateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.assocend; +package io.personium.test.jersey.box.odatacol.schema.assocend; import org.apache.http.HttpStatus; import org.junit.Test; @@ -22,22 +22,22 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmMultiplicity; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.utils.AssociationEndUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.utils.AssociationEndUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.TResponse; /** * AssociationEnd更新のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class AssociationEndUpdateTest extends ODataCommon { @@ -45,7 +45,7 @@ public class AssociationEndUpdateTest extends ODataCommon { * コンストラクタ. */ public AssociationEndUpdateTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -117,8 +117,8 @@ public AssociationEndUpdateTest() { EdmMultiplicity.ONE.getSymbolString(), EdmMultiplicity.MANY.getSymbolString()); ODataCommon.checkErrorResponseBody( res, - DcCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), - DcCoreException.OData.OPERATION_NOT_SUPPORTED.params(message).getMessage()); + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.params(message).getMessage()); } finally { // AssociationEnd削除 AssociationEndUtils.delete(AbstractCase.MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_ODATA, @@ -160,8 +160,8 @@ public AssociationEndUpdateTest() { String message = "AssociationEnd '_EntityType.Name' change"; ODataCommon.checkErrorResponseBody( res, - DcCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), - DcCoreException.OData.OPERATION_NOT_SUPPORTED.params(message).getMessage()); + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.params(message).getMessage()); } finally { // AssociationEnd削除 AssociationEndUtils.delete(AbstractCase.MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_ODATA, @@ -203,8 +203,8 @@ public AssociationEndUpdateTest() { body, HttpStatus.SC_BAD_REQUEST); ODataCommon.checkErrorResponseBody( res, - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("Multiplicity").getMessage()); + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("Multiplicity").getMessage()); } finally { // AssociationEnd削除 AssociationEndUtils.delete(AbstractCase.MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_ODATA, @@ -244,8 +244,8 @@ public AssociationEndUpdateTest() { body, HttpStatus.SC_BAD_REQUEST); ODataCommon.checkErrorResponseBody( res, - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("Name").getMessage()); + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("Name").getMessage()); } finally { // AssociationEnd削除 AssociationEndUtils.delete(AbstractCase.MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_ODATA, @@ -285,8 +285,8 @@ public AssociationEndUpdateTest() { body, HttpStatus.SC_BAD_REQUEST); ODataCommon.checkErrorResponseBody( res, - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("Multiplicity").getMessage()); + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("Multiplicity").getMessage()); } finally { // AssociationEnd削除 AssociationEndUtils.delete(AbstractCase.MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_ODATA, @@ -327,8 +327,8 @@ public AssociationEndUpdateTest() { body, HttpStatus.SC_BAD_REQUEST); ODataCommon.checkErrorResponseBody( res, - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("_EntityType.Name").getMessage()); + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("_EntityType.Name").getMessage()); } finally { // AssociationEnd削除 AssociationEndUtils.delete(AbstractCase.MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_ODATA, @@ -443,8 +443,8 @@ public AssociationEndUpdateTest() { String message = "unknown property Type for AssociationEnd"; ODataCommon.checkErrorResponseBody( res, - DcCoreException.OData.FIELED_INVALID_ERROR.getCode(), - DcCoreException.OData.FIELED_INVALID_ERROR.params(message).getMessage()); + PersoniumCoreException.OData.FIELED_INVALID_ERROR.getCode(), + PersoniumCoreException.OData.FIELED_INVALID_ERROR.params(message).getMessage()); } finally { // AssociationEnd削除 AssociationEndUtils.delete(AbstractCase.MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_ODATA, @@ -486,8 +486,8 @@ public AssociationEndUpdateTest() { String message = "__published is management information name. Cannot request."; ODataCommon.checkErrorResponseBody( res, - DcCoreException.OData.FIELED_INVALID_ERROR.getCode(), - DcCoreException.OData.FIELED_INVALID_ERROR.params(message).getMessage()); + PersoniumCoreException.OData.FIELED_INVALID_ERROR.getCode(), + PersoniumCoreException.OData.FIELED_INVALID_ERROR.params(message).getMessage()); } finally { // AssociationEnd削除 AssociationEndUtils.delete(AbstractCase.MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_ODATA, @@ -526,8 +526,8 @@ public AssociationEndUpdateTest() { HttpStatus.SC_BAD_REQUEST); ODataCommon.checkErrorResponseBody( res, - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); } finally { // AssociationEnd削除 @@ -567,8 +567,8 @@ public AssociationEndUpdateTest() { HttpStatus.SC_BAD_REQUEST); ODataCommon.checkErrorResponseBody( res, - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); } finally { // AssociationEnd削除 @@ -609,8 +609,8 @@ public AssociationEndUpdateTest() { HttpStatus.SC_BAD_REQUEST); ODataCommon.checkErrorResponseBody( res, - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); } finally { // AssociationEnd削除 @@ -651,8 +651,8 @@ public AssociationEndUpdateTest() { HttpStatus.SC_BAD_REQUEST); ODataCommon.checkErrorResponseBody( res, - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); } finally { // AssociationEnd削除 @@ -767,8 +767,8 @@ public AssociationEndUpdateTest() { HttpStatus.SC_BAD_REQUEST); ODataCommon.checkErrorResponseBody( res, - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); } finally { // AssociationEnd削除 @@ -808,8 +808,8 @@ public AssociationEndUpdateTest() { HttpStatus.SC_BAD_REQUEST); ODataCommon.checkErrorResponseBody( res, - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); } finally { // AssociationEnd削除 @@ -959,8 +959,8 @@ public AssociationEndUpdateTest() { HttpStatus.SC_BAD_REQUEST); ODataCommon.checkErrorResponseBody( res, - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Multiplicity").getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Multiplicity").getMessage()); } finally { // AssociationEnd削除 @@ -1000,8 +1000,8 @@ public AssociationEndUpdateTest() { HttpStatus.SC_BAD_REQUEST); ODataCommon.checkErrorResponseBody( res, - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Multiplicity").getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Multiplicity").getMessage()); } finally { // AssociationEnd削除 @@ -1043,8 +1043,8 @@ public AssociationEndUpdateTest() { HttpStatus.SC_BAD_REQUEST); ODataCommon.checkErrorResponseBody( res, - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("_EntityType.Name").getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("_EntityType.Name").getMessage()); } finally { // AssociationEnd削除 @@ -1085,8 +1085,8 @@ public AssociationEndUpdateTest() { HttpStatus.SC_BAD_REQUEST); ODataCommon.checkErrorResponseBody( res, - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("_EntityType.Name").getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("_EntityType.Name").getMessage()); } finally { // AssociationEnd削除 @@ -1127,8 +1127,8 @@ public AssociationEndUpdateTest() { HttpStatus.SC_BAD_REQUEST); ODataCommon.checkErrorResponseBody( res, - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("_EntityType.Name").getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("_EntityType.Name").getMessage()); } finally { // AssociationEnd削除 @@ -1169,8 +1169,8 @@ public AssociationEndUpdateTest() { HttpStatus.SC_BAD_REQUEST); ODataCommon.checkErrorResponseBody( res, - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("_EntityType.Name").getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("_EntityType.Name").getMessage()); } finally { // AssociationEnd削除 @@ -1285,8 +1285,8 @@ public AssociationEndUpdateTest() { HttpStatus.SC_BAD_REQUEST); ODataCommon.checkErrorResponseBody( res, - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("_EntityType.Name").getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("_EntityType.Name").getMessage()); } finally { // AssociationEnd削除 @@ -1327,8 +1327,8 @@ public AssociationEndUpdateTest() { HttpStatus.SC_BAD_REQUEST); ODataCommon.checkErrorResponseBody( res, - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("_EntityType.Name").getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("_EntityType.Name").getMessage()); } finally { // AssociationEnd削除 @@ -1369,8 +1369,8 @@ public AssociationEndUpdateTest() { HttpStatus.SC_BAD_REQUEST); ODataCommon.checkErrorResponseBody( res, - DcCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.getCode(), - DcCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.params(entityTypeName2).getMessage()); + PersoniumCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.getCode(), + PersoniumCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.params(entityTypeName2).getMessage()); } finally { // AssociationEnd削除 diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/package-info.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/package-info.java similarity index 88% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/package-info.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/package-info.java index 3f4b22958..9ffab59ee 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/assocend/package-info.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/assocend/package-info.java @@ -17,5 +17,5 @@ /** * Cell CRUD test. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.assocend; +package io.personium.test.jersey.box.odatacol.schema.assocend; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextype/AllTests.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextype/AllTests.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextype/AllTests.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/complextype/AllTests.java index f7b14cd36..63521003e 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextype/AllTests.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextype/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.complextype; +package io.personium.test.jersey.box.odatacol.schema.complextype; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextype/ComplexTypeCreateTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextype/ComplexTypeCreateTest.java similarity index 74% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextype/ComplexTypeCreateTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/complextype/ComplexTypeCreateTest.java index 8f58a90f3..146215e85 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextype/ComplexTypeCreateTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextype/ComplexTypeCreateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.complextype; +package io.personium.test.jersey.box.odatacol.schema.complextype; import static org.junit.Assert.assertEquals; @@ -27,23 +27,23 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.model.ctl.ComplexType; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.Common; +import io.personium.core.model.ctl.ComplexType; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; /** * ComplexType登録のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class ComplexTypeCreateTest extends ODataCommon { @@ -64,7 +64,7 @@ public class ComplexTypeCreateTest extends ODataCommon { * コンストラクタ. */ public ComplexTypeCreateTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -76,12 +76,12 @@ public ComplexTypeCreateTest() { UrlUtils.complexType(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, COMPLEX_TYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(COMPLEX_TYPE_NAME_KEY, COMPLEX_TYPE_NAME); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -100,18 +100,18 @@ public ComplexTypeCreateTest() { @Test public final void ComplexTypeのName属性がない場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addStringBody("{}"); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params(COMPLEX_TYPE_NAME_KEY).getMessage()); + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params(COMPLEX_TYPE_NAME_KEY).getMessage()); } /** @@ -120,18 +120,18 @@ public ComplexTypeCreateTest() { @Test public final void ComplexTypeのNameが空文字の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(COMPLEX_TYPE_NAME_KEY, ""); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(COMPLEX_TYPE_NAME_KEY).getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(COMPLEX_TYPE_NAME_KEY).getMessage()); } /** @@ -144,12 +144,12 @@ public ComplexTypeCreateTest() { UrlUtils.complexType(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, complexTypeName); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(COMPLEX_TYPE_NAME_KEY, complexTypeName); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -172,12 +172,12 @@ public ComplexTypeCreateTest() { UrlUtils.complexType(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, complexTypeName); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(COMPLEX_TYPE_NAME_KEY, complexTypeName); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -196,18 +196,18 @@ public ComplexTypeCreateTest() { @Test public final void ComplexTypeのNameが129文字の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(COMPLEX_TYPE_NAME_KEY, STRING_LENGTH_129); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(COMPLEX_TYPE_NAME_KEY).getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(COMPLEX_TYPE_NAME_KEY).getMessage()); } /** @@ -220,12 +220,12 @@ public ComplexTypeCreateTest() { UrlUtils.complexType(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, complexTypeName); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(COMPLEX_TYPE_NAME_KEY, complexTypeName); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -244,18 +244,18 @@ public ComplexTypeCreateTest() { @Test public final void ComplexTypeのNameが半角英数字以外の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(COMPLEX_TYPE_NAME_KEY, "Ad.*s"); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(COMPLEX_TYPE_NAME_KEY).getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(COMPLEX_TYPE_NAME_KEY).getMessage()); } /** @@ -264,18 +264,18 @@ public ComplexTypeCreateTest() { @Test public final void ComplexTypeのNameが先頭文字がハイフンの場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(COMPLEX_TYPE_NAME_KEY, "-Address"); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(COMPLEX_TYPE_NAME_KEY).getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(COMPLEX_TYPE_NAME_KEY).getMessage()); } /** @@ -284,18 +284,18 @@ public ComplexTypeCreateTest() { @Test public final void ComplexTypeのNameが先頭文字がアンダーバーの場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(COMPLEX_TYPE_NAME_KEY, "_Address"); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(COMPLEX_TYPE_NAME_KEY).getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(COMPLEX_TYPE_NAME_KEY).getMessage()); } /** @@ -307,19 +307,19 @@ public ComplexTypeCreateTest() { UrlUtils.complexType(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, COMPLEX_TYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(COMPLEX_TYPE_NAME_KEY, COMPLEX_TYPE_NAME); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // リクエスト実行 response = request(req); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.ENTITY_ALREADY_EXISTS.getCode(), - DcCoreException.OData.ENTITY_ALREADY_EXISTS.getMessage()); + PersoniumCoreException.OData.ENTITY_ALREADY_EXISTS.getCode(), + PersoniumCoreException.OData.ENTITY_ALREADY_EXISTS.getMessage()); } finally { // 作成したComplexTypeを削除 assertEquals(HttpStatus.SC_NO_CONTENT, deleteOdataResource(locationUrl).getStatusCode()); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextype/ComplexTypeDeleteTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextype/ComplexTypeDeleteTest.java similarity index 78% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextype/ComplexTypeDeleteTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/complextype/ComplexTypeDeleteTest.java index 508c5cee5..c235d2fb0 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextype/ComplexTypeDeleteTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextype/ComplexTypeDeleteTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.complextype; +package io.personium.test.jersey.box.odatacol.schema.complextype; import static org.junit.Assert.assertEquals; @@ -24,24 +24,24 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.model.ctl.ComplexType; -import com.fujitsu.dc.core.model.ctl.ComplexTypeProperty; -import com.fujitsu.dc.core.model.ctl.EntityType; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.core.model.ctl.ComplexType; +import io.personium.core.model.ctl.ComplexTypeProperty; +import io.personium.core.model.ctl.EntityType; +import io.personium.core.model.ctl.Property; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; /** * ComplexType削除のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class ComplexTypeDeleteTest extends ODataCommon { @@ -49,7 +49,7 @@ public class ComplexTypeDeleteTest extends ODataCommon { * コンストラクタ. */ public ComplexTypeDeleteTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -60,7 +60,7 @@ public ComplexTypeDeleteTest() { // コンプレックスタイプ作成 String complexTypeName = "deleteTest"; String complexTypeEntitiesUrl = UrlUtils.complexType(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, null); - DcRequest req = DcRequest.post(complexTypeEntitiesUrl); + PersoniumRequest req = PersoniumRequest.post(complexTypeEntitiesUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexType.P_COMPLEXTYPE_NAME.getName(), complexTypeName); request(req); @@ -69,7 +69,7 @@ public ComplexTypeDeleteTest() { String entityTypeName = "deleteTestEntity"; String entityTypeEntitiesUrl = UrlUtils.entityType(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, null); - req = DcRequest.post(entityTypeEntitiesUrl); + req = PersoniumRequest.post(entityTypeEntitiesUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(EntityType.P_ENTITYTYPE_NAME.getName(), entityTypeName); request(req); @@ -78,7 +78,7 @@ public ComplexTypeDeleteTest() { String propertyName = "deleteTestProperty"; String propertyEntitiesUrl = UrlUtils.property(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, null, null); - req = DcRequest.post(propertyEntitiesUrl); + req = PersoniumRequest.post(propertyEntitiesUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(Property.P_NAME.getName(), propertyName); req.addJsonBody(Property.P_TYPE.getName(), complexTypeName); @@ -88,21 +88,21 @@ public ComplexTypeDeleteTest() { // ComplexTypeを使用しているPropertyが存在している場合に409が返却されること String complexTypeEntityUrl = UrlUtils.complexType(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, complexTypeName); - req = DcRequest.delete(complexTypeEntityUrl); + req = PersoniumRequest.delete(complexTypeEntityUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse response = request(req); + PersoniumResponse response = request(req); try { assertEquals(HttpStatus.SC_CONFLICT, response.getStatusCode()); } finally { // Property削除 String propertyEntityUrl = UrlUtils.property(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, propertyName, entityTypeName); - req = DcRequest.delete(propertyEntityUrl); + req = PersoniumRequest.delete(propertyEntityUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); response = request(req); // ComplexType削除 - req = DcRequest.delete(complexTypeEntityUrl); + req = PersoniumRequest.delete(complexTypeEntityUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); response = request(req); response.getStatusCode(); @@ -110,7 +110,7 @@ public ComplexTypeDeleteTest() { // EntityType削除 String entityTypeEntityUrl = UrlUtils.entityType(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, entityTypeName); - req = DcRequest.delete(entityTypeEntityUrl); + req = PersoniumRequest.delete(entityTypeEntityUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); request(req); } @@ -125,7 +125,7 @@ public ComplexTypeDeleteTest() { // コンプレックスタイプ作成(コンプレックスタイププロパティの型) String complexTypeName = "deleteTest"; String complexTypeEntitiesUrl = UrlUtils.complexType(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, null); - DcRequest req = DcRequest.post(complexTypeEntitiesUrl); + PersoniumRequest req = PersoniumRequest.post(complexTypeEntitiesUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexType.P_COMPLEXTYPE_NAME.getName(), complexTypeName); request(req); @@ -134,7 +134,7 @@ public ComplexTypeDeleteTest() { String linkedComplexTypeName = "linkedComplexTypeName"; String linkedComplexTypeEntitiesUrl = UrlUtils.complexType(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, null); - req = DcRequest.post(linkedComplexTypeEntitiesUrl); + req = PersoniumRequest.post(linkedComplexTypeEntitiesUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexType.P_COMPLEXTYPE_NAME.getName(), linkedComplexTypeName); request(req); @@ -143,7 +143,7 @@ public ComplexTypeDeleteTest() { String complexTypePropertyName = "deleteTestProperty"; String complexTypePropertyEntitiesUrl = UrlUtils.complexTypeProperty(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, null, null); - req = DcRequest.post(complexTypePropertyEntitiesUrl); + req = PersoniumRequest.post(complexTypePropertyEntitiesUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypeProperty.P_NAME.getName(), complexTypePropertyName); req.addJsonBody(ComplexTypeProperty.P_TYPE.getName(), complexTypeName); @@ -153,21 +153,21 @@ public ComplexTypeDeleteTest() { // ComplexTypeを使用しているComplexTypePropertyが存在している場合に409が返却されること String complexTypeEntityUrl = UrlUtils.complexType(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, complexTypeName); - req = DcRequest.delete(complexTypeEntityUrl); + req = PersoniumRequest.delete(complexTypeEntityUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse response = request(req); + PersoniumResponse response = request(req); try { assertEquals(HttpStatus.SC_CONFLICT, response.getStatusCode()); } finally { // ComplexTypeProperty削除 String complexTypePropertyEntityUrl = UrlUtils.complexTypeProperty(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, complexTypePropertyName, linkedComplexTypeName); - req = DcRequest.delete(complexTypePropertyEntityUrl); + req = PersoniumRequest.delete(complexTypePropertyEntityUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); response = request(req); // ComplexType削除(コンプレックスタイププロパティの型) - req = DcRequest.delete(complexTypeEntityUrl); + req = PersoniumRequest.delete(complexTypeEntityUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); response = request(req); response.getStatusCode(); @@ -175,7 +175,7 @@ public ComplexTypeDeleteTest() { // ComplexType削除(コンプレックスタイププロパティのリンク) String linkedComplexTypeEntityUrl = UrlUtils.complexType(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, linkedComplexTypeName); - req = DcRequest.delete(linkedComplexTypeEntityUrl); + req = PersoniumRequest.delete(linkedComplexTypeEntityUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); request(req); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextype/ComplexTypeGetTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextype/ComplexTypeGetTest.java similarity index 76% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextype/ComplexTypeGetTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/complextype/ComplexTypeGetTest.java index 25bd5452a..6a1d0cf79 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextype/ComplexTypeGetTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextype/ComplexTypeGetTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.complextype; +package io.personium.test.jersey.box.odatacol.schema.complextype; import static org.junit.Assert.assertEquals; @@ -29,22 +29,22 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.model.ctl.ComplexType; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.core.model.ctl.Common; +import io.personium.core.model.ctl.ComplexType; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; /** * ComplexType1件取得のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class ComplexTypeGetTest extends ODataCommon { @@ -65,7 +65,7 @@ public class ComplexTypeGetTest extends ODataCommon { * コンストラクタ. */ public ComplexTypeGetTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -77,20 +77,20 @@ public ComplexTypeGetTest() { COMPLEX_TYPE_NAME); try { // ComplexType作成 - DcRequest req = DcRequest.post(REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(COMPLEX_TYPE_NAME_KEY, COMPLEX_TYPE_NAME); - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // 作成時のetag String etag = getEtag(response); // ComplexType取得 - req = DcRequest.get(locationUrl); + req = PersoniumRequest.get(locationUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse resGet = request(req); + PersoniumResponse resGet = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_OK, resGet.getStatusCode()); @@ -114,16 +114,16 @@ public ComplexTypeGetTest() { String locationUrlGet = UrlUtils.complexType(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, "adress2"); try { // ComplexType作成 - DcRequest req = DcRequest.post(REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(COMPLEX_TYPE_NAME_KEY, COMPLEX_TYPE_NAME); - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // ComplexType取得 - req = DcRequest.get(locationUrlGet); + req = PersoniumRequest.get(locationUrlGet); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse resGet = request(req); + PersoniumResponse resGet = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_NOT_FOUND, resGet.getStatusCode()); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextype/ComplexTypeLinkTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextype/ComplexTypeLinkTest.java similarity index 74% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextype/ComplexTypeLinkTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/complextype/ComplexTypeLinkTest.java index 9d73f5e31..16f9aad68 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextype/ComplexTypeLinkTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextype/ComplexTypeLinkTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.complextype; +package io.personium.test.jersey.box.odatacol.schema.complextype; import static org.junit.Assert.assertEquals; @@ -26,24 +26,24 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.ComplexType; -import com.fujitsu.dc.core.model.ctl.ComplexTypeProperty; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.ComplexType; +import io.personium.core.model.ctl.ComplexTypeProperty; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.UserDataUtils; /** * ComplexTypeのLinksテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class ComplexTypeLinkTest extends ODataCommon { @@ -51,7 +51,7 @@ public class ComplexTypeLinkTest extends ODataCommon { * コンストラクタ. */ public ComplexTypeLinkTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -60,19 +60,19 @@ public ComplexTypeLinkTest() { @Test public final void ComplexTypeとComplexTypePropertyのLink作成は400が返却される事() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post( + PersoniumRequest req = PersoniumRequest.post( UrlUtils.schemaLinksWithSingleQuote(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, ComplexType.EDM_TYPE_NAME, "id", ComplexTypeProperty.EDM_TYPE_NAME, null)); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.NO_SUCH_ASSOCIATION.getCode(), - DcCoreException.OData.NO_SUCH_ASSOCIATION.getMessage()); + PersoniumCoreException.OData.NO_SUCH_ASSOCIATION.getCode(), + PersoniumCoreException.OData.NO_SUCH_ASSOCIATION.getMessage()); } /** @@ -81,19 +81,19 @@ public ComplexTypeLinkTest() { @Test public final void ComplexTypeとComplexTypePropertyのLink更新は501が返却される事() { // リクエストパラメータ設定 - DcRequest req = DcRequest.put( + PersoniumRequest req = PersoniumRequest.put( UrlUtils.schemaLinksWithSingleQuote(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, ComplexType.EDM_TYPE_NAME, "id", ComplexTypeProperty.EDM_TYPE_NAME, "id")); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_NOT_IMPLEMENTED, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.Misc.METHOD_NOT_IMPLEMENTED.getCode(), - DcCoreException.Misc.METHOD_NOT_IMPLEMENTED.getMessage()); + PersoniumCoreException.Misc.METHOD_NOT_IMPLEMENTED.getCode(), + PersoniumCoreException.Misc.METHOD_NOT_IMPLEMENTED.getMessage()); } /** @@ -102,19 +102,19 @@ public ComplexTypeLinkTest() { @Test public final void ComplexTypeとComplexTypePropertyのLink削除は400が返却される事() { // リクエストパラメータ設定 - DcRequest req = DcRequest.delete( + PersoniumRequest req = PersoniumRequest.delete( UrlUtils.schemaLinksWithSingleQuote(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, ComplexType.EDM_TYPE_NAME, "id", ComplexTypeProperty.EDM_TYPE_NAME, "id")); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.NO_SUCH_ASSOCIATION.getCode(), - DcCoreException.OData.NO_SUCH_ASSOCIATION.getMessage()); + PersoniumCoreException.OData.NO_SUCH_ASSOCIATION.getCode(), + PersoniumCoreException.OData.NO_SUCH_ASSOCIATION.getMessage()); } /** @@ -142,11 +142,11 @@ public ComplexTypeLinkTest() { .getFirstHeader(HttpHeaders.LOCATION); // ComplexType - ComplexTypeProperty $links一覧取得 - DcRequest req = DcRequest.get( + PersoniumRequest req = PersoniumRequest.get( UrlUtils.schemaLinksWithSingleQuote(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, ComplexType.EDM_TYPE_NAME, complexTypeName, ComplexTypeProperty.EDM_TYPE_NAME, null)); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_OK, response.getStatusCode()); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextype/ComplexTypeListTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextype/ComplexTypeListTest.java similarity index 80% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextype/ComplexTypeListTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/complextype/ComplexTypeListTest.java index b6d0522f3..27b9db82b 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextype/ComplexTypeListTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextype/ComplexTypeListTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.complextype; +package io.personium.test.jersey.box.odatacol.schema.complextype; import static org.junit.Assert.assertEquals; @@ -29,22 +29,22 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.model.ctl.ComplexType; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.core.model.ctl.Common; +import io.personium.core.model.ctl.ComplexType; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; /** * ComplexType一覧取得のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class ComplexTypeListTest extends ODataCommon { @@ -68,7 +68,7 @@ public class ComplexTypeListTest extends ODataCommon { * コンストラクタ. */ public ComplexTypeListTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -84,30 +84,30 @@ public ComplexTypeListTest() { try { // ComplexType1作成 - DcRequest req = DcRequest.post(REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(COMPLEX_TYPE_NAME_KEY, COMPLEX_TYPE_NAME); - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // ComplexType1作成時のetag String etag = getEtag(response); // ComplexType2作成 - DcRequest req2 = DcRequest.post(REQUEST_URL); + PersoniumRequest req2 = PersoniumRequest.post(REQUEST_URL); req2.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req2.addJsonBody(COMPLEX_TYPE_NAME_KEY, COMPLEX_TYPE_NAME2); - DcResponse response2 = request(req2); + PersoniumResponse response2 = request(req2); assertEquals(HttpStatus.SC_CREATED, response2.getStatusCode()); // ComplexType2作成時のetag String etag2 = getEtag(response2); // ComplexType一覧取得 - req = DcRequest.get(locationUrlGet); + req = PersoniumRequest.get(locationUrlGet); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse resGet = request(req); + PersoniumResponse resGet = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_OK, resGet.getStatusCode()); @@ -144,10 +144,10 @@ public ComplexTypeListTest() { String locationUrl = UrlUtils.complexType(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, null); // ComplexType一覧取得 - DcRequest req = DcRequest.get(locationUrl); + PersoniumRequest req = PersoniumRequest.get(locationUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse resGet = request(req); + PersoniumResponse resGet = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_OK, resGet.getStatusCode()); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextype/ComplexTypeUpdateTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextype/ComplexTypeUpdateTest.java similarity index 86% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextype/ComplexTypeUpdateTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/complextype/ComplexTypeUpdateTest.java index 53c9da59f..4f10ca604 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextype/ComplexTypeUpdateTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextype/ComplexTypeUpdateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.complextype; +package io.personium.test.jersey.box.odatacol.schema.complextype; import java.util.HashMap; import java.util.Map; @@ -27,24 +27,24 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.odatacol.schema.complextypeproperty.ComplexTypePropertyUtils; -import com.fujitsu.dc.test.jersey.box.odatacol.schema.property.PropertyUtils; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.Property; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.odatacol.schema.complextypeproperty.ComplexTypePropertyUtils; +import io.personium.test.jersey.box.odatacol.schema.property.PropertyUtils; +import io.personium.test.setup.Setup; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.TResponse; /** * ComplexType更新のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class ComplexTypeUpdateTest extends ODataCommon { @@ -52,7 +52,7 @@ public class ComplexTypeUpdateTest extends ODataCommon { * コンストラクタ. */ public ComplexTypeUpdateTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -127,8 +127,8 @@ public ComplexTypeUpdateTest() { // 変名 TResponse res = ComplexTypeUtils.update(MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, complexTypeName, complexTypeRename, HttpStatus.SC_CONFLICT); - res.checkErrorResponse(DcCoreException.OData.CONFLICT_HAS_RELATED.getCode(), - DcCoreException.OData.CONFLICT_HAS_RELATED.getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.CONFLICT_HAS_RELATED.getCode(), + PersoniumCoreException.OData.CONFLICT_HAS_RELATED.getMessage()); } finally { PropertyUtils.delete(BEARER_MASTER_TOKEN, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, Setup.TEST_ENTITYTYPE_M1, "testProperty", -1); @@ -163,8 +163,8 @@ public ComplexTypeUpdateTest() { // 変名 TResponse res = ComplexTypeUtils.update(token, cell, box, col, complex2nd, complex2nd, HttpStatus.SC_CONFLICT); - res.checkErrorResponse(DcCoreException.OData.CONFLICT_HAS_RELATED.getCode(), - DcCoreException.OData.CONFLICT_HAS_RELATED.getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.CONFLICT_HAS_RELATED.getCode(), + PersoniumCoreException.OData.CONFLICT_HAS_RELATED.getMessage()); } finally { ComplexTypePropertyUtils.delete(cell, box, col, "1stProp", complex1st, -1); PropertyUtils.delete(btoken, cell, box, col, "testEntity", "property", -1); @@ -202,8 +202,8 @@ public ComplexTypeUpdateTest() { // 変名 TResponse res = ComplexTypeUtils.update(token, cell, box, col, complex3rd, complex3rd, HttpStatus.SC_CONFLICT); - res.checkErrorResponse(DcCoreException.OData.CONFLICT_HAS_RELATED.getCode(), - DcCoreException.OData.CONFLICT_HAS_RELATED.getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.CONFLICT_HAS_RELATED.getCode(), + PersoniumCoreException.OData.CONFLICT_HAS_RELATED.getMessage()); } finally { ComplexTypePropertyUtils.delete(cell, box, col, "3rdProp", complex3rd, -1); ComplexTypePropertyUtils.delete(cell, box, col, "2ndProp", complex2nd, -1); @@ -261,8 +261,8 @@ public ComplexTypeUpdateTest() { // 変名 TResponse res = ComplexTypeUtils.update(MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, complexTypeName, complexTypeRename, HttpStatus.SC_CONFLICT); - res.checkErrorResponse(DcCoreException.OData.ENTITY_ALREADY_EXISTS.getCode(), - DcCoreException.OData.ENTITY_ALREADY_EXISTS.getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.ENTITY_ALREADY_EXISTS.getCode(), + PersoniumCoreException.OData.ENTITY_ALREADY_EXISTS.getMessage()); } finally { ComplexTypeUtils.delete(MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, complexTypeName, -1); @@ -285,8 +285,8 @@ public ComplexTypeUpdateTest() { // ComplexTypeの更新(400になること) TResponse res = ComplexTypeUtils.update(MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, complexTypeName, new JSONObject(), HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("Name").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("Name").getMessage()); } finally { ComplexTypeUtils.delete(MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, complexTypeName, -1); @@ -302,8 +302,8 @@ public ComplexTypeUpdateTest() { // ComplexTypeの更新 TResponse res = ComplexTypeUtils.update(MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, complexTypeName, complexTypeName, HttpStatus.SC_NOT_FOUND); - res.checkErrorResponse(DcCoreException.OData.NO_SUCH_ENTITY.getCode(), - DcCoreException.OData.NO_SUCH_ENTITY.getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.NO_SUCH_ENTITY.getCode(), + PersoniumCoreException.OData.NO_SUCH_ENTITY.getMessage()); } /** @@ -322,8 +322,8 @@ public ComplexTypeUpdateTest() { // ComplexTypeの更新 TResponse res = ComplexTypeUtils.update(MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, complexTypeName, complexTypeRename, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); } finally { ComplexTypeUtils.delete(MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, complexTypeName, -1); @@ -346,8 +346,8 @@ public ComplexTypeUpdateTest() { // ComplexTypeの更新 TResponse res = ComplexTypeUtils.update(MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, complexTypeName, complexTypeRename, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); } finally { ComplexTypeUtils.delete(MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, complexTypeName, -1); @@ -370,8 +370,8 @@ public ComplexTypeUpdateTest() { // ComplexTypeの更新 TResponse res = ComplexTypeUtils.update(MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, complexTypeName, complexTypeRename, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); } finally { ComplexTypeUtils.delete(MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, complexTypeName, -1); @@ -394,8 +394,8 @@ public ComplexTypeUpdateTest() { // ComplexTypeの更新 TResponse res = ComplexTypeUtils.update(MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, complexTypeName, complexTypeRename, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); } finally { ComplexTypeUtils.delete(MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, complexTypeName, -1); @@ -455,8 +455,8 @@ public ComplexTypeUpdateTest() { // ComplexTypeの更新 TResponse res = ComplexTypeUtils.update(MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, complexTypeName, complexTypeRename, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); } finally { ComplexTypeUtils.delete(MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, complexTypeName, -1); @@ -514,8 +514,8 @@ public ComplexTypeUpdateTest() { // ComplexTypeの更新 TResponse res = ComplexTypeUtils.update(MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, complexTypeName, complexTypeRename, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); } finally { ComplexTypeUtils.delete(MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, complexTypeName, -1); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextype/ComplexTypeUtils.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextype/ComplexTypeUtils.java similarity index 86% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextype/ComplexTypeUtils.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/complextype/ComplexTypeUtils.java index 1bcdcafb2..5b3a5746a 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextype/ComplexTypeUtils.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextype/ComplexTypeUtils.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.complextype; +package io.personium.test.jersey.box.odatacol.schema.complextype; import static org.junit.Assert.assertEquals; @@ -23,15 +23,15 @@ import org.apache.http.HttpHeaders; import org.json.simple.JSONObject; -import com.fujitsu.dc.core.auth.OAuth2Helper; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.model.ctl.ComplexType; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.auth.OAuth2Helper; +import io.personium.core.model.ctl.Common; +import io.personium.core.model.ctl.ComplexType; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * ComplexTypeテスト用のユーティリティクラス. @@ -53,16 +53,16 @@ private ComplexTypeUtils() { * @param code 期待するレスポンスコード * @return レスポンス */ - public static DcResponse create( + public static PersoniumResponse create( String cell, String box, String col, String complexTypeName, int code) { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(UrlUtils.complexType(cell, box, col, null)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.complexType(cell, box, col, null)); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.addJsonBody(ComplexType.P_COMPLEXTYPE_NAME.getName(), complexTypeName); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); if (code != -1) { assertEquals(code, response.getStatusCode()); } @@ -79,7 +79,7 @@ public static DcResponse create( * @param code 期待するレスポンスコード * @return レスポンス */ - public static DcResponse createWithToken( + public static PersoniumResponse createWithToken( String token, String cell, String box, @@ -87,12 +87,12 @@ public static DcResponse createWithToken( String complexTypeName, int code) { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(UrlUtils.complexType(cell, box, col, null)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.complexType(cell, box, col, null)); req.header(HttpHeaders.AUTHORIZATION, OAuth2Helper.Scheme.BEARER + " " + token); req.addJsonBody(ComplexType.P_COMPLEXTYPE_NAME.getName(), complexTypeName); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); if (code != -1) { assertEquals(code, response.getStatusCode()); } @@ -269,15 +269,15 @@ public static TResponse update( * @param code 期待するレスポンスコード * @return レスポンス */ - public static DcResponse delete( + public static PersoniumResponse delete( String token, String cell, String box, String col, String complexTypeName, int code) { // リクエストパラメータ設定 - DcRequest req = DcRequest.delete(UrlUtils.complexType( + PersoniumRequest req = PersoniumRequest.delete(UrlUtils.complexType( cell, box, col, complexTypeName)); req.header(HttpHeaders.AUTHORIZATION, OAuth2Helper.Scheme.BEARER + " " + token); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); if (code != -1) { assertEquals(code, response.getStatusCode()); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextype/package-info.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextype/package-info.java similarity index 87% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextype/package-info.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/complextype/package-info.java index a076be783..4bb43934f 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextype/package-info.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextype/package-info.java @@ -17,5 +17,5 @@ /** * ComplexType CRUD test. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.complextype; +package io.personium.test.jersey.box.odatacol.schema.complextype; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/AllTests.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/AllTests.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/AllTests.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/AllTests.java index 8ee7075f5..64f380e15 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/AllTests.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.complextypeproperty; +package io.personium.test.jersey.box.odatacol.schema.complextypeproperty; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyCreateTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyCreateTest.java similarity index 87% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyCreateTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyCreateTest.java index f3e03334e..1d0bb0b2f 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyCreateTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyCreateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.complextypeproperty; +package io.personium.test.jersey.box.odatacol.schema.complextypeproperty; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -33,26 +33,26 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.ComplexType; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DaoException; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.odatacol.UserDataComplexTypeUtils; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.ComplexType; +import io.personium.core.model.ctl.Property; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.DaoException; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.odatacol.UserDataComplexTypeUtils; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.UserDataUtils; /** * ComplexTypeProperty登録のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class ComplexTypePropertyCreateTest extends ODataCommon { @@ -73,7 +73,7 @@ public class ComplexTypePropertyCreateTest extends ODataCommon { * コンストラクタ. */ public ComplexTypePropertyCreateTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -83,7 +83,7 @@ public ComplexTypePropertyCreateTest() { public void before() { // ComplexType作成 // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CT_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CT_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(COMPLEX_TYPE_NAME_KEY, COMPLEX_TYPE_NAME); // リクエスト実行 @@ -111,7 +111,7 @@ public void after() { try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -119,7 +119,7 @@ public void after() { EdmSimpleType.STRING.getFullyQualifiedTypeName()); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -152,7 +152,7 @@ public void after() { @Test public final void ComplexTypePropertyのName属性がない場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_TYPE_KEY, @@ -162,13 +162,13 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING .params(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY) .getMessage()); } @@ -179,7 +179,7 @@ public void after() { @Test public final void ComplexTypePropertyのNameが空文字の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, ""); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -190,13 +190,13 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY) + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY) .getMessage()); } @@ -211,7 +211,7 @@ public void after() { COMPLEX_TYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, ctPropertyName); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -222,7 +222,7 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -252,7 +252,7 @@ public void after() { COMPLEX_TYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, ctPropertyName); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -263,7 +263,7 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -288,7 +288,7 @@ public void after() { @Test public final void ComplexTypePropertyのNameが129文字の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, STRING_LENGTH_129); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -299,13 +299,13 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY) + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY) .getMessage()); } @@ -320,7 +320,7 @@ public void after() { COMPLEX_TYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, ctPropertyName); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -331,7 +331,7 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -356,7 +356,7 @@ public void after() { @Test public final void ComplexTypePropertyのNameが半角英数字以外の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, "ctp.*name"); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -367,13 +367,13 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY) + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY) .getMessage()); } @@ -383,7 +383,7 @@ public void after() { @Test public final void ComplexTypePropertyのNameが先頭文字がハイフンの場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, "-ctp_name"); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -394,13 +394,13 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY) + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY) .getMessage()); } @@ -410,7 +410,7 @@ public void after() { @Test public final void ComplexTypePropertyのNameが先頭文字がアンダーバーの場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, "_ctp_name"); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -421,13 +421,13 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY) + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY) .getMessage()); } @@ -442,7 +442,7 @@ public void after() { COMPLEX_TYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -450,7 +450,7 @@ public void after() { EdmSimpleType.STRING.getFullyQualifiedTypeName()); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // リクエスト実行 @@ -458,8 +458,8 @@ public void after() { // レスポンスチェック checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.ENTITY_ALREADY_EXISTS.getCode(), - DcCoreException.OData.ENTITY_ALREADY_EXISTS.getMessage()); + PersoniumCoreException.OData.ENTITY_ALREADY_EXISTS.getCode(), + PersoniumCoreException.OData.ENTITY_ALREADY_EXISTS.getMessage()); } finally { // 作成したComplexTypePropertyを削除 @@ -473,7 +473,7 @@ public void after() { @Test public final void ComplexTypePropertyの_ComplexTypeName属性がない場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_TYPE_KEY, @@ -483,14 +483,14 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse( response.bodyAsJson(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params( + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params( ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY) .getMessage()); } @@ -501,7 +501,7 @@ public void after() { @Test public final void ComplexTypePropertyの_ComplexTypeNameが空文字の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, ""); @@ -512,14 +512,14 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse( response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY).getMessage()); } @@ -536,15 +536,15 @@ public void after() { try { // ComplexType作成 // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CT_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CT_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(COMPLEX_TYPE_NAME_KEY, complexTypeName); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // リクエストパラメータ設定 - req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, complexTypeName); @@ -587,15 +587,15 @@ public void after() { try { // ComplexType作成 // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CT_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CT_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(COMPLEX_TYPE_NAME_KEY, complexTypeName); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // リクエストパラメータ設定 - req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, complexTypeName); @@ -631,7 +631,7 @@ public void after() { @Test public final void ComplexTypePropertyの_ComplexTypeNameが129文字の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, STRING_LENGTH_129); @@ -642,14 +642,14 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse( response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY).getMessage()); } @@ -667,15 +667,15 @@ public void after() { try { // ComplexType作成 // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CT_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CT_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(COMPLEX_TYPE_NAME_KEY, complexTypeName); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // リクエストパラメータ設定 - req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, complexTypeName); @@ -711,7 +711,7 @@ public void after() { @Test public final void ComplexTypePropertyの_ComplexTypeNameが半角英数字以外の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, "Ad.*s"); @@ -722,14 +722,14 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse( response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY).getMessage()); } @@ -739,7 +739,7 @@ public void after() { @Test public final void ComplexTypePropertyの_ComplexTypeNameが先頭文字がハイフンの場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, "-address"); @@ -750,14 +750,14 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse( response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY).getMessage()); } @@ -767,7 +767,7 @@ public void after() { @Test public final void ComplexTypePropertyの_ComplexTypeNameが先頭文字がアンダーバーの場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, "_address"); @@ -778,14 +778,14 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse( response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY).getMessage()); } @@ -797,7 +797,7 @@ public void after() { String complexTypeName = "xxx"; // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, complexTypeName); @@ -808,13 +808,13 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.getCode(), - DcCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.params(complexTypeName).getMessage()); + PersoniumCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.getCode(), + PersoniumCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.params(complexTypeName).getMessage()); } /** @@ -828,7 +828,7 @@ public void after() { COMPLEX_TYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -839,7 +839,7 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -869,7 +869,7 @@ public void after() { COMPLEX_TYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -880,7 +880,7 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -910,7 +910,7 @@ public void after() { COMPLEX_TYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -921,7 +921,7 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -951,7 +951,7 @@ public void after() { COMPLEX_TYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -962,7 +962,7 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -988,7 +988,7 @@ public void after() { @Test public final void ComplexTypePropertyのTypeが不正な値の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -998,13 +998,13 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(ComplexTypePropertyUtils.CT_PROPERTY_TYPE_KEY) + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(ComplexTypePropertyUtils.CT_PROPERTY_TYPE_KEY) .getMessage()); } @@ -1022,15 +1022,15 @@ public void after() { COMPLEX_TYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CT_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CT_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("Name", complexTypeName); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // リクエストパラメータ設定 - req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -1071,7 +1071,7 @@ public void after() { COMPLEX_TYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -1082,7 +1082,7 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -1114,15 +1114,15 @@ public void after() { try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CT_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CT_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(COMPLEX_TYPE_NAME_KEY, complexTypeName); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // リクエストパラメータ設定 - req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, complexTypeName); @@ -1158,7 +1158,7 @@ public void after() { @Test public final void ComplexTypePropertyのNullableが不正な値の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -1169,14 +1169,14 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse( response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( ComplexTypePropertyUtils.CT_PROPERTY_NULLABLE_KEY) .getMessage()); } @@ -1192,7 +1192,7 @@ public void after() { COMPLEX_TYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -1203,7 +1203,7 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -1228,7 +1228,7 @@ public void after() { @Test public final void ComplexTypePropertyのTypeがEdmInt32でDefaultValueが最小値を下回る場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -1239,14 +1239,14 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse( response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( ComplexTypePropertyUtils.CT_PROPERTY_DEFAULT_VALUE_KEY).getMessage()); } @@ -1261,7 +1261,7 @@ public void after() { COMPLEX_TYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -1272,7 +1272,7 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -1302,7 +1302,7 @@ public void after() { COMPLEX_TYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -1313,7 +1313,7 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -1338,7 +1338,7 @@ public void after() { @Test public final void ComplexTypePropertyのTypeがEdmInt32でDefaultValueが最大値を上回る場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -1349,14 +1349,14 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse( response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( ComplexTypePropertyUtils.CT_PROPERTY_DEFAULT_VALUE_KEY).getMessage()); } @@ -1371,7 +1371,7 @@ public void after() { COMPLEX_TYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -1382,7 +1382,7 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -1407,7 +1407,7 @@ public void after() { @Test public final void ComplexTypePropertyのTypeがEdmSingleでDefaultValueが整数が6桁の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -1418,14 +1418,14 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse( response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( ComplexTypePropertyUtils.CT_PROPERTY_DEFAULT_VALUE_KEY).getMessage()); } @@ -1435,7 +1435,7 @@ public void after() { @Test public final void ComplexTypePropertyのTypeがEdmSingleでDefaultValueが小数が6桁の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -1446,14 +1446,14 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse( response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( ComplexTypePropertyUtils.CT_PROPERTY_DEFAULT_VALUE_KEY).getMessage()); } @@ -1468,7 +1468,7 @@ public void after() { COMPLEX_TYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -1479,7 +1479,7 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -1509,7 +1509,7 @@ public void after() { COMPLEX_TYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -1520,7 +1520,7 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -1545,7 +1545,7 @@ public void after() { @Test public final void ComplexTypePropertyのTypeがEdmBooleanでDefaultValueが不正な値の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -1556,14 +1556,14 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse( response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( ComplexTypePropertyUtils.CT_PROPERTY_DEFAULT_VALUE_KEY).getMessage()); } @@ -1577,7 +1577,7 @@ public void after() { try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -1588,7 +1588,7 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, Property.COLLECTION_KIND_NONE); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -1618,7 +1618,7 @@ public void after() { COMPLEX_TYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -1629,7 +1629,7 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, "List"); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -1654,7 +1654,7 @@ public void after() { @Test public final void ComplexTypePropertyのCollectionKindが不正な値の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -1665,14 +1665,14 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, "test"); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse( response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY).getMessage()); } @@ -1693,7 +1693,7 @@ public void after() { ODataCommon.deleteOdataResource(ctplocationUrl); // complexTypePropertyをBoolean型で再作成する - DcResponse response = UserDataUtils.createComplexTypeProperty(Setup.TEST_CELL1, Setup.TEST_BOX1, + PersoniumResponse response = UserDataUtils.createComplexTypeProperty(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.CT1ST_STRING_PROP, UserDataComplexTypeUtils.COMPLEX_TYPE_NAME, EdmSimpleType.BOOLEAN.getFullyQualifiedTypeName(), false, null, null); @@ -1730,7 +1730,7 @@ public void after() { Setup.TEST_ODATA, UserDataComplexTypeUtils.COMPLEX_TYPE_NAME); // Cellのみ異なる同じ名前のComplexTypePropertyを作成する - DcResponse response = UserDataUtils.createComplexTypeProperty(Setup.TEST_CELL2, Setup.TEST_BOX1, + PersoniumResponse response = UserDataUtils.createComplexTypeProperty(Setup.TEST_CELL2, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.CT1ST_STRING_PROP, UserDataComplexTypeUtils.COMPLEX_TYPE_NAME, EdmSimpleType.STRING.getFullyQualifiedTypeName(), false, null, null); @@ -1754,17 +1754,17 @@ public void after() { // 結びつけるComplexType作成 // リクエストパラメータ設定 - DcRequest req0 = DcRequest.post(ComplexTypePropertyUtils.CT_REQUEST_URL); + PersoniumRequest req0 = PersoniumRequest.post(ComplexTypePropertyUtils.CT_REQUEST_URL); req0.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req0.addJsonBody(COMPLEX_TYPE_NAME_KEY, "testComplexType"); // リクエスト実行 request(req0); try { - DcResponse response = null; + PersoniumResponse response = null; // リクエストパラメータ設定 for (int i = 0; i < repeatCount; i++) { - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME + i); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -1819,17 +1819,17 @@ public void after() { // 結びつけるComplexType作成 // リクエストパラメータ設定 - DcRequest req0 = DcRequest.post(ComplexTypePropertyUtils.CT_REQUEST_URL); + PersoniumRequest req0 = PersoniumRequest.post(ComplexTypePropertyUtils.CT_REQUEST_URL); req0.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req0.addJsonBody(COMPLEX_TYPE_NAME_KEY, "testComplexType"); // リクエスト実行 request(req0); try { - DcResponse response = null; + PersoniumResponse response = null; // リクエストパラメータ設定 for (int i = 0; i < repeatCount; i++) { - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME + i); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -1883,10 +1883,10 @@ public void after() { final int repeatCount = 50; try { - DcResponse response = null; + PersoniumResponse response = null; // リクエストパラメータ設定 for (int i = 0; i < repeatCount; i++) { - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME + i); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -1934,10 +1934,10 @@ public void after() { final int repeatCount = 51; try { - DcResponse response = null; + PersoniumResponse response = null; // リクエストパラメータ設定 for (int i = 0; i < repeatCount; i++) { - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME + i); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -1990,7 +1990,7 @@ public void after() { try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -2001,7 +2001,7 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック String resBody = response.bodyAsString(); @@ -2025,7 +2025,7 @@ public void after() { try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -2033,7 +2033,7 @@ public void after() { EdmSimpleType.DOUBLE.getFullyQualifiedTypeName()); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyCreateViaNPTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyCreateViaNPTest.java similarity index 86% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyCreateViaNPTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyCreateViaNPTest.java index 9b52ab1d6..2ad3677a3 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyCreateViaNPTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyCreateViaNPTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.complextypeproperty; +package io.personium.test.jersey.box.odatacol.schema.complextypeproperty; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -32,22 +32,22 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.model.ctl.ComplexType; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.model.ctl.ComplexType; +import io.personium.core.model.ctl.Property; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.TResponse; /** * ComplexTypePropertyNP経由登録のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class ComplexTypePropertyCreateViaNPTest extends ODataCommon { @@ -68,7 +68,7 @@ public class ComplexTypePropertyCreateViaNPTest extends ODataCommon { * コンストラクタ. */ public ComplexTypePropertyCreateViaNPTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -78,7 +78,7 @@ public ComplexTypePropertyCreateViaNPTest() { public void before() { // ComplexType作成 // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CT_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CT_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(COMPLEX_TYPE_NAME_KEY, COMPLEX_TYPE_NAME); // リクエスト実行 diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyDeleteTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyDeleteTest.java similarity index 84% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyDeleteTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyDeleteTest.java index 0d6da15dd..3d0f5a5a9 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyDeleteTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyDeleteTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.complextypeproperty; +package io.personium.test.jersey.box.odatacol.schema.complextypeproperty; import static org.junit.Assert.assertEquals; @@ -26,24 +26,24 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.model.ctl.ComplexType; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.odatacol.AbstractUserDataTest; -import com.fujitsu.dc.test.jersey.box.odatacol.UserDataComplexTypeUtils; -import com.fujitsu.dc.test.jersey.box.odatacol.schema.property.PropertyUtils; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.core.model.ctl.ComplexType; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.odatacol.AbstractUserDataTest; +import io.personium.test.jersey.box.odatacol.UserDataComplexTypeUtils; +import io.personium.test.jersey.box.odatacol.schema.property.PropertyUtils; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; /** * ComplexTypeProperty更新のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class ComplexTypePropertyDeleteTest extends AbstractUserDataTest { @@ -88,19 +88,19 @@ public ComplexTypePropertyDeleteTest() { String requestUrl = UrlUtils.userdata(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, UserDataComplexTypeUtils.ENTITY_TYPE_NAME, null); - DcRequest req = DcRequest.post(requestUrl); + PersoniumRequest req = PersoniumRequest.post(requestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("__id", "test000"); req.addJsonBody(UserDataComplexTypeUtils.ET_STRING_PROP, "UserDataComplexTypeUtils.ET_STRING_PROP_VALUE"); req.addJsonBody(UserDataComplexTypeUtils.ET_CT1ST_PROP, ct1stProp); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // ComplexTypeProperty削除 // リクエストパラメータ設定 - req = DcRequest.delete(UrlUtils.complexTypeProperty( + req = PersoniumRequest.delete(UrlUtils.complexTypeProperty( Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, "ct3rdStrProp", "complexType3rd")); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.header(HttpHeaders.IF_MATCH, "*"); @@ -126,12 +126,12 @@ public ComplexTypePropertyDeleteTest() { String propertyRequestUrl = null; String userDataId = "compro_test"; String entityTypeName = "Price"; - DcResponse response = null; + PersoniumResponse response = null; try { // ComplexType登録 // リクエストパラメータ設定 - DcRequest req = DcRequest.post(UrlUtils.complexType(Setup.TEST_CELL1, + PersoniumRequest req = PersoniumRequest.post(UrlUtils.complexType(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, null)); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(COMPLEX_TYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -141,7 +141,7 @@ public ComplexTypePropertyDeleteTest() { assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // ComplexTypeProperty登録 - req = DcRequest.post(UrlUtils.complexTypeProperty( + req = PersoniumRequest.post(UrlUtils.complexTypeProperty( Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, null, null)); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); @@ -155,7 +155,7 @@ public ComplexTypePropertyDeleteTest() { // Property登録(Type:adress) // リクエストパラメータ設定 - req = DcRequest.post(PropertyUtils.REQUEST_URL); + req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); @@ -175,7 +175,7 @@ public ComplexTypePropertyDeleteTest() { // ComplexTypeProperty削除 // リクエストパラメータ設定 - req = DcRequest.delete(UrlUtils.complexTypeProperty( + req = PersoniumRequest.delete(UrlUtils.complexTypeProperty( Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, CT_PROPERTY_NAME, COMPLEX_TYPE_NAME)); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.header(HttpHeaders.IF_MATCH, "*"); @@ -221,17 +221,17 @@ public ComplexTypePropertyDeleteTest() { try { // ComplexType登録 // リクエストパラメータ設定 - DcRequest req = DcRequest.post(UrlUtils.complexType(Setup.TEST_CELL1, + PersoniumRequest req = PersoniumRequest.post(UrlUtils.complexType(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, null)); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(COMPLEX_TYPE_NAME_KEY, COMPLEX_TYPE_NAME); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // ComplexTypeProperty登録 - req = DcRequest.post(UrlUtils.complexTypeProperty( + req = PersoniumRequest.post(UrlUtils.complexTypeProperty( Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, null, null)); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); @@ -245,7 +245,7 @@ public ComplexTypePropertyDeleteTest() { // ComplexTypeProperty削除 // リクエストパラメータ設定 - req = DcRequest.delete(UrlUtils.complexTypeProperty( + req = PersoniumRequest.delete(UrlUtils.complexTypeProperty( Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, CT_PROPERTY_NAME, COMPLEX_TYPE_NAME)); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.header(HttpHeaders.IF_MATCH, "*"); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyGetTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyGetTest.java similarity index 82% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyGetTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyGetTest.java index 266d91627..aeebebb4a 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyGetTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyGetTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.complextypeproperty; +package io.personium.test.jersey.box.odatacol.schema.complextypeproperty; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -34,23 +34,23 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.model.ctl.ComplexType; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DaoException; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.core.model.ctl.ComplexType; +import io.personium.core.model.ctl.Property; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.DaoException; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; /** * ComplexTypeProperty1件取得のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class ComplexTypePropertyGetTest extends ODataCommon { @@ -71,7 +71,7 @@ public class ComplexTypePropertyGetTest extends ODataCommon { * コンストラクタ. */ public ComplexTypePropertyGetTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -81,7 +81,7 @@ public ComplexTypePropertyGetTest() { public void before() { // ComplexType作成 // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CT_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CT_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(COMPLEX_TYPE_NAME_KEY, COMPLEX_TYPE_NAME); // リクエスト実行 @@ -107,7 +107,7 @@ public void after() { try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -115,17 +115,17 @@ public void after() { EdmSimpleType.STRING.getFullyQualifiedTypeName()); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // 作成時のetag String etag = getEtag(response); // ComplexTypeProperty取得 - req = DcRequest.get(ctplocationUrl); + req = PersoniumRequest.get(ctplocationUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse resGet = request(req); + PersoniumResponse resGet = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -154,9 +154,9 @@ public void after() { CT_PROPERTY_NAME, COMPLEX_TYPE_NAME); // ComplexTypeProperty取得 - DcRequest req = DcRequest.get(ctplocationUrl); + PersoniumRequest req = PersoniumRequest.get(ctplocationUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse resGet = request(req); + PersoniumResponse resGet = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_NOT_FOUND, resGet.getStatusCode()); @@ -173,7 +173,7 @@ public void after() { CT_PROPERTY_NAME, "test"); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -181,13 +181,13 @@ public void after() { EdmSimpleType.STRING.getFullyQualifiedTypeName()); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // ComplexTypeProperty取得 - req = DcRequest.get(ctplocationUrlGet); + req = PersoniumRequest.get(ctplocationUrlGet); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse resGet = request(req); + PersoniumResponse resGet = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_NOT_FOUND, resGet.getStatusCode()); @@ -208,7 +208,7 @@ public void after() { try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -219,14 +219,14 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // ComplexTypeProperty取得 - req = DcRequest.get(ctplocationUrl); + req = PersoniumRequest.get(ctplocationUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse resGet = request(req); + PersoniumResponse resGet = request(req); // レスポンスチェック String resBody = resGet.bodyAsString(); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyLinkTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyLinkTest.java similarity index 74% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyLinkTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyLinkTest.java index 8fd52453c..daf06bfcd 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyLinkTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyLinkTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.complextypeproperty; +package io.personium.test.jersey.box.odatacol.schema.complextypeproperty; import static org.junit.Assert.assertEquals; @@ -26,24 +26,24 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.ComplexType; -import com.fujitsu.dc.core.model.ctl.ComplexTypeProperty; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.ComplexType; +import io.personium.core.model.ctl.ComplexTypeProperty; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.UserDataUtils; /** * ComplexTypeのLinksテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class ComplexTypePropertyLinkTest extends ODataCommon { @@ -51,7 +51,7 @@ public class ComplexTypePropertyLinkTest extends ODataCommon { * コンストラクタ. */ public ComplexTypePropertyLinkTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -60,19 +60,19 @@ public ComplexTypePropertyLinkTest() { @Test public final void ComplexTypePropertyとComplexTypeのLink作成は400が返却される事() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post( + PersoniumRequest req = PersoniumRequest.post( UrlUtils.schemaLinksWithSingleQuote(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, ComplexTypeProperty.EDM_TYPE_NAME, "id", ComplexType.EDM_TYPE_NAME, null)); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.NO_SUCH_ASSOCIATION.getCode(), - DcCoreException.OData.NO_SUCH_ASSOCIATION.getMessage()); + PersoniumCoreException.OData.NO_SUCH_ASSOCIATION.getCode(), + PersoniumCoreException.OData.NO_SUCH_ASSOCIATION.getMessage()); } /** @@ -81,19 +81,19 @@ public ComplexTypePropertyLinkTest() { @Test public final void ComplexTypePropertyとComplexTypeのLink更新は501が返却される事() { // リクエストパラメータ設定 - DcRequest req = DcRequest.put( + PersoniumRequest req = PersoniumRequest.put( UrlUtils.schemaLinksWithSingleQuote(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, ComplexTypeProperty.EDM_TYPE_NAME, "id", ComplexType.EDM_TYPE_NAME, "id")); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_NOT_IMPLEMENTED, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.Misc.METHOD_NOT_IMPLEMENTED.getCode(), - DcCoreException.Misc.METHOD_NOT_IMPLEMENTED.getMessage()); + PersoniumCoreException.Misc.METHOD_NOT_IMPLEMENTED.getCode(), + PersoniumCoreException.Misc.METHOD_NOT_IMPLEMENTED.getMessage()); } /** @@ -102,19 +102,19 @@ public ComplexTypePropertyLinkTest() { @Test public final void ComplexTypePropertyとComplexTypeのLink削除は400が返却される事() { // リクエストパラメータ設定 - DcRequest req = DcRequest.delete( + PersoniumRequest req = PersoniumRequest.delete( UrlUtils.schemaLinksWithSingleQuote(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, ComplexTypeProperty.EDM_TYPE_NAME, "id", ComplexType.EDM_TYPE_NAME, "id")); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.NO_SUCH_ASSOCIATION.getCode(), - DcCoreException.OData.NO_SUCH_ASSOCIATION.getMessage()); + PersoniumCoreException.OData.NO_SUCH_ASSOCIATION.getCode(), + PersoniumCoreException.OData.NO_SUCH_ASSOCIATION.getMessage()); } /** @@ -142,11 +142,11 @@ public ComplexTypePropertyLinkTest() { // ComplexTypeProperty - ComplexType $links一覧取得 String key = String.format("Name='%s',_ComplexType.Name='%s'", complexTypePropertyName, complexTypeName); - DcRequest req = DcRequest.get( + PersoniumRequest req = PersoniumRequest.get( UrlUtils.schemaLinks(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, ComplexTypeProperty.EDM_TYPE_NAME, key, ComplexType.EDM_TYPE_NAME, null)); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_OK, response.getStatusCode()); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyListTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyListTest.java similarity index 85% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyListTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyListTest.java index 8d2608d26..12adb1519 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyListTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyListTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.complextypeproperty; +package io.personium.test.jersey.box.odatacol.schema.complextypeproperty; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -34,23 +34,23 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.model.ctl.ComplexType; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DaoException; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.core.model.ctl.ComplexType; +import io.personium.core.model.ctl.Property; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.DaoException; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; /** * ComplexTypeProperty一覧取得のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class ComplexTypePropertyListTest extends ODataCommon { @@ -74,7 +74,7 @@ public class ComplexTypePropertyListTest extends ODataCommon { * コンストラクタ. */ public ComplexTypePropertyListTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -84,7 +84,7 @@ public ComplexTypePropertyListTest() { public void before() { // ComplexType作成 // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CT_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CT_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(COMPLEX_TYPE_NAME_KEY, COMPLEX_TYPE_NAME); // リクエスト実行 @@ -114,7 +114,7 @@ public void after() { try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -122,14 +122,14 @@ public void after() { EdmSimpleType.STRING.getFullyQualifiedTypeName()); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // 作成時のetag String etag = getEtag(response); // リクエストパラメータ設定 - DcRequest req2 = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req2 = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req2.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req2.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME2); req2.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -137,17 +137,17 @@ public void after() { EdmSimpleType.INT32.getFullyQualifiedTypeName()); // リクエスト実行 - DcResponse response2 = request(req2); + PersoniumResponse response2 = request(req2); assertEquals(HttpStatus.SC_CREATED, response2.getStatusCode()); // 作成時のetag String etag2 = getEtag(response2); // ComplexTypeProperty取得 - req = DcRequest.get(ctplocationUrlGet); + req = PersoniumRequest.get(ctplocationUrlGet); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse resGet = request(req); + PersoniumResponse resGet = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_OK, resGet.getStatusCode()); @@ -203,10 +203,10 @@ public void after() { null); // ComplexTypeProperty取得 - DcRequest req = DcRequest.get(ctplocationUrl); + PersoniumRequest req = PersoniumRequest.get(ctplocationUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse resGet = request(req); + PersoniumResponse resGet = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_OK, resGet.getStatusCode()); @@ -226,7 +226,7 @@ public void after() { try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -237,14 +237,14 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COLLECTION_KIND_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // ComplexTypeProperty取得 - req = DcRequest.get(ctplocationUrlGet); + req = PersoniumRequest.get(ctplocationUrlGet); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse resGet = request(req); + PersoniumResponse resGet = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_OK, resGet.getStatusCode()); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyListViaNPTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyListViaNPTest.java similarity index 82% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyListViaNPTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyListViaNPTest.java index 93dfb46b0..2c4cf5592 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyListViaNPTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyListViaNPTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.complextypeproperty; +package io.personium.test.jersey.box.odatacol.schema.complextypeproperty; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -29,22 +29,22 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.model.ctl.ComplexType; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.model.ctl.ComplexType; +import io.personium.core.model.ctl.Property; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.TResponse; /** * ComplexTypePropertyNP経由一覧取得のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class ComplexTypePropertyListViaNPTest extends ODataCommon { @@ -65,7 +65,7 @@ public class ComplexTypePropertyListViaNPTest extends ODataCommon { * コンストラクタ. */ public ComplexTypePropertyListViaNPTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -75,7 +75,7 @@ public ComplexTypePropertyListViaNPTest() { public void before() { // ComplexType作成 // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CT_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CT_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(COMPLEX_TYPE_NAME_KEY, COMPLEX_TYPE_NAME); // リクエスト実行 diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyUpdateTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyUpdateTest.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyUpdateTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyUpdateTest.java index bb003234d..48ac84bdb 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyUpdateTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyUpdateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.complextypeproperty; +package io.personium.test.jersey.box.odatacol.schema.complextypeproperty; import static org.junit.Assert.assertEquals; @@ -30,41 +30,41 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.core.model.impl.es.odata.UserDataODataProducer; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.odatacol.schema.complextype.ComplexTypeUtils; -import com.fujitsu.dc.test.jersey.box.odatacol.schema.property.PropertyUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.Property; +import io.personium.core.model.impl.es.odata.UserDataODataProducer; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.odatacol.schema.complextype.ComplexTypeUtils; +import io.personium.test.jersey.box.odatacol.schema.property.PropertyUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; import com.sun.jersey.test.framework.WebAppDescriptor; /** * ComplexTypeProperty更新のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class ComplexTypePropertyUpdateTest extends ODataCommon { private static final Map INIT_PARAMS = new HashMap(); static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } /** @@ -117,7 +117,7 @@ public ComplexTypePropertyUpdateTest() { entityTypeName); // ComplexTypeProperty更新 - DcResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, + PersoniumResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, complexTypePropertyName, complexTypeName, complexTypePropertyName, complexTypeName, EdmSimpleType.DOUBLE.getFullyQualifiedTypeName(), nullable, defaultValue, collectionKind); @@ -236,7 +236,7 @@ public ComplexTypePropertyUpdateTest() { entityTypeName); // ComplexTypeProperty更新 - DcResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, + PersoniumResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, prop3ComplexTypeProperty2, complexTypeName2, prop3ComplexTypeProperty2, complexTypeName2, EdmSimpleType.DOUBLE.getFullyQualifiedTypeName(), nullable, defaultValue, collectionKind); @@ -354,7 +354,7 @@ public ComplexTypePropertyUpdateTest() { entityTypeName); // ComplexTypeProperty更新 - DcResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, + PersoniumResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, complexTypeProperty32, complexTypeName3, complexTypeProperty32, complexTypeName3, EdmSimpleType.DOUBLE.getFullyQualifiedTypeName(), nullable, defaultValue, collectionKind); @@ -434,15 +434,15 @@ public ComplexTypePropertyUpdateTest() { complexTypeName, true, null, Property.COLLECTION_KIND_NONE, false, null, HttpStatus.SC_CREATED); // ComplexTypeProperty更新 - DcResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, + PersoniumResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, complexTypePropertyName, complexTypeName, complexTypePropertyName, complexTypeName, EdmSimpleType.DOUBLE.getFullyQualifiedTypeName(), nullable, defaultValue, collectionKind); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); ODataCommon - .checkErrorResponseBody(response, DcCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), - DcCoreException.OData.OPERATION_NOT_SUPPORTED + .checkErrorResponseBody(response, PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED .params("ComplexTypeProperty 'Type' change from [Edm.String] to [Edm.Double]") .getMessage()); @@ -502,15 +502,15 @@ public ComplexTypePropertyUpdateTest() { complexTypeName, true, null, Property.COLLECTION_KIND_NONE, false, null, HttpStatus.SC_CREATED); // ComplexTypeProperty更新 - DcResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, + PersoniumResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, complexTypePropertyName, complexTypeName, complexTypePropertyName, complexTypeName, EdmSimpleType.SINGLE.getFullyQualifiedTypeName(), nullable, defaultValue, collectionKind); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); ODataCommon - .checkErrorResponseBody(response, DcCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), - DcCoreException.OData.OPERATION_NOT_SUPPORTED + .checkErrorResponseBody(response, PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED .params("ComplexTypeProperty 'Type' change from [Edm.Int32] to [Edm.Single]") .getMessage()); @@ -577,12 +577,12 @@ public ComplexTypePropertyUpdateTest() { body.put("Nullable", nullable); body.put("DefaultValue", defaultValue); body.put("CollectionKind", collectionKind); - DcResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, + PersoniumResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, complexTypePropertyName, complexTypeName, body); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - ODataCommon.checkErrorResponseBody(response, DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("Type").getMessage()); + ODataCommon.checkErrorResponseBody(response, PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("Type").getMessage()); // ComplexTypePropertyが更新されていないことの確認 response = ComplexTypePropertyUtils.get(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, @@ -647,12 +647,12 @@ public ComplexTypePropertyUpdateTest() { body.put("Nullable", nullable); body.put("DefaultValue", defaultValue); body.put("CollectionKind", collectionKind); - DcResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, + PersoniumResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, complexTypePropertyName, complexTypeName, body); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - ODataCommon.checkErrorResponseBody(response, DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("Name").getMessage()); + ODataCommon.checkErrorResponseBody(response, PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("Name").getMessage()); // ComplexTypePropertyが更新されていないことの確認 response = ComplexTypePropertyUtils.get(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, @@ -705,7 +705,7 @@ public ComplexTypePropertyUpdateTest() { complexTypeName, EdmSimpleType.INT32.getFullyQualifiedTypeName(), HttpStatus.SC_CREATED); // ComplexTypeProperty更新 - DcResponse res = ComplexTypePropertyUtils.update(cellName, boxName, colName, + PersoniumResponse res = ComplexTypePropertyUtils.update(cellName, boxName, colName, complexTypePropertyName, complexTypeName, complexTypePropertyReName, complexTypeName, EdmSimpleType.DOUBLE.getFullyQualifiedTypeName(), nullable, defaultValue, collectionKind); @@ -809,7 +809,7 @@ public ComplexTypePropertyUpdateTest() { entityTypeName); // ComplexTypeProperty更新 - DcResponse res = ComplexTypePropertyUtils.update(cellName, boxName, colName, + PersoniumResponse res = ComplexTypePropertyUtils.update(cellName, boxName, colName, complexTypeProperty3, complexTypeName3, complexTypePropertyReName, complexTypeName3, EdmSimpleType.BOOLEAN.getFullyQualifiedTypeName(), nullable, defaultValue, collectionKind); @@ -886,7 +886,7 @@ public ComplexTypePropertyUpdateTest() { complexTypeName, EdmSimpleType.INT32.getFullyQualifiedTypeName(), HttpStatus.SC_CREATED); // ComplexTypeProperty更新 - DcResponse res = ComplexTypePropertyUtils.update(cellName, boxName, colName, + PersoniumResponse res = ComplexTypePropertyUtils.update(cellName, boxName, colName, complexTypePropertyName, complexTypeName, complexTypePropertyReName, complexTypeName, EdmSimpleType.DOUBLE.getFullyQualifiedTypeName(), nullable, defaultValue, collectionKind); @@ -959,7 +959,7 @@ public ComplexTypePropertyUpdateTest() { complexTypeName, EdmSimpleType.INT32.getFullyQualifiedTypeName(), HttpStatus.SC_CREATED); // ComplexTypeProperty更新 - DcResponse res = ComplexTypePropertyUtils.update(cellName, boxName, colName, + PersoniumResponse res = ComplexTypePropertyUtils.update(cellName, boxName, colName, complexTypePropertyName, complexTypeName, complexTypePropertyReName, complexTypeName, EdmSimpleType.DOUBLE.getFullyQualifiedTypeName(), nullable, defaultValue, collectionKind); @@ -1010,7 +1010,7 @@ public ComplexTypePropertyUpdateTest() { ComplexTypeUtils.create(cellName, boxName, colName, complexTypeName, HttpStatus.SC_CREATED); // ComplexTypeProperty更新 - DcResponse res = ComplexTypePropertyUtils.update(cellName, boxName, colName, + PersoniumResponse res = ComplexTypePropertyUtils.update(cellName, boxName, colName, complexTypePropertyName, complexTypeName, complexTypePropertyReName, complexTypeName, EdmSimpleType.DOUBLE.getFullyQualifiedTypeName(), nullable, defaultValue, collectionKind); @@ -1061,12 +1061,12 @@ public ComplexTypePropertyUpdateTest() { body.put("Nullable", nullable); body.put("DefaultValue", defaultValue); body.put("CollectionKind", collectionKind); - DcResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, + PersoniumResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, complexTypePropertyName, complexTypeName, body); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - ODataCommon.checkErrorResponseBody(response, DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("_ComplexType.Name").getMessage()); + ODataCommon.checkErrorResponseBody(response, PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("_ComplexType.Name").getMessage()); // ComplexTypePropertyが更新されていないことの確認 response = ComplexTypePropertyUtils.get(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, @@ -1126,7 +1126,7 @@ public ComplexTypePropertyUpdateTest() { ComplexTypeUtils.create(cellName, boxName, colName, "updated", HttpStatus.SC_CREATED); // ComplexTypeProperty更新 - DcResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, + PersoniumResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, complexTypePropertyName, complexTypeName, complexTypePropertyName, "updated", EdmSimpleType.DOUBLE.getFullyQualifiedTypeName(), nullable, defaultValue, collectionKind); @@ -1134,8 +1134,8 @@ public ComplexTypePropertyUpdateTest() { assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); ODataCommon.checkErrorResponseBody( response, - DcCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), - DcCoreException.OData.OPERATION_NOT_SUPPORTED + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED .params("ComplexTypeProperty '_ComplexType.Name' change") .getMessage()); @@ -1195,7 +1195,7 @@ public ComplexTypePropertyUpdateTest() { complexTypeName, true, null, Property.COLLECTION_KIND_NONE, false, null, HttpStatus.SC_CREATED); // ComplexTypeProperty更新 - DcResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, + PersoniumResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, complexTypePropertyName, complexTypeName, complexTypePropertyName, complexTypeName, EdmSimpleType.DOUBLE.getFullyQualifiedTypeName(), false, defaultValue, collectionKind); @@ -1203,8 +1203,8 @@ public ComplexTypePropertyUpdateTest() { assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); ODataCommon.checkErrorResponseBody( response, - DcCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), - DcCoreException.OData.OPERATION_NOT_SUPPORTED + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED .params("ComplexTypeProperty 'Nullable' change from [true] to [false]") .getMessage()); @@ -1271,7 +1271,7 @@ public ComplexTypePropertyUpdateTest() { body.put("Type", EdmSimpleType.DOUBLE.getFullyQualifiedTypeName()); body.put("DefaultValue", defaultValue); body.put("CollectionKind", collectionKind); - DcResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, + PersoniumResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, complexTypePropertyName, complexTypeName, body); assertEquals(HttpStatus.SC_NO_CONTENT, response.getStatusCode()); @@ -1339,14 +1339,14 @@ public ComplexTypePropertyUpdateTest() { body.put("Type", EdmSimpleType.DOUBLE.getFullyQualifiedTypeName()); body.put("DefaultValue", defaultValue); body.put("CollectionKind", collectionKind); - DcResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, + PersoniumResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, complexTypePropertyName, complexTypeName, body); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); ODataCommon.checkErrorResponseBody( response, - DcCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), - DcCoreException.OData.OPERATION_NOT_SUPPORTED + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED .params("ComplexTypeProperty 'Nullable' change from [false] to [true]") .getMessage()); @@ -1405,7 +1405,7 @@ public ComplexTypePropertyUpdateTest() { complexTypeName, true, null, Property.COLLECTION_KIND_NONE, false, null, HttpStatus.SC_CREATED); // ComplexTypeProperty更新 - DcResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, + PersoniumResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, complexTypePropertyName, complexTypeName, complexTypePropertyName, complexTypeName, EdmSimpleType.DOUBLE.getFullyQualifiedTypeName(), nullable, 12345, collectionKind); @@ -1413,8 +1413,8 @@ public ComplexTypePropertyUpdateTest() { assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); ODataCommon.checkErrorResponseBody( response, - DcCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), - DcCoreException.OData.OPERATION_NOT_SUPPORTED + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED .params("ComplexTypeProperty 'DefaultValue' change from [null] to [12345]") .getMessage()); @@ -1481,7 +1481,7 @@ public ComplexTypePropertyUpdateTest() { body.put("Type", EdmSimpleType.DOUBLE.getFullyQualifiedTypeName()); body.put("Nullable", nullable); body.put("CollectionKind", collectionKind); - DcResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, + PersoniumResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, complexTypePropertyName, complexTypeName, body); assertEquals(HttpStatus.SC_NO_CONTENT, response.getStatusCode()); @@ -1549,14 +1549,14 @@ public ComplexTypePropertyUpdateTest() { body.put("Type", EdmSimpleType.DOUBLE.getFullyQualifiedTypeName()); body.put("Nullable", nullable); body.put("CollectionKind", collectionKind); - DcResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, + PersoniumResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, complexTypePropertyName, complexTypeName, body); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); ODataCommon.checkErrorResponseBody( response, - DcCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), - DcCoreException.OData.OPERATION_NOT_SUPPORTED + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED .params("ComplexTypeProperty 'DefaultValue' change from [12345] to [null]") .getMessage()); @@ -1615,7 +1615,7 @@ public ComplexTypePropertyUpdateTest() { complexTypeName, true, null, Property.COLLECTION_KIND_NONE, false, null, HttpStatus.SC_CREATED); // ComplexTypeProperty更新 - DcResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, + PersoniumResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, complexTypePropertyName, complexTypeName, complexTypePropertyName, complexTypeName, EdmSimpleType.DOUBLE.getFullyQualifiedTypeName(), nullable, defaultValue, "List"); @@ -1623,8 +1623,8 @@ public ComplexTypePropertyUpdateTest() { assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); ODataCommon.checkErrorResponseBody( response, - DcCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), - DcCoreException.OData.OPERATION_NOT_SUPPORTED + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED .params("ComplexTypeProperty 'CollectionKind' change from [None] to [List]") .getMessage()); @@ -1691,7 +1691,7 @@ public ComplexTypePropertyUpdateTest() { body.put("Type", EdmSimpleType.DOUBLE.getFullyQualifiedTypeName()); body.put("DefaultValue", defaultValue); body.put("Nullable", nullable); - DcResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, + PersoniumResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, complexTypePropertyName, complexTypeName, body); assertEquals(HttpStatus.SC_NO_CONTENT, response.getStatusCode()); @@ -1759,14 +1759,14 @@ public ComplexTypePropertyUpdateTest() { body.put("Type", EdmSimpleType.DOUBLE.getFullyQualifiedTypeName()); body.put("DefaultValue", defaultValue); body.put("Nullable", nullable); - DcResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, + PersoniumResponse response = ComplexTypePropertyUtils.update(cellName, boxName, colName, complexTypePropertyName, complexTypeName, body); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); ODataCommon.checkErrorResponseBody( response, - DcCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), - DcCoreException.OData.OPERATION_NOT_SUPPORTED + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED .params("ComplexTypeProperty 'CollectionKind' change from [List] to [None]") .getMessage()); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyUtils.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyUtils.java similarity index 88% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyUtils.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyUtils.java index 2a4ac007a..b5e331658 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyUtils.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyUtils.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.complextypeproperty; +package io.personium.test.jersey.box.odatacol.schema.complextypeproperty; import static org.junit.Assert.assertEquals; @@ -23,17 +23,17 @@ import org.apache.http.HttpHeaders; import org.json.simple.JSONObject; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.auth.OAuth2Helper; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.model.ctl.ComplexTypeProperty; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.auth.OAuth2Helper; +import io.personium.core.model.ctl.Common; +import io.personium.core.model.ctl.ComplexTypeProperty; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * ComplexTypePropertyUtils. @@ -102,7 +102,7 @@ public static String composeLocationUrl(String cell, String box, String collecti * @param code 期待するコード * @return レスポンス */ - public static DcResponse create( + public static PersoniumResponse create( String cell, String box, String col, String complexTypePropertyName, String complexTypeName, String type, int code) { return createWithToken(AbstractCase.MASTER_TOKEN_NAME, cell, box, col, complexTypePropertyName, @@ -121,18 +121,18 @@ public static DcResponse create( * @param code 期待するコード * @return レスポンス */ - public static DcResponse createWithToken( + public static PersoniumResponse createWithToken( String token, String cell, String box, String col, String complexTypePropertyName, String complexTypeName, String type, int code) { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(UrlUtils.complexTypeProperty(cell, box, col, null, null)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.complexTypeProperty(cell, box, col, null, null)); req.header(HttpHeaders.AUTHORIZATION, OAuth2Helper.Scheme.BEARER + " " + token); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, complexTypePropertyName); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, complexTypeName); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_TYPE_KEY, type); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); if (code != -1) { assertEquals(code, response.getStatusCode()); } @@ -155,7 +155,7 @@ public static DcResponse createWithToken( * @return レスポンス */ @SuppressWarnings("unchecked") - public static DcResponse create( + public static PersoniumResponse create( String cell, String box, String collection, String srcComplexTypePropertyName, String srcComplexTypeName, String complexTypePropertyName, String complexTypeName, @@ -171,7 +171,7 @@ public static DcResponse create( body.put("CollectionKind", collectionKind); // リクエストパラメータ設定 - DcRequest req = DcRequest.post(UrlUtils.complexTypeProperty(cell, box, collection, null, null)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.complexTypeProperty(cell, box, collection, null, null)); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.addStringBody(body.toJSONString()); @@ -189,7 +189,7 @@ public static DcResponse create( * @param code 期待するレスポンスコード * @return レスポンス */ - public static DcResponse delete( + public static PersoniumResponse delete( String cell, String box, String collection, @@ -212,7 +212,7 @@ public static DcResponse delete( * @param code 期待するレスポンスコード * @return レスポンス */ - public static DcResponse deleteWithToken( + public static PersoniumResponse deleteWithToken( String token, String cell, String box, @@ -222,13 +222,13 @@ public static DcResponse deleteWithToken( int code ) { // リクエストパラメータ設定 - DcRequest req = DcRequest.delete(UrlUtils.complexTypeProperty( + PersoniumRequest req = PersoniumRequest.delete(UrlUtils.complexTypeProperty( cell, box, collection, complexTypePropretyName, complexTypeName)); req.header(HttpHeaders.AUTHORIZATION, OAuth2Helper.Scheme.BEARER + " " + token); req.header(HttpHeaders.IF_MATCH, "*"); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); if (code != -1) { assertEquals(code, response.getStatusCode()); } @@ -245,13 +245,13 @@ public static DcResponse deleteWithToken( * @param complexTypeName ComplexType名 * @return レスポンス */ - public static DcResponse get(String token, String cell, String box, + public static PersoniumResponse get(String token, String cell, String box, String collection, String complexTypePropertyName, String complexTypeName) { String locationUrl = UrlUtils.complexTypeProperty(cell, box, collection, complexTypePropertyName, complexTypeName); // Property取得 - DcRequest req = DcRequest.get(locationUrl); + PersoniumRequest req = PersoniumRequest.get(locationUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, OAuth2Helper.Scheme.BEARER + " " + token); return AbstractCase.request(req); @@ -267,13 +267,13 @@ public static DcResponse get(String token, String cell, String box, * @param complexTypeName ComplexType名 * @return レスポンス */ - public static DcResponse getWithToken(String token, String cell, String box, String collection, + public static PersoniumResponse getWithToken(String token, String cell, String box, String collection, String complexTypePropertyName, String complexTypeName) { String locationUrl = UrlUtils.complexTypeProperty(cell, box, collection, complexTypePropertyName, complexTypeName); // Property取得 - DcRequest req = DcRequest.get(locationUrl); + PersoniumRequest req = PersoniumRequest.get(locationUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, OAuth2Helper.Scheme.BEARER + " " + token); return AbstractCase.request(req); @@ -353,7 +353,7 @@ public static TResponse list( * @return レスポンス */ @SuppressWarnings("unchecked") - public static DcResponse update( + public static PersoniumResponse update( String cell, String box, String collection, String srcComplexTypePropertyName, String srcComplexTypeName, String complexTypePropertyName, String complexTypeName, @@ -382,7 +382,7 @@ public static DcResponse update( * @param body リクエストボディ * @return レスポンス */ - public static DcResponse update( + public static PersoniumResponse update( String cell, String box, String collection, String srcComplexTypePropertyName, String srcComplexTypeName, JSONObject body) { @@ -401,13 +401,13 @@ public static DcResponse update( * @param body リクエストボディ * @return レスポンス */ - public static DcResponse updateWithToken( + public static PersoniumResponse updateWithToken( String token, String cell, String box, String collection, String srcComplexTypePropertyName, String srcComplexTypeName, JSONObject body) { // リクエストパラメータ設定 - DcRequest req = DcRequest.put(UrlUtils.complexTypeProperty(cell, box, collection, + PersoniumRequest req = PersoniumRequest.put(UrlUtils.complexTypeProperty(cell, box, collection, srcComplexTypePropertyName, srcComplexTypeName)); req.header(HttpHeaders.AUTHORIZATION, OAuth2Helper.Scheme.BEARER + " " + token); req.header(HttpHeaders.IF_MATCH, "*"); @@ -454,7 +454,7 @@ public static TResponse createViaComplexTypePropertyNP( .with("collection", collection) .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("entityType", "ComplexType") .with("id", complexTypeName) .with("navPropName", "_ComplexTypeProperty") diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyValidateDefaultValueTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyValidateDefaultValueTest.java similarity index 76% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyValidateDefaultValueTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyValidateDefaultValueTest.java index 8f785fc69..f6aa88164 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyValidateDefaultValueTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/ComplexTypePropertyValidateDefaultValueTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.complextypeproperty; +package io.personium.test.jersey.box.odatacol.schema.complextypeproperty; import static org.junit.Assert.assertEquals; @@ -27,22 +27,22 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.ComplexType; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.ComplexType; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; /** * ComplexTypeProperty登録のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class ComplexTypePropertyValidateDefaultValueTest extends ODataCommon { @@ -63,7 +63,7 @@ public class ComplexTypePropertyValidateDefaultValueTest extends ODataCommon { * コンストラクタ. */ public ComplexTypePropertyValidateDefaultValueTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -73,7 +73,7 @@ public ComplexTypePropertyValidateDefaultValueTest() { public void before() { // ComplexType作成 // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CT_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CT_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(COMPLEX_TYPE_NAME_KEY, COMPLEX_TYPE_NAME); // リクエスト実行 @@ -95,7 +95,7 @@ public void after() { @Test public final void ComplexTypePropertyTypeのEdmDoubleでDefaultValueが正のDouble最小値を下回る場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -104,14 +104,14 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_DEFAULT_VALUE_KEY, 2.229e-308); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse( response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( ComplexTypePropertyUtils.CT_PROPERTY_DEFAULT_VALUE_KEY) .getMessage()); } @@ -122,7 +122,7 @@ public void after() { @Test public final void ComplexTypePropertyTypeのEdmDoubleでDefaultValueが正のDouble最大値を下回る場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -131,14 +131,14 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_DEFAULT_VALUE_KEY, 1.791e308); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse( response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( ComplexTypePropertyUtils.CT_PROPERTY_DEFAULT_VALUE_KEY) .getMessage()); } @@ -149,7 +149,7 @@ public void after() { @Test public final void ComplexTypePropertyTypeのEdmDoubleでDefaultValueが負のDouble最小値を下回る場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -158,14 +158,14 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_DEFAULT_VALUE_KEY, -1.791e308); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse( response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( ComplexTypePropertyUtils.CT_PROPERTY_DEFAULT_VALUE_KEY) .getMessage()); } @@ -176,7 +176,7 @@ public void after() { @Test public final void ComplexTypePropertyTypeのEdmDoubleでDefaultValueが負のDouble最大値を下回る場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(ComplexTypePropertyUtils.CTP_REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, CT_PROPERTY_NAME); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, COMPLEX_TYPE_NAME); @@ -185,14 +185,14 @@ public void after() { req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_DEFAULT_VALUE_KEY, -2.229e-308); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse( response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( ComplexTypePropertyUtils.CT_PROPERTY_DEFAULT_VALUE_KEY) .getMessage()); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/package-info.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/package-info.java similarity index 87% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/package-info.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/package-info.java index abdd8398a..6704b351b 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/complextypeproperty/package-info.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/complextypeproperty/package-info.java @@ -17,5 +17,5 @@ /** * ComplexTypeProperty CRUD test. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.complextypeproperty; +package io.personium.test.jersey.box.odatacol.schema.complextypeproperty; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/entitytype/AllTests.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/entitytype/AllTests.java similarity index 90% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/entitytype/AllTests.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/entitytype/AllTests.java index a1e58182d..44bac591c 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/entitytype/AllTests.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/entitytype/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.entitytype; +package io.personium.test.jersey.box.odatacol.schema.entitytype; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/entitytype/EntityTypeCrudTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/entitytype/EntityTypeCrudTest.java similarity index 90% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/entitytype/EntityTypeCrudTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/entitytype/EntityTypeCrudTest.java index 1766cd119..19f139422 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/entitytype/EntityTypeCrudTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/entitytype/EntityTypeCrudTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.entitytype; +package io.personium.test.jersey.box.odatacol.schema.entitytype; import static org.junit.Assert.assertEquals; @@ -30,27 +30,27 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.odatacol.schema.property.PropertyUtils; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.utils.AssociationEndUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.odatacol.schema.property.PropertyUtils; +import io.personium.test.setup.Setup; +import io.personium.test.utils.AssociationEndUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; /** * EntityTypeCRUDのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class EntityTypeCrudTest extends ODataCommon { @@ -60,7 +60,7 @@ public class EntityTypeCrudTest extends ODataCommon { * コンストラクタ. */ public EntityTypeCrudTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -424,8 +424,8 @@ public EntityTypeCrudTest() { String entityTypeBody = "{\"Name\": \"" + entityTypeReName + "\"}"; res = EntityTypeUtils.update(MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, entityTypeName, entityTypeBody, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); } finally { EntityTypeUtils.delete(Setup.TEST_ODATA, MASTER_TOKEN_NAME, ACCEPT, entityTypeName, Setup.TEST_CELL1, -1); @@ -449,8 +449,8 @@ public EntityTypeCrudTest() { String entityTypeBody = "{\"Name\": \"" + entityTypeReName + "\"}"; res = EntityTypeUtils.update(MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, entityTypeName, entityTypeBody, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); } finally { EntityTypeUtils.delete(Setup.TEST_ODATA, MASTER_TOKEN_NAME, ACCEPT, entityTypeName, Setup.TEST_CELL1, -1); @@ -474,8 +474,8 @@ public EntityTypeCrudTest() { String entityTypeBody = "{\"Name\": \"" + entityTypeReName + "\"}"; res = EntityTypeUtils.update(MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, entityTypeName, entityTypeBody, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); } finally { EntityTypeUtils.delete(Setup.TEST_ODATA, MASTER_TOKEN_NAME, ACCEPT, entityTypeName, Setup.TEST_CELL1, -1); @@ -499,8 +499,8 @@ public EntityTypeCrudTest() { String entityTypeBody = "{\"Name\": \"" + entityTypeReName + "\"}"; res = EntityTypeUtils.update(MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, entityTypeName, entityTypeBody, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); } finally { EntityTypeUtils.delete(Setup.TEST_ODATA, MASTER_TOKEN_NAME, ACCEPT, entityTypeName, Setup.TEST_CELL1, -1); @@ -590,8 +590,8 @@ public EntityTypeCrudTest() { String entityTypeBody = "{\"Name\": \"" + entityTypeReName + "\"}"; res = EntityTypeUtils.update(MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, entityTypeName, entityTypeBody, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); } finally { EntityTypeUtils.delete(Setup.TEST_ODATA, MASTER_TOKEN_NAME, ACCEPT, entityTypeName, Setup.TEST_CELL1, -1); @@ -615,8 +615,8 @@ public EntityTypeCrudTest() { String entityTypeBody = "{\"Name\": \"" + entityTypeReName + "\"}"; res = EntityTypeUtils.update(MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, entityTypeName, entityTypeBody, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("Name").getMessage()); } finally { EntityTypeUtils.delete(Setup.TEST_ODATA, MASTER_TOKEN_NAME, ACCEPT, entityTypeName, Setup.TEST_CELL1, -1); @@ -639,8 +639,8 @@ public EntityTypeCrudTest() { String entityTypeBody = "{}"; res = EntityTypeUtils.update(MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, entityTypeName, entityTypeBody, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("Name").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("Name").getMessage()); } finally { EntityTypeUtils.delete(Setup.TEST_ODATA, MASTER_TOKEN_NAME, ACCEPT, entityTypeName, Setup.TEST_CELL1, -1); @@ -661,8 +661,8 @@ public EntityTypeCrudTest() { TResponse res = EntityTypeUtils.update(MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, entityTypeName, entityTypeBody, HttpStatus.SC_NOT_FOUND); - res.checkErrorResponse(DcCoreException.OData.NO_SUCH_ENTITY.getCode(), - DcCoreException.OData.NO_SUCH_ENTITY.getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.NO_SUCH_ENTITY.getCode(), + PersoniumCoreException.OData.NO_SUCH_ENTITY.getMessage()); } finally { EntityTypeUtils.delete(Setup.TEST_ODATA, MASTER_TOKEN_NAME, ACCEPT, entityTypeName, Setup.TEST_CELL1, -1); @@ -691,8 +691,8 @@ public EntityTypeCrudTest() { res = EntityTypeUtils.update(MASTER_TOKEN_NAME, Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, entityTypeName2, entityTypeBody, HttpStatus.SC_CONFLICT); - res.checkErrorResponse(DcCoreException.OData.ENTITY_ALREADY_EXISTS.getCode(), - DcCoreException.OData.ENTITY_ALREADY_EXISTS.getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.ENTITY_ALREADY_EXISTS.getCode(), + PersoniumCoreException.OData.ENTITY_ALREADY_EXISTS.getMessage()); } finally { EntityTypeUtils.delete(Setup.TEST_ODATA, MASTER_TOKEN_NAME, ACCEPT, entityTypeName1, Setup.TEST_CELL1, -1); @@ -848,7 +848,7 @@ public EntityTypeCrudTest() { .with("entityType", entityTypeName) .with("query", "?\\$filter=date+eq+'2012/09/21'") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); @@ -869,7 +869,7 @@ public EntityTypeCrudTest() { @Test public final void EntityTypeを上限値を超える数作成した場合にエラーが返却される() { try { - for (int i = 0; i < DcCoreConfig.getUserdataMaxEntityCount(); i++) { + for (int i = 0; i < PersoniumUnitConfig.getUserdataMaxEntityCount(); i++) { String entityTypeName = String.format("testEntity%03d", i); createEntityType(entityTypeName, Setup.TEST_ODATA); } @@ -877,7 +877,7 @@ public EntityTypeCrudTest() { TResponse res = createEntityType(entityTypeName, Setup.TEST_ODATA); res.statusCode(HttpStatus.SC_BAD_REQUEST); } finally { - for (int i = 0; i < DcCoreConfig.getUserdataMaxEntityCount(); i++) { + for (int i = 0; i < PersoniumUnitConfig.getUserdataMaxEntityCount(); i++) { String entityTypeName = String.format("testEntity%03d", i); EntityTypeUtils.delete(Setup.TEST_ODATA, MASTER_TOKEN_NAME, "application/json", entityTypeName, Setup.TEST_BOX1, Setup.TEST_CELL1, -1); @@ -900,7 +900,7 @@ private TResponse createEntityType(String name, String odataName) { .with("boxPath", "box1") .with("odataSvcPath", odataName) .with("accept", MediaType.APPLICATION_JSON) - .with("token", "Bearer " + DcCoreConfig.getMasterToken()) + .with("token", "Bearer " + PersoniumUnitConfig.getMasterToken()) .with("Name", name) .returns() .debug(); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/AllTests.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/property/AllTests.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/AllTests.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/property/AllTests.java index 464ea7b01..e3e79d42e 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/AllTests.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/property/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.property; +package io.personium.test.jersey.box.odatacol.schema.property; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyCreateTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyCreateTest.java similarity index 77% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyCreateTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyCreateTest.java index 5136102d9..8f1fa82b1 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyCreateTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyCreateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.property; +package io.personium.test.jersey.box.odatacol.schema.property; import static org.junit.Assert.assertEquals; @@ -34,26 +34,26 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.Property; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.EntityTypeUtils; /** * Property登録のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class PropertyCreateTest extends ODataCommon { @@ -67,7 +67,7 @@ public class PropertyCreateTest extends ODataCommon { * コンストラクタ. */ public PropertyCreateTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -88,14 +88,14 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); req.addJsonBody(PropertyUtils.PROPERTY_TYPE_KEY, EdmSimpleType.STRING.getFullyQualifiedTypeName()); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -121,7 +121,7 @@ public void before() { @Test public final void 既にデータが存在するEntityTypeに対してPropertyのNullableをFalseで作成した場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, "SalesDetail"); @@ -129,13 +129,13 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_NULLABLE_KEY, false); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_NULLABLE_KEY) + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_NULLABLE_KEY) .getMessage()); } @@ -149,14 +149,14 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); req.addJsonBody(PropertyUtils.PROPERTY_TYPE_KEY, EdmSimpleType.STRING.getFullyQualifiedTypeName()); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // リクエスト実行 @@ -164,8 +164,8 @@ public void before() { // レスポンスチェック checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.ENTITY_ALREADY_EXISTS.getCode(), - DcCoreException.OData.ENTITY_ALREADY_EXISTS.getMessage()); + PersoniumCoreException.OData.ENTITY_ALREADY_EXISTS.getCode(), + PersoniumCoreException.OData.ENTITY_ALREADY_EXISTS.getMessage()); } finally { // 作成したPropertyを削除 @@ -183,14 +183,14 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); req.addJsonBody(PropertyUtils.PROPERTY_TYPE_KEY, EdmSimpleType.STRING.getFullyQualifiedTypeName()); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // 作成したPropertyを削除 @@ -216,21 +216,21 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); req.addJsonBody(PropertyUtils.PROPERTY_TYPE_KEY, EdmSimpleType.STRING.getFullyQualifiedTypeName()); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // 作成したPropertyを削除 assertEquals(HttpStatus.SC_NO_CONTENT, deleteOdataResource(locationUrl).getStatusCode()); // リクエストパラメータ設定 - req = DcRequest.post(PropertyUtils.REQUEST_URL); + req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -252,33 +252,33 @@ public void before() { public final void Collectionの異なるEntityTypeNameを指定してPropertyを新規作成した場合にBadRequestが返却されること() { try { // Collection/EntityType作成 - DavResourceUtils.createODataCollection(DcCoreConfig.getMasterToken(), HttpStatus.SC_CREATED, + DavResourceUtils.createODataCollection(PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_CREATED, Setup.TEST_CELL1, Setup.TEST_BOX1, "testcol"); - EntityTypeUtils.create(Setup.TEST_CELL1, DcCoreConfig.getMasterToken(), "testcol", + EntityTypeUtils.create(Setup.TEST_CELL1, PersoniumUnitConfig.getMasterToken(), "testcol", "anotherColEntityType", HttpStatus.SC_CREATED); // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, "anotherColEntityType"); req.addJsonBody(PropertyUtils.PROPERTY_TYPE_KEY, EdmSimpleType.STRING.getFullyQualifiedTypeName()); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.getCode(), - DcCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.params("anotherColEntityType").getMessage()); + PersoniumCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.getCode(), + PersoniumCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.params("anotherColEntityType").getMessage()); } finally { // 作成したEntityType/Collectionを削除 - EntityTypeUtils.delete("testcol", DcCoreConfig.getMasterToken(), + EntityTypeUtils.delete("testcol", PersoniumUnitConfig.getMasterToken(), MediaType.APPLICATION_JSON, "anotherColEntityType", Setup.TEST_CELL1, -1); DavResourceUtils.deleteCollection(Setup.TEST_CELL1, Setup.TEST_BOX1, "testcol", - DcCoreConfig.getMasterToken(), -1); + PersoniumUnitConfig.getMasterToken(), -1); } } @@ -289,37 +289,37 @@ public void before() { public final void Boxの異なるEntityTypeNameを指定してPropertyを新規作成した場合にBadRequestが返却されること() { try { // Box/Collection/EntityType作成 - BoxUtils.create(Setup.TEST_CELL1, "anotherbox", DcCoreConfig.getMasterToken()); - DavResourceUtils.createODataCollection(DcCoreConfig.getMasterToken(), HttpStatus.SC_CREATED, + BoxUtils.create(Setup.TEST_CELL1, "anotherbox", PersoniumUnitConfig.getMasterToken()); + DavResourceUtils.createODataCollection(PersoniumUnitConfig.getMasterToken(), HttpStatus.SC_CREATED, Setup.TEST_CELL1, "anotherbox", Setup.TEST_ODATA); - EntityTypeUtils.create(Setup.TEST_CELL1, DcCoreConfig.getMasterToken(), "anotherbox", + EntityTypeUtils.create(Setup.TEST_CELL1, PersoniumUnitConfig.getMasterToken(), "anotherbox", Setup.TEST_ODATA, "anotherBoxEntityType", HttpStatus.SC_CREATED); // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, "anotherBoxEntityType"); req.addJsonBody(PropertyUtils.PROPERTY_TYPE_KEY, EdmSimpleType.STRING.getFullyQualifiedTypeName()); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.getCode(), - DcCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.params("anotherBoxEntityType").getMessage()); + PersoniumCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.getCode(), + PersoniumCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.params("anotherBoxEntityType").getMessage()); } finally { // 作成したEntityType/Collectionを削除 - EntityTypeUtils.delete(Setup.TEST_ODATA, DcCoreConfig.getMasterToken(), + EntityTypeUtils.delete(Setup.TEST_ODATA, PersoniumUnitConfig.getMasterToken(), MediaType.APPLICATION_JSON, "anotherBoxEntityType", "anotherbox", Setup.TEST_CELL1, -1); DavResourceUtils.deleteCollection(Setup.TEST_CELL1, "anotherbox", Setup.TEST_ODATA, - DcCoreConfig.getMasterToken(), + PersoniumUnitConfig.getMasterToken(), -1); - BoxUtils.delete(Setup.TEST_CELL1, DcCoreConfig.getMasterToken(), "anotherbox"); + BoxUtils.delete(Setup.TEST_CELL1, PersoniumUnitConfig.getMasterToken(), "anotherbox"); } } @@ -330,16 +330,16 @@ public void before() { @Test @Ignore public final void Property制限値より1つ少ないPropertyを持つEntityTypeに_Propertyを1つ追加して_正常終了すること() throws Exception { - // 実際には 400プロパティが登録されているEntityTypeしか存在しないので、DcCoreConfigをだまして、 + // 実際には 400プロパティが登録されているEntityTypeしか存在しないので、PersoniumUnitConfigをだまして、 // SimplePropertyの最大値が 401であるように扱う。 - Field singletonField = DcCoreConfig.class.getDeclaredField("singleton"); + Field singletonField = PersoniumUnitConfig.class.getDeclaredField("singleton"); singletonField.setAccessible(true); - DcCoreConfig singleton = (DcCoreConfig) singletonField.get(null); - Field propField = DcCoreConfig.class.getDeclaredField("props"); + PersoniumUnitConfig singleton = (PersoniumUnitConfig) singletonField.get(null); + Field propField = PersoniumUnitConfig.class.getDeclaredField("props"); propField.setAccessible(true); Properties props = (Properties) propField.get(singleton); // ここで数値を詐称する。 - props.put(DcCoreConfig.UserDataProperties.MAX_PROPERTY_COUNT_IN_ENTITY, "401"); + props.put(PersoniumUnitConfig.UserDataProperties.MAX_PROPERTY_COUNT_IN_ENTITY, "401"); String locationUrl = UrlUtils.property(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, propName, @@ -347,21 +347,21 @@ public void before() { try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, Setup.TEST_ENTITYTYPE_MDP); req.addJsonBody(PropertyUtils.PROPERTY_TYPE_KEY, EdmSimpleType.STRING.getFullyQualifiedTypeName()); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); } finally { // 作成したPropertyを削除 assertEquals(HttpStatus.SC_NO_CONTENT, deleteOdataResource(locationUrl).getStatusCode()); - props.put(DcCoreConfig.UserDataProperties.MAX_PROPERTY_COUNT_IN_ENTITY, "400"); + props.put(PersoniumUnitConfig.UserDataProperties.MAX_PROPERTY_COUNT_IN_ENTITY, "400"); } } @@ -371,14 +371,14 @@ public void before() { @Test public final void Property制限値一杯のEntityTypeに_Propertyを1つ追加して_異常終了すること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, Setup.TEST_ENTITYTYPE_MDP); req.addJsonBody(PropertyUtils.PROPERTY_TYPE_KEY, EdmSimpleType.STRING.getFullyQualifiedTypeName()); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); @@ -394,14 +394,14 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); req.addJsonBody(PropertyUtils.PROPERTY_TYPE_KEY, EdmSimpleType.DOUBLE.getFullyQualifiedTypeName()); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyCreateValidateDefaultValueTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyCreateValidateDefaultValueTest.java similarity index 84% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyCreateValidateDefaultValueTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyCreateValidateDefaultValueTest.java index e94ccaba9..fab625638 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyCreateValidateDefaultValueTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyCreateValidateDefaultValueTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.property; +package io.personium.test.jersey.box.odatacol.schema.property; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -31,24 +31,24 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.core.utils.ODataUtils; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DaoException; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.Property; +import io.personium.core.utils.ODataUtils; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.DaoException; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; /** * Property登録のバリデートテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class PropertyCreateValidateDefaultValueTest extends ODataCommon { @@ -62,7 +62,7 @@ public class PropertyCreateValidateDefaultValueTest extends ODataCommon { * コンストラクタ. */ public PropertyCreateValidateDefaultValueTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -82,7 +82,7 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -94,7 +94,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -120,7 +120,7 @@ public void before() { @Test public final void PropertyのTypeがEdmInt32でDefaultValueが最小値を下回る場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -132,12 +132,12 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - checkErrorResponse(response.bodyAsJson(), DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_DEFAULT_VALUE_KEY) + checkErrorResponse(response.bodyAsJson(), PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_DEFAULT_VALUE_KEY) .getMessage()); } @@ -151,7 +151,7 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -163,7 +163,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -192,7 +192,7 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -204,7 +204,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -230,7 +230,7 @@ public void before() { @Test public final void PropertyのTypeがEdmInt32でDefaultValueが最大値を上回る場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -242,12 +242,12 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - checkErrorResponse(response.bodyAsJson(), DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_DEFAULT_VALUE_KEY) + checkErrorResponse(response.bodyAsJson(), PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_DEFAULT_VALUE_KEY) .getMessage()); } @@ -258,7 +258,7 @@ public void before() { @Test public final void PropertyのTypeがEdmDoubleでDefaultValueが正のDouble最大値を上回る場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -270,12 +270,12 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - checkErrorResponse(response.bodyAsJson(), DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_DEFAULT_VALUE_KEY) + checkErrorResponse(response.bodyAsJson(), PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_DEFAULT_VALUE_KEY) .getMessage()); } @@ -286,7 +286,7 @@ public void before() { @Test public final void PropertyのTypeがEdmDoubleでDefaultValueが正のDouble最小値を下回る場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -298,12 +298,12 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - checkErrorResponse(response.bodyAsJson(), DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_DEFAULT_VALUE_KEY) + checkErrorResponse(response.bodyAsJson(), PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_DEFAULT_VALUE_KEY) .getMessage()); } @@ -314,7 +314,7 @@ public void before() { @Test public final void PropertyのTypeがEdmDoubleでDefaultValueが負のDouble最大値を上回る場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -326,12 +326,12 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - checkErrorResponse(response.bodyAsJson(), DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_DEFAULT_VALUE_KEY) + checkErrorResponse(response.bodyAsJson(), PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_DEFAULT_VALUE_KEY) .getMessage()); } @@ -342,7 +342,7 @@ public void before() { @Test public final void PropertyのTypeがEdmDoubleでDefaultValueが負のDouble最小値を下回る場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -354,12 +354,12 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - checkErrorResponse(response.bodyAsJson(), DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_DEFAULT_VALUE_KEY) + checkErrorResponse(response.bodyAsJson(), PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_DEFAULT_VALUE_KEY) .getMessage()); } @@ -373,7 +373,7 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -385,7 +385,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -411,7 +411,7 @@ public void before() { @Test public final void PropertyのTypeがEdmSingleでDefaultValueが整数が6桁の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -423,12 +423,12 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - checkErrorResponse(response.bodyAsJson(), DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_DEFAULT_VALUE_KEY) + checkErrorResponse(response.bodyAsJson(), PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_DEFAULT_VALUE_KEY) .getMessage()); } @@ -439,7 +439,7 @@ public void before() { @Test public final void PropertyのTypeがEdmSingleでDefaultValueが小数が6桁の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -451,12 +451,12 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - checkErrorResponse(response.bodyAsJson(), DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_DEFAULT_VALUE_KEY) + checkErrorResponse(response.bodyAsJson(), PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_DEFAULT_VALUE_KEY) .getMessage()); } @@ -470,7 +470,7 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -482,7 +482,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -511,7 +511,7 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -523,7 +523,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -549,7 +549,7 @@ public void before() { @Test public final void PropertyのTypeがEdmBooleanでDefaultValueが不正な値の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -561,12 +561,12 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - checkErrorResponse(response.bodyAsJson(), DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_DEFAULT_VALUE_KEY) + checkErrorResponse(response.bodyAsJson(), PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_DEFAULT_VALUE_KEY) .getMessage()); } @@ -577,7 +577,7 @@ public void before() { @Test public final void PropertyのTypeがEdmDateTimeでDefaultValueが最小値を下回る場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -589,12 +589,12 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - checkErrorResponse(response.bodyAsJson(), DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_DEFAULT_VALUE_KEY) + checkErrorResponse(response.bodyAsJson(), PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_DEFAULT_VALUE_KEY) .getMessage()); } @@ -608,7 +608,7 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -620,7 +620,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -649,7 +649,7 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -661,7 +661,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -687,7 +687,7 @@ public void before() { @Test public final void PropertyのTypeがEdmDateTimeでDefaultValueが最大値を上回る場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -699,12 +699,12 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - checkErrorResponse(response.bodyAsJson(), DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_DEFAULT_VALUE_KEY) + checkErrorResponse(response.bodyAsJson(), PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_DEFAULT_VALUE_KEY) .getMessage()); } @@ -717,7 +717,7 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -729,7 +729,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -755,7 +755,7 @@ public void before() { @Test public final void PropertyのTypeがEdmDateTimeでDefaultValueがLong型を指定した場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -767,12 +767,12 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - checkErrorResponse(response.bodyAsJson(), DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_DEFAULT_VALUE_KEY) + checkErrorResponse(response.bodyAsJson(), PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_DEFAULT_VALUE_KEY) .getMessage()); } @@ -782,7 +782,7 @@ public void before() { @Test public final void PropertyのTypeがEdmDateTimeでDefaultValueが不正な文字列を指定した場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -794,12 +794,12 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - checkErrorResponse(response.bodyAsJson(), DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_DEFAULT_VALUE_KEY) + checkErrorResponse(response.bodyAsJson(), PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_DEFAULT_VALUE_KEY) .getMessage()); } @@ -812,7 +812,7 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -824,7 +824,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -854,7 +854,7 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -866,7 +866,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック String resBody = response.bodyAsString(); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyCreateValidateTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyCreateValidateTest.java similarity index 85% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyCreateValidateTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyCreateValidateTest.java index 7601afd43..d27af436c 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyCreateValidateTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyCreateValidateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.property; +package io.personium.test.jersey.box.odatacol.schema.property; import static org.junit.Assert.assertEquals; @@ -31,23 +31,23 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.Property; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.EntityTypeUtils; /** * Property登録のバリデートテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class PropertyCreateValidateTest extends ODataCommon { @@ -61,7 +61,7 @@ public class PropertyCreateValidateTest extends ODataCommon { * コンストラクタ. */ public PropertyCreateValidateTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -78,7 +78,7 @@ public void before() { @Test public final void PropertyのName属性がない場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); req.addJsonBody(PropertyUtils.PROPERTY_TYPE_KEY, EdmSimpleType.STRING.getFullyQualifiedTypeName()); @@ -89,13 +89,13 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING .params(PropertyUtils.PROPERTY_NAME_KEY).getMessage()); } @@ -105,7 +105,7 @@ public void before() { @Test public final void PropertyのNameが空文字の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, ""); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -117,13 +117,13 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_NAME_KEY).getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_NAME_KEY).getMessage()); } /** @@ -137,7 +137,7 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propertyName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -149,7 +149,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -180,7 +180,7 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propertyName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -192,7 +192,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -218,7 +218,7 @@ public void before() { @Test public final void PropertyのNameが129文字の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, STRING_LENGTH_129); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -230,13 +230,13 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_NAME_KEY).getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_NAME_KEY).getMessage()); } /** @@ -250,7 +250,7 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propertyName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -262,7 +262,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -288,7 +288,7 @@ public void before() { @Test public final void PropertyのNameが半角英数字以外の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, "Ad.*s"); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -300,13 +300,13 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_NAME_KEY).getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_NAME_KEY).getMessage()); } /** @@ -315,7 +315,7 @@ public void before() { @Test public final void PropertyのNameが先頭文字がハイフンの場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, "-p_name"); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -327,13 +327,13 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_NAME_KEY).getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_NAME_KEY).getMessage()); } /** @@ -342,7 +342,7 @@ public void before() { @Test public final void PropertyのNameが先頭文字がアンダーバーの場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, "_p_name"); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -354,13 +354,13 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_NAME_KEY).getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_NAME_KEY).getMessage()); } /** @@ -369,7 +369,7 @@ public void before() { @Test public final void Propertyの_EntityTypeName属性がない場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_TYPE_KEY, EdmSimpleType.STRING.getFullyQualifiedTypeName()); @@ -380,13 +380,13 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY) + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY) .getMessage()); } @@ -396,7 +396,7 @@ public void before() { @Test public final void Propertyの_EntityTypeNameが空文字の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, ""); @@ -408,13 +408,13 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY) + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY) .getMessage()); } @@ -431,7 +431,7 @@ public void before() { Setup.TEST_ODATA, entityTypeName, HttpStatus.SC_CREATED); // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, entityTypeName); @@ -443,7 +443,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -478,7 +478,7 @@ public void before() { Setup.TEST_ODATA, entityTypeName, HttpStatus.SC_CREATED); // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, entityTypeName); @@ -490,7 +490,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -517,7 +517,7 @@ public void before() { @Test public final void Propertyの_EntityTypeNameが129文字の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, STRING_LENGTH_129); @@ -529,13 +529,13 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY) + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY) .getMessage()); } @@ -551,7 +551,7 @@ public void before() { Setup.TEST_ODATA, entityTypeName, HttpStatus.SC_CREATED); // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, entityTypeName); @@ -563,7 +563,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -581,7 +581,7 @@ public void before() { @Test public final void Propertyの_EntityTypeNameが半角英数字以外の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, "Ad.*s"); @@ -593,13 +593,13 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY) + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY) .getMessage()); } @@ -609,7 +609,7 @@ public void before() { @Test public final void Propertyの_EntityTypeNameが先頭文字がハイフンの場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, "-SalesDetail"); @@ -621,13 +621,13 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY) + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY) .getMessage()); } @@ -637,7 +637,7 @@ public void before() { @Test public final void Propertyの_EntityTypeNameが先頭文字がアンダーバーの場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, "_SalesDetail"); @@ -649,13 +649,13 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY) + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY) .getMessage()); } @@ -667,7 +667,7 @@ public void before() { String entityTypeName = "xxx"; // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, entityTypeName); @@ -679,13 +679,13 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.getCode(), - DcCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.params(entityTypeName).getMessage()); + PersoniumCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.getCode(), + PersoniumCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.params(entityTypeName).getMessage()); } /** @@ -698,7 +698,7 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -710,7 +710,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -740,7 +740,7 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -752,7 +752,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -782,7 +782,7 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -794,7 +794,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -823,7 +823,7 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -835,7 +835,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -861,7 +861,7 @@ public void before() { @Test public final void PropertyのTypeが不正な値の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -873,13 +873,13 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_TYPE_KEY).getMessage()); + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_TYPE_KEY).getMessage()); } /** @@ -894,17 +894,17 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(UrlUtils.complexType(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, + PersoniumRequest req = PersoniumRequest.post(UrlUtils.complexType(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, null)); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("Name", "propTest"); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // リクエストパラメータ設定 - req = DcRequest.post(PropertyUtils.REQUEST_URL); + req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -948,7 +948,7 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -960,7 +960,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -995,7 +995,7 @@ public void before() { EntityTypeUtils.create(Setup.TEST_CELL1, MASTER_TOKEN_NAME, Setup.TEST_ODATA, entityTypeName, HttpStatus.SC_CREATED); // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, entityTypeName); @@ -1007,7 +1007,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -1035,7 +1035,7 @@ public void before() { @Test public final void PropertyのNullableが不正な値の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -1047,13 +1047,13 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_NULLABLE_KEY) + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_NULLABLE_KEY) .getMessage()); } @@ -1067,7 +1067,7 @@ public void before() { try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -1079,7 +1079,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -1109,7 +1109,7 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -1121,7 +1121,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -1147,7 +1147,7 @@ public void before() { @Test public final void PropertyのCollectionKindが不正な値の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -1159,13 +1159,13 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_COLLECTION_KIND_KEY) + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_COLLECTION_KIND_KEY) .getMessage()); } @@ -1179,7 +1179,7 @@ public void before() { try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -1191,7 +1191,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -1221,7 +1221,7 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -1233,7 +1233,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -1259,7 +1259,7 @@ public void before() { @Test public final void PropertyのIsKeyが不正な値の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -1271,13 +1271,13 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR .params(PropertyUtils.PROPERTY_IS_KEY_KEY).getMessage()); } @@ -1287,7 +1287,7 @@ public void before() { @Test public final void PropertyのUniqueKeyが空文字の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -1299,13 +1299,13 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, ""); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY) + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY) .getMessage()); } @@ -1320,7 +1320,7 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -1332,7 +1332,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, uniqueKey); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -1363,7 +1363,7 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -1375,7 +1375,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, uniqueKey); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -1401,7 +1401,7 @@ public void before() { @Test public final void PropertyのuniqueKeyが129文字の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -1413,13 +1413,13 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, STRING_LENGTH_129); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY) + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY) .getMessage()); } @@ -1434,7 +1434,7 @@ public void before() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -1446,7 +1446,7 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, uniqueKey); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -1472,7 +1472,7 @@ public void before() { @Test public final void PropertyのuniqueKeyが半角英数字以外の場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -1484,13 +1484,13 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, "Ad.*s"); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY) + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY) .getMessage()); } @@ -1500,7 +1500,7 @@ public void before() { @Test public final void PropertyのuniqueKeyが先頭文字がハイフンの場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -1512,13 +1512,13 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, "-p_name"); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY) + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY) .getMessage()); } @@ -1528,7 +1528,7 @@ public void before() { @Test public final void PropertyのuniqueKeyが先頭文字がアンダーバーの場合_BadRequestが返却されること() { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -1540,13 +1540,13 @@ public void before() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, "_p_name"); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY) + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY) .getMessage()); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyCreateViaNPTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyCreateViaNPTest.java similarity index 87% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyCreateViaNPTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyCreateViaNPTest.java index d981d6a9b..cc377e518 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyCreateViaNPTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyCreateViaNPTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.property; +package io.personium.test.jersey.box.odatacol.schema.property; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -30,20 +30,20 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.model.ctl.Property; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.TResponse; /** * PropertyNP経由登録のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class PropertyCreateViaNPTest extends ODataCommon { @@ -57,7 +57,7 @@ public class PropertyCreateViaNPTest extends ODataCommon { * コンストラクタ. */ public PropertyCreateViaNPTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyDeleteTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyDeleteTest.java similarity index 85% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyDeleteTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyDeleteTest.java index 687c1ed29..cb39c3aef 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyDeleteTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyDeleteTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.property; +package io.personium.test.jersey.box.odatacol.schema.property; import static org.junit.Assert.assertEquals; @@ -27,21 +27,21 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.odatacol.AbstractUserDataTest; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.odatacol.AbstractUserDataTest; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; /** * Property削除のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class PropertyDeleteTest extends AbstractUserDataTest { @@ -73,13 +73,13 @@ public void before() { String userDataId = "userdata001"; String entityRequestUrl = null; String propertyRequestUrl = null; - DcResponse res = null; + PersoniumResponse res = null; try { // EntityType登録 entityRequestUrl = UrlUtils.entityType(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, null); - DcRequest req = DcRequest.post(entityRequestUrl); + PersoniumRequest req = PersoniumRequest.post(entityRequestUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody("Name", entityTypeName); // リクエスト実行 @@ -88,7 +88,7 @@ public void before() { // プロパティ登録 propertyRequestUrl = UrlUtils.property(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, null, null); - req = DcRequest.post(PropertyUtils.REQUEST_URL); + req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, entityTypeName); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyGetTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyGetTest.java similarity index 82% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyGetTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyGetTest.java index a5a5aa728..31649149d 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyGetTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyGetTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.property; +package io.personium.test.jersey.box.odatacol.schema.property; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -32,22 +32,22 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DaoException; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.core.model.ctl.Property; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.DaoException; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; /** * Property1件取得のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class PropertyGetTest extends ODataCommon { @@ -61,7 +61,7 @@ public class PropertyGetTest extends ODataCommon { * コンストラクタ. */ public PropertyGetTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -73,7 +73,7 @@ public PropertyGetTest() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, PROPERTY_NAME); @@ -81,17 +81,17 @@ public PropertyGetTest() { req.addJsonBody(PropertyUtils.PROPERTY_TYPE_KEY, EdmSimpleType.STRING.getFullyQualifiedTypeName()); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // etag取得 String etag = getEtag(response); // Property取得 - req = DcRequest.get(locationUrl); + req = PersoniumRequest.get(locationUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse resGet = request(req); + PersoniumResponse resGet = request(req); // レスポンスチェック Map expected = new HashMap(); @@ -119,9 +119,9 @@ public PropertyGetTest() { String locationUrl = UrlUtils.property(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, PROPERTY_NAME, PROPERTY_ENTITYTYPE_NAME); // Property取得 - DcRequest req = DcRequest.get(locationUrl); + PersoniumRequest req = PersoniumRequest.get(locationUrl); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse resGet = request(req); + PersoniumResponse resGet = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_NOT_FOUND, resGet.getStatusCode()); @@ -138,20 +138,20 @@ public PropertyGetTest() { "test"); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, PROPERTY_NAME); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); req.addJsonBody(PropertyUtils.PROPERTY_TYPE_KEY, EdmSimpleType.STRING.getFullyQualifiedTypeName()); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // Property取得 - req = DcRequest.get(locationUrlGet); + req = PersoniumRequest.get(locationUrlGet); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse resGet = request(req); + PersoniumResponse resGet = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_NOT_FOUND, resGet.getStatusCode()); @@ -171,7 +171,7 @@ public PropertyGetTest() { PROPERTY_ENTITYTYPE_NAME); try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, PROPERTY_NAME); @@ -184,14 +184,14 @@ public PropertyGetTest() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // Property取得 - req = DcRequest.get(locationUrl); + req = PersoniumRequest.get(locationUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse resGet = request(req); + PersoniumResponse resGet = request(req); // レスポンスチェック String resBody = resGet.bodyAsString(); @@ -199,7 +199,7 @@ public PropertyGetTest() { assertFalse(resBody.contains("\u0000")); // Property取得(2回目:キャッシュされた場合の動作を確認する) - req = DcRequest.get(locationUrl); + req = PersoniumRequest.get(locationUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); resGet = request(req); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyLinkTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyLinkTest.java similarity index 79% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyLinkTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyLinkTest.java index 1876911c4..7ef65aa80 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyLinkTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyLinkTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.property; +package io.personium.test.jersey.box.odatacol.schema.property; import static org.junit.Assert.assertEquals; @@ -26,25 +26,25 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.EntityType; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.EntityType; +import io.personium.core.model.ctl.Property; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.UserDataUtils; /** * ComplexTypeのLinksテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class PropertyLinkTest extends ODataCommon { @@ -52,7 +52,7 @@ public class PropertyLinkTest extends ODataCommon { * コンストラクタ. */ public PropertyLinkTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -82,7 +82,7 @@ public PropertyLinkTest() { // EntityType - Property $links一覧取得 String key = String.format("Name='%s',_EntityType.Name='%s'", propertyName, entityTypeName); - DcRequest req = DcRequest.post( + PersoniumRequest req = PersoniumRequest.post( UrlUtils.schemaLinks(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, Property.EDM_TYPE_NAME, key, EntityType.EDM_TYPE_NAME, null)); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); @@ -90,13 +90,13 @@ public PropertyLinkTest() { UrlUtils.entityType(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, entityTypeName)); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.NO_SUCH_ASSOCIATION.getCode(), - DcCoreException.OData.NO_SUCH_ASSOCIATION.getMessage()); + PersoniumCoreException.OData.NO_SUCH_ASSOCIATION.getCode(), + PersoniumCoreException.OData.NO_SUCH_ASSOCIATION.getMessage()); } finally { // Property削除 ODataCommon.deleteOdataResource(propertyLocationUrl); @@ -112,19 +112,19 @@ public PropertyLinkTest() { @Test public final void PropertyとEntityTypeのLink更新は501が返却される事() { // リクエストパラメータ設定 - DcRequest req = DcRequest.put( + PersoniumRequest req = PersoniumRequest.put( UrlUtils.schemaLinksWithSingleQuote(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, Property.EDM_TYPE_NAME, "id", EntityType.EDM_TYPE_NAME, "id")); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_NOT_IMPLEMENTED, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.Misc.METHOD_NOT_IMPLEMENTED.getCode(), - DcCoreException.Misc.METHOD_NOT_IMPLEMENTED.getMessage()); + PersoniumCoreException.Misc.METHOD_NOT_IMPLEMENTED.getCode(), + PersoniumCoreException.Misc.METHOD_NOT_IMPLEMENTED.getMessage()); } /** @@ -133,19 +133,19 @@ public PropertyLinkTest() { @Test public final void PropertyとEntityTypeのLink削除は400が返却される事() { // リクエストパラメータ設定 - DcRequest req = DcRequest.delete( + PersoniumRequest req = PersoniumRequest.delete( UrlUtils.schemaLinksWithSingleQuote(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, Property.EDM_TYPE_NAME, "id", EntityType.EDM_TYPE_NAME, "id")); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.NO_SUCH_ASSOCIATION.getCode(), - DcCoreException.OData.NO_SUCH_ASSOCIATION.getMessage()); + PersoniumCoreException.OData.NO_SUCH_ASSOCIATION.getCode(), + PersoniumCoreException.OData.NO_SUCH_ASSOCIATION.getMessage()); } /** @@ -175,11 +175,11 @@ public PropertyLinkTest() { // Property - EntityType $links一覧取得 String propertyKey = String.format("Name='%s',_EntityType.Name='%s'", propertyName, entityTypeName); - DcRequest req = DcRequest.get( + PersoniumRequest req = PersoniumRequest.get( UrlUtils.schemaLinks(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, Property.EDM_TYPE_NAME, propertyKey, EntityType.EDM_TYPE_NAME, null)); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_OK, response.getStatusCode()); @@ -212,7 +212,7 @@ public PropertyLinkTest() { .getLocationHeader(); // EntityType - Property $links登録 - DcRequest req = DcRequest.post( + PersoniumRequest req = PersoniumRequest.post( UrlUtils.schemaLinksWithSingleQuote(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, EntityType.EDM_TYPE_NAME, entityTypeName, Property.EDM_TYPE_NAME, null)); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); @@ -220,13 +220,13 @@ public PropertyLinkTest() { "dummyProperty", entityTypeName)); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.NO_SUCH_ASSOCIATION.getCode(), - DcCoreException.OData.NO_SUCH_ASSOCIATION.getMessage()); + PersoniumCoreException.OData.NO_SUCH_ASSOCIATION.getCode(), + PersoniumCoreException.OData.NO_SUCH_ASSOCIATION.getMessage()); } finally { // EntityType削除 ODataCommon.deleteOdataResource(entityTypeLocationUrl); @@ -239,19 +239,19 @@ public PropertyLinkTest() { @Test public final void EntityTypeとPropertyのLink更新は501が返却される事() { // リクエストパラメータ設定 - DcRequest req = DcRequest.put( + PersoniumRequest req = PersoniumRequest.put( UrlUtils.schemaLinksWithSingleQuote(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, EntityType.EDM_TYPE_NAME, "id", Property.EDM_TYPE_NAME, "id")); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_NOT_IMPLEMENTED, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.Misc.METHOD_NOT_IMPLEMENTED.getCode(), - DcCoreException.Misc.METHOD_NOT_IMPLEMENTED.getMessage()); + PersoniumCoreException.Misc.METHOD_NOT_IMPLEMENTED.getCode(), + PersoniumCoreException.Misc.METHOD_NOT_IMPLEMENTED.getMessage()); } /** @@ -260,19 +260,19 @@ public PropertyLinkTest() { @Test public final void EntityTypeとPropertyのLink削除は400が返却される事() { // リクエストパラメータ設定 - DcRequest req = DcRequest.delete( + PersoniumRequest req = PersoniumRequest.delete( UrlUtils.schemaLinksWithSingleQuote(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, EntityType.EDM_TYPE_NAME, "id", Property.EDM_TYPE_NAME, "id")); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.NO_SUCH_ASSOCIATION.getCode(), - DcCoreException.OData.NO_SUCH_ASSOCIATION.getMessage()); + PersoniumCoreException.OData.NO_SUCH_ASSOCIATION.getCode(), + PersoniumCoreException.OData.NO_SUCH_ASSOCIATION.getMessage()); } /** @@ -301,11 +301,11 @@ public PropertyLinkTest() { .getFirstHeader(HttpHeaders.LOCATION); // EntityType - Property $links一覧取得 - DcRequest req = DcRequest.get( + PersoniumRequest req = PersoniumRequest.get( UrlUtils.schemaLinksWithSingleQuote(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, EntityType.EDM_TYPE_NAME, entityTypeName, Property.EDM_TYPE_NAME, null)); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse response = request(req); + PersoniumResponse response = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_OK, response.getStatusCode()); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyListTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyListTest.java similarity index 84% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyListTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyListTest.java index 828b8fbff..bc6184fb6 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyListTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyListTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.property; +package io.personium.test.jersey.box.odatacol.schema.property; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -32,22 +32,22 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DaoException; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.core.model.ctl.Property; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.DaoException; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; /** * Property一覧取得のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class PropertyListTest extends ODataCommon { @@ -64,7 +64,7 @@ public class PropertyListTest extends ODataCommon { * コンストラクタ. */ public PropertyListTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -80,38 +80,38 @@ public PropertyListTest() { try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, PROPERTY_NAME); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); req.addJsonBody(PropertyUtils.PROPERTY_TYPE_KEY, EdmSimpleType.STRING.getFullyQualifiedTypeName()); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // etag取得 String etag = getEtag(response); // リクエストパラメータ設定 - DcRequest req2 = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req2 = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req2.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req2.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, PROPERTY_NAME2); req2.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); req2.addJsonBody(PropertyUtils.PROPERTY_TYPE_KEY, EdmSimpleType.INT32.getFullyQualifiedTypeName()); // リクエスト実行 - DcResponse response2 = request(req2); + PersoniumResponse response2 = request(req2); assertEquals(HttpStatus.SC_CREATED, response2.getStatusCode()); // etag取得 String etag2 = getEtag(response2); // Property取得 - req = DcRequest.get(locationUrlGet + "?$orderby=__published+desc&$top=2"); + req = PersoniumRequest.get(locationUrlGet + "?$orderby=__published+desc&$top=2"); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse resGet = request(req); + PersoniumResponse resGet = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_OK, resGet.getStatusCode()); @@ -167,10 +167,10 @@ public PropertyListTest() { String locationUrl = UrlUtils.property(Setup.TEST_CELL1, Setup.TEST_BOX1, Setup.TEST_ODATA, null, null); // Property取得 - DcRequest req = DcRequest.get(locationUrl); + PersoniumRequest req = PersoniumRequest.get(locationUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse resGet = request(req); + PersoniumResponse resGet = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_OK, resGet.getStatusCode()); @@ -189,7 +189,7 @@ public PropertyListTest() { try { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(PropertyUtils.REQUEST_URL); + PersoniumRequest req = PersoniumRequest.post(PropertyUtils.REQUEST_URL); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, PROPERTY_NAME); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, PROPERTY_ENTITYTYPE_NAME); @@ -201,14 +201,14 @@ public PropertyListTest() { req.addJsonBody(PropertyUtils.PROPERTY_UNIQUE_KEY_KEY, null); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_CREATED, response.getStatusCode()); // Property取得 - req = DcRequest.get(locationUrlGet + "?$orderby=__published+desc"); + req = PersoniumRequest.get(locationUrlGet + "?$orderby=__published+desc"); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse resGet = request(req); + PersoniumResponse resGet = request(req); // レスポンスチェック assertEquals(HttpStatus.SC_OK, resGet.getStatusCode()); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyListViaNPTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyListViaNPTest.java similarity index 89% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyListViaNPTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyListViaNPTest.java index e969482f6..0ee327594 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyListViaNPTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyListViaNPTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.property; +package io.personium.test.jersey.box.odatacol.schema.property; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -31,22 +31,22 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.model.ctl.Property; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.TResponse; /** * PropertyNP経由一覧取得のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class PropertyListViaNPTest extends ODataCommon { @@ -60,7 +60,7 @@ public class PropertyListViaNPTest extends ODataCommon { * コンストラクタ. */ public PropertyListViaNPTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyUpdateTest.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyUpdateTest.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyUpdateTest.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyUpdateTest.java index e882d4dd9..18bdcd637 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyUpdateTest.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyUpdateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.property; +package io.personium.test.jersey.box.odatacol.schema.property; import static org.junit.Assert.assertEquals; @@ -30,38 +30,38 @@ import org.junit.runner.RunWith; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.Property; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; import com.sun.jersey.test.framework.WebAppDescriptor; /** * Property更新のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class PropertyUpdateTest extends ODataCommon { private static final Map INIT_PARAMS = new HashMap(); static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } /** @@ -109,7 +109,7 @@ public PropertyUpdateTest() { entityTypeName); // Property更新 - DcResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, + PersoniumResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, entityTypeName, propertyName, entityTypeName, EdmSimpleType.DOUBLE.getFullyQualifiedTypeName(), nullable, defaultValue, @@ -205,7 +205,7 @@ public PropertyUpdateTest() { entityTypeName); // Property更新 - DcResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, + PersoniumResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyNameToBeUpdated, entityTypeName, propertyNameToBeUpdated, entityTypeName, EdmSimpleType.DOUBLE.getFullyQualifiedTypeName(), nullable, defaultValue, @@ -286,7 +286,7 @@ public PropertyUpdateTest() { uniqueKey, HttpStatus.SC_CREATED); // Property更新 - DcResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, + PersoniumResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, entityTypeName, propertyName, entityTypeName, EdmSimpleType.DOUBLE.getFullyQualifiedTypeName(), nullable, defaultValue, @@ -294,8 +294,8 @@ public PropertyUpdateTest() { isKey, uniqueKey); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - ODataCommon.checkErrorResponseBody(response, DcCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), - DcCoreException.OData.OPERATION_NOT_SUPPORTED + ODataCommon.checkErrorResponseBody(response, PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED .params("Property 'Type' change from [Edm.String] to [Edm.Double]").getMessage()); // Propertyが更新されていないことの確認 @@ -351,7 +351,7 @@ public PropertyUpdateTest() { uniqueKey, HttpStatus.SC_CREATED); // Property更新 - DcResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, + PersoniumResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, entityTypeName, propertyName, entityTypeName, EdmSimpleType.SINGLE.getFullyQualifiedTypeName(), nullable, defaultValue, @@ -359,8 +359,8 @@ public PropertyUpdateTest() { isKey, uniqueKey); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - ODataCommon.checkErrorResponseBody(response, DcCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), - DcCoreException.OData.OPERATION_NOT_SUPPORTED + ODataCommon.checkErrorResponseBody(response, PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED .params("Property 'Type' change from [Edm.Int32] to [Edm.Single]").getMessage()); // Propertyが更新されていないことの確認 @@ -421,12 +421,12 @@ public PropertyUpdateTest() { body.put("Name", propertyName); body.put("_EntityType.Name", entityTypeName); - DcResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, + PersoniumResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, entityTypeName, body); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - ODataCommon.checkErrorResponseBody(response, DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("Type").getMessage()); + ODataCommon.checkErrorResponseBody(response, PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("Type").getMessage()); // Propertyが更新されていないことの確認 response = PropertyUtils.get(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, @@ -486,12 +486,12 @@ public PropertyUpdateTest() { body.put("_EntityType.Name", entityTypeName); body.put("Type", EdmSimpleType.DOUBLE.getFullyQualifiedTypeName()); - DcResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, + PersoniumResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, entityTypeName, body); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - ODataCommon.checkErrorResponseBody(response, DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("Name").getMessage()); + ODataCommon.checkErrorResponseBody(response, PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("Name").getMessage()); // Propertyが更新されていないことの確認 response = PropertyUtils.get(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, @@ -552,7 +552,7 @@ public PropertyUpdateTest() { entityTypeName); // Property更新 - DcResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, + PersoniumResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, entityTypeName, propertyReName, entityTypeName, EdmSimpleType.DOUBLE.getFullyQualifiedTypeName(), nullable, defaultValue, @@ -640,7 +640,7 @@ public PropertyUpdateTest() { entityTypeName); // Property更新 - DcResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, + PersoniumResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, entityTypeName, propertyReName, entityTypeName, EdmSimpleType.DOUBLE.getFullyQualifiedTypeName(), nullable, defaultValue, @@ -725,7 +725,7 @@ public PropertyUpdateTest() { .create(cellName, MASTER_TOKEN_NAME, boxName, colName, entityTypeName, HttpStatus.SC_CREATED); // Property更新 - DcResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, + PersoniumResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, entityTypeName, propertyReName, entityTypeName, EdmSimpleType.DOUBLE.getFullyQualifiedTypeName(), nullable, defaultValue, @@ -769,7 +769,7 @@ public PropertyUpdateTest() { uniqueKey, HttpStatus.SC_CREATED); // Property更新 - DcResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, + PersoniumResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, entityTypeName, propertyReName, entityTypeName, EdmSimpleType.INT32.getFullyQualifiedTypeName(), nullable, defaultValue, @@ -833,12 +833,12 @@ public PropertyUpdateTest() { body.put("Name", propertyName); body.put("Type", EdmSimpleType.DOUBLE.getFullyQualifiedTypeName()); - DcResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, + PersoniumResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, entityTypeName, body); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - ODataCommon.checkErrorResponseBody(response, DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("_EntityType.Name").getMessage()); + ODataCommon.checkErrorResponseBody(response, PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params("_EntityType.Name").getMessage()); // Propertyが更新されていないことの確認 response = PropertyUtils.get(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, @@ -896,7 +896,7 @@ public PropertyUpdateTest() { HttpStatus.SC_CREATED); // Property更新 - DcResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, + PersoniumResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, entityTypeName, propertyName, invalidEntityTypeName, EdmSimpleType.DOUBLE.getFullyQualifiedTypeName(), nullable, defaultValue, @@ -904,8 +904,8 @@ public PropertyUpdateTest() { isKey, uniqueKey); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - ODataCommon.checkErrorResponseBody(response, DcCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), - DcCoreException.OData.OPERATION_NOT_SUPPORTED + ODataCommon.checkErrorResponseBody(response, PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED .params("Property '_EntityType.Name' change") .getMessage()); @@ -964,15 +964,15 @@ public PropertyUpdateTest() { entityTypeName); // Property更新 - DcResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, + PersoniumResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, entityTypeName, propertyReName, entityTypeName, EdmSimpleType.DOUBLE.getFullyQualifiedTypeName(), nullable, defaultValue, collectionKind, isKey, uniqueKey); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - ODataCommon.checkErrorResponseBody(response, DcCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), - DcCoreException.OData.OPERATION_NOT_SUPPORTED + ODataCommon.checkErrorResponseBody(response, PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED .params("Property 'IsDeclared' change from [false] to [true]").getMessage()); // Propertyが更新されていないことの確認 @@ -1027,7 +1027,7 @@ public PropertyUpdateTest() { uniqueKey, HttpStatus.SC_CREATED); // Property更新 - DcResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, + PersoniumResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, entityTypeName, propertyName, entityTypeName, EdmSimpleType.DOUBLE.getFullyQualifiedTypeName(), false, defaultValue, @@ -1035,8 +1035,8 @@ public PropertyUpdateTest() { isKey, uniqueKey); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - ODataCommon.checkErrorResponseBody(response, DcCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), - DcCoreException.OData.OPERATION_NOT_SUPPORTED + ODataCommon.checkErrorResponseBody(response, PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED .params("Property 'Nullable' change from [true] to [false]").getMessage()); // Propertyが更新されていないことの確認 @@ -1101,7 +1101,7 @@ public PropertyUpdateTest() { body.put("IsKey", isKey); body.put("UniqueKey", uniqueKey); - DcResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, + PersoniumResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, entityTypeName, body); assertEquals(HttpStatus.SC_NO_CONTENT, response.getStatusCode()); @@ -1168,12 +1168,12 @@ public PropertyUpdateTest() { body.put("IsKey", isKey); body.put("UniqueKey", uniqueKey); - DcResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, + PersoniumResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, entityTypeName, body); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - ODataCommon.checkErrorResponseBody(response, DcCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), - DcCoreException.OData.OPERATION_NOT_SUPPORTED + ODataCommon.checkErrorResponseBody(response, PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED .params("Property 'Nullable' change from [false] to [true]").getMessage()); // Property更新されていないことの確認 @@ -1228,15 +1228,15 @@ public PropertyUpdateTest() { uniqueKey, HttpStatus.SC_CREATED); // Property更新 - DcResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, + PersoniumResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, entityTypeName, propertyName, entityTypeName, EdmSimpleType.DOUBLE.getFullyQualifiedTypeName(), nullable, 12345, collectionKind, isKey, uniqueKey); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - ODataCommon.checkErrorResponseBody(response, DcCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), - DcCoreException.OData.OPERATION_NOT_SUPPORTED + ODataCommon.checkErrorResponseBody(response, PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED .params("Property 'DefaultValue' change from [null] to [12345]").getMessage()); // Propertyが更新されていないことの確認 @@ -1301,7 +1301,7 @@ public PropertyUpdateTest() { body.put("IsKey", isKey); body.put("UniqueKey", uniqueKey); - DcResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, + PersoniumResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, entityTypeName, body); assertEquals(HttpStatus.SC_NO_CONTENT, response.getStatusCode()); @@ -1368,12 +1368,12 @@ public PropertyUpdateTest() { body.put("IsKey", isKey); body.put("UniqueKey", uniqueKey); - DcResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, + PersoniumResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, entityTypeName, body); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - ODataCommon.checkErrorResponseBody(response, DcCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), - DcCoreException.OData.OPERATION_NOT_SUPPORTED + ODataCommon.checkErrorResponseBody(response, PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED .params("Property 'DefaultValue' change from [12345] to [null]").getMessage()); // Property更新されていないことの確認 @@ -1428,15 +1428,15 @@ public PropertyUpdateTest() { uniqueKey, HttpStatus.SC_CREATED); // Property更新 - DcResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, + PersoniumResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, entityTypeName, propertyName, entityTypeName, EdmSimpleType.DOUBLE.getFullyQualifiedTypeName(), nullable, defaultValue, "List", isKey, uniqueKey); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - ODataCommon.checkErrorResponseBody(response, DcCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), - DcCoreException.OData.OPERATION_NOT_SUPPORTED + ODataCommon.checkErrorResponseBody(response, PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED .params("Property 'CollectionKind' change from [None] to [List]").getMessage()); // Propertyが更新されていないことの確認 @@ -1501,7 +1501,7 @@ public PropertyUpdateTest() { body.put("IsKey", isKey); body.put("UniqueKey", uniqueKey); - DcResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, + PersoniumResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, entityTypeName, body); assertEquals(HttpStatus.SC_NO_CONTENT, response.getStatusCode()); @@ -1568,12 +1568,12 @@ public PropertyUpdateTest() { body.put("IsKey", isKey); body.put("UniqueKey", uniqueKey); - DcResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, + PersoniumResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, entityTypeName, body); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - ODataCommon.checkErrorResponseBody(response, DcCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), - DcCoreException.OData.OPERATION_NOT_SUPPORTED + ODataCommon.checkErrorResponseBody(response, PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED .params("Property 'CollectionKind' change from [List] to [None]").getMessage()); // Property更新されていないことの確認 @@ -1628,7 +1628,7 @@ public PropertyUpdateTest() { uniqueKey, HttpStatus.SC_CREATED); // Property更新 - DcResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, + PersoniumResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, entityTypeName, propertyName, entityTypeName, EdmSimpleType.DOUBLE.getFullyQualifiedTypeName(), nullable, defaultValue, @@ -1636,8 +1636,8 @@ public PropertyUpdateTest() { true, uniqueKey); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - ODataCommon.checkErrorResponseBody(response, DcCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), - DcCoreException.OData.OPERATION_NOT_SUPPORTED + ODataCommon.checkErrorResponseBody(response, PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED .params("Property 'IsKey' change from [false] to [true]").getMessage()); // Propertyが更新されていないことの確認 @@ -1702,7 +1702,7 @@ public PropertyUpdateTest() { body.put("Nullable", nullable); body.put("UniqueKey", uniqueKey); - DcResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, + PersoniumResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, entityTypeName, body); assertEquals(HttpStatus.SC_NO_CONTENT, response.getStatusCode()); @@ -1769,12 +1769,12 @@ public PropertyUpdateTest() { body.put("Nullable", nullable); body.put("UniqueKey", uniqueKey); - DcResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, + PersoniumResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, entityTypeName, body); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - ODataCommon.checkErrorResponseBody(response, DcCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), - DcCoreException.OData.OPERATION_NOT_SUPPORTED + ODataCommon.checkErrorResponseBody(response, PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED .params("Property 'IsKey' change from [true] to [false]").getMessage()); // Property更新されていないことの確認 @@ -1829,7 +1829,7 @@ public PropertyUpdateTest() { uniqueKey, HttpStatus.SC_CREATED); // Property更新 - DcResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, + PersoniumResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, entityTypeName, propertyName, entityTypeName, EdmSimpleType.DOUBLE.getFullyQualifiedTypeName(), nullable, defaultValue, @@ -1837,8 +1837,8 @@ public PropertyUpdateTest() { isKey, "PropertyTest"); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - ODataCommon.checkErrorResponseBody(response, DcCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), - DcCoreException.OData.OPERATION_NOT_SUPPORTED + ODataCommon.checkErrorResponseBody(response, PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED .params("Property 'UniqueKey' change from [null] to [PropertyTest]").getMessage()); // Propertyが更新されていないことの確認 @@ -1903,7 +1903,7 @@ public PropertyUpdateTest() { body.put("IsKey", isKey); body.put("Nullable", nullable); - DcResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, + PersoniumResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, entityTypeName, body); assertEquals(HttpStatus.SC_NO_CONTENT, response.getStatusCode()); @@ -1970,12 +1970,12 @@ public PropertyUpdateTest() { body.put("IsKey", isKey); body.put("Nullable", nullable); - DcResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, + PersoniumResponse response = PropertyUtils.update(AbstractCase.MASTER_TOKEN_NAME, cellName, boxName, colName, propertyName, entityTypeName, body); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); - ODataCommon.checkErrorResponseBody(response, DcCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), - DcCoreException.OData.OPERATION_NOT_SUPPORTED + ODataCommon.checkErrorResponseBody(response, PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED.getCode(), + PersoniumCoreException.OData.OPERATION_NOT_SUPPORTED .params("Property 'UniqueKey' change from [PropertyTest] to [null]").getMessage()); // Property更新されていないことの確認 diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyUtils.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyUtils.java similarity index 88% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyUtils.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyUtils.java index 8e1751a00..feee2d1d1 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/PropertyUtils.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/property/PropertyUtils.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.property; +package io.personium.test.jersey.box.odatacol.schema.property; import static org.junit.Assert.assertEquals; @@ -23,18 +23,18 @@ import org.apache.http.HttpHeaders; import org.json.simple.JSONObject; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.auth.OAuth2Helper; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.model.ctl.EntityType; -import com.fujitsu.dc.core.model.ctl.Property; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.auth.OAuth2Helper; +import io.personium.core.model.ctl.Common; +import io.personium.core.model.ctl.EntityType; +import io.personium.core.model.ctl.Property; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * PropertyUtils. @@ -121,7 +121,7 @@ public static TResponse createViaPropertyNP( .with("collection", collection) .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("entityType", "EntityType") .with("id", entityTypeName) .with("navPropName", "_Property") @@ -177,14 +177,14 @@ public static TResponse listViaPropertyNP( * @param code 期待するレスポンスコード * @return レスポンス */ - public static DcResponse create( + public static PersoniumResponse create( String token, String cell, String box, String collection, String entityTypeName, String propertyName, String type, boolean nullable, Object defaultValue, String collectionKind, boolean isKey, String uniqueKey, int code) { String url = UrlUtils.property(cell, box, collection, null, null); - DcRequest req = DcRequest.post(url); + PersoniumRequest req = PersoniumRequest.post(url); req.header(HttpHeaders.AUTHORIZATION, token); req.addJsonBody(PROPERTY_NAME_KEY, propertyName); req.addJsonBody(PROPERTY_ENTITYTYPE_NAME_KEY, entityTypeName); @@ -196,7 +196,7 @@ public static DcResponse create( req.addJsonBody(PROPERTY_UNIQUE_KEY_KEY, uniqueKey); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); if (code != -1) { assertEquals(code, response.getStatusCode()); } @@ -227,12 +227,12 @@ public static String composeLocationUrl(String cell, String box, String collecti * @param entityTypeName EntityType名 * @return レスポンス */ - public static DcResponse get(String token, String cell, String box, + public static PersoniumResponse get(String token, String cell, String box, String collection, String propertyName, String entityTypeName) { String locationUrl = UrlUtils.property(cell, box, collection, propertyName, entityTypeName); // Property取得 - DcRequest req = DcRequest.get(locationUrl); + PersoniumRequest req = PersoniumRequest.get(locationUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, OAuth2Helper.Scheme.BEARER + " " + token); return AbstractCase.request(req); @@ -246,7 +246,7 @@ public static DcResponse get(String token, String cell, String box, * @param collection コレクション名 * @return レスポンス */ - public static DcResponse list( + public static PersoniumResponse list( String token, String cell, String box, @@ -263,7 +263,7 @@ public static DcResponse list( * @param query クエリ * @return レスポンス */ - public static DcResponse list( + public static PersoniumResponse list( String token, String cell, String box, @@ -275,7 +275,7 @@ public static DcResponse list( } // Property取得 - DcRequest req = DcRequest.get(locationUrl); + PersoniumRequest req = PersoniumRequest.get(locationUrl); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); req.header(HttpHeaders.AUTHORIZATION, OAuth2Helper.Scheme.BEARER + " " + token); return AbstractCase.request(req); @@ -301,7 +301,7 @@ public static DcResponse list( * @return レスポンス */ @SuppressWarnings("unchecked") - public static DcResponse update( + public static PersoniumResponse update( String token, String cell, String box, String collection, String srcPropertyName, String srcEntityTypeName, String propertyName, @@ -334,13 +334,13 @@ public static DcResponse update( * @param body リクエストボディ * @return レスポンス */ - public static DcResponse update( + public static PersoniumResponse update( String token, String cell, String box, String collection, String srcPropertyName, String srcEntityTypeName, JSONObject body) { // リクエストパラメータ設定 - DcRequest req = DcRequest.put(UrlUtils.property(cell, box, collection, + PersoniumRequest req = PersoniumRequest.put(UrlUtils.property(cell, box, collection, srcPropertyName, srcEntityTypeName)); req.header(HttpHeaders.AUTHORIZATION, OAuth2Helper.Scheme.BEARER + " " + token); req.header(HttpHeaders.IF_MATCH, "*"); @@ -362,16 +362,16 @@ public static DcResponse update( * @param code 期待するレスポンスコード * @return レスポンス */ - public static DcResponse delete( + public static PersoniumResponse delete( String token, String cell, String box, String collection, String entityTypeName, String propertyName, int code) { String url = UrlUtils.property(cell, box, collection, propertyName, entityTypeName); - DcRequest req = DcRequest.delete(url); + PersoniumRequest req = PersoniumRequest.delete(url); req.header(HttpHeaders.AUTHORIZATION, token); // リクエスト実行 - DcResponse response = AbstractCase.request(req); + PersoniumResponse response = AbstractCase.request(req); if (code != -1) { assertEquals(code, response.getStatusCode()); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/package-info.java b/src/test/java/io/personium/test/jersey/box/odatacol/schema/property/package-info.java similarity index 88% rename from src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/package-info.java rename to src/test/java/io/personium/test/jersey/box/odatacol/schema/property/package-info.java index 99d89e00e..286e9dd43 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/odatacol/schema/property/package-info.java +++ b/src/test/java/io/personium/test/jersey/box/odatacol/schema/property/package-info.java @@ -17,5 +17,5 @@ /** * Property CRUD test. */ -package com.fujitsu.dc.test.jersey.box.odatacol.schema.property; +package io.personium.test.jersey.box.odatacol.schema.property; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/package-info.java b/src/test/java/io/personium/test/jersey/box/package-info.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/box/package-info.java rename to src/test/java/io/personium/test/jersey/box/package-info.java index 31646bb3c..ee2d80b1a 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/package-info.java +++ b/src/test/java/io/personium/test/jersey/box/package-info.java @@ -18,4 +18,4 @@ elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED ) -package com.fujitsu.dc.test.jersey.box; +package io.personium.test.jersey.box; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/box/package-infoMeta.java b/src/test/java/io/personium/test/jersey/box/package-infoMeta.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/box/package-infoMeta.java rename to src/test/java/io/personium/test/jersey/box/package-infoMeta.java index 1e0ea6c0c..cc0e9f22e 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/box/package-infoMeta.java +++ b/src/test/java/io/personium/test/jersey/box/package-infoMeta.java @@ -17,5 +17,5 @@ /** * Box 以下の test. */ -package com.fujitsu.dc.test.jersey.box; +package io.personium.test.jersey.box; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/AclTest.java b/src/test/java/io/personium/test/jersey/cell/AclTest.java similarity index 86% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/AclTest.java rename to src/test/java/io/personium/test/jersey/cell/AclTest.java index 27a1f9ba9..7eebca7ce 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/AclTest.java +++ b/src/test/java/io/personium/test/jersey/cell/AclTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell; +package io.personium.test.jersey.cell; import static org.junit.Assert.assertTrue; @@ -31,37 +31,38 @@ import org.w3c.dom.Element; import org.w3c.dom.NodeList; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.ctl.Account; -import com.fujitsu.dc.core.model.ctl.ExtCell; -import com.fujitsu.dc.core.model.ctl.Relation; -import com.fujitsu.dc.core.model.ctl.Role; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.bar.BarInstallTestUtils; -import com.fujitsu.dc.test.jersey.cell.ctl.BoxCrudTest; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.ExtCellUtils; -import com.fujitsu.dc.test.utils.ExtRoleUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.ReceivedMessageUtils; -import com.fujitsu.dc.test.utils.RelationUtils; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.SentMessageUtils; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.TestMethodUtils; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.auth.OAuth2Helper; +import io.personium.core.model.Box; +import io.personium.core.model.ctl.Account; +import io.personium.core.model.ctl.ExtCell; +import io.personium.core.model.ctl.Relation; +import io.personium.core.model.ctl.Role; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.bar.BarInstallTestUtils; +import io.personium.test.jersey.cell.ctl.BoxCrudTest; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.ExtCellUtils; +import io.personium.test.utils.ExtRoleUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.ReceivedMessageUtils; +import io.personium.test.utils.RelationUtils; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.SentMessageUtils; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.TestMethodUtils; import com.sun.jersey.test.framework.WebAppDescriptor; /** @@ -73,11 +74,11 @@ public class AclTest extends AbstractCase { private static final Map INIT_PARAMS = new HashMap(); static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } static final String TEST_CELL1 = Setup.TEST_CELL1; @@ -117,12 +118,13 @@ public AclTest() { List rolList = new ArrayList(); rolList.add("auth"); rolList.add("auth-read"); + rolList.add("read"); map.put(TEST_ROLE1, rolList); list.add(map); List rolList2 = new ArrayList(); Map> map2 = new HashMap>(); - rolList2.add("auth"); + rolList2.add("root"); map2.put(TEST_ROLE2, rolList2); list.add(map2); String resorce = UrlUtils.cellRoot(TEST_CELL1); @@ -145,6 +147,228 @@ public AclTest() { } } + /** + * CellとBoxのACLを設定しBoxにアクセスできることを確認テスト. + */ + @Test + public final void CellとBoxにBoxレベルACLを設定しBoxにアクセスできることを確認() { + String testBox1 = "testAclBox"; + + try { + // CellのACL設定 role4を含むACLをtestcell1 + Http.request("cell/acl-setting-cell-box.txt") + .with("url", TEST_CELL1) + .with("token", TOKEN) + .with("role1", TEST_ROLE1) + .with("role2", TEST_ROLE2) + .with("roleBaseUrl", UrlUtils.roleResource(TEST_CELL1, null, "")).returns() + .statusCode(HttpStatus.SC_OK); + + // 設定の確認 PROPFINDでtestcell1のACLを取得 + TResponse tresponse = Http.request("cell/propfind-cell-allprop.txt") + .with("url", TEST_CELL1) + .with("depth", "0") + .with("token", TOKEN) + .returns(); + tresponse.statusCode(HttpStatus.SC_MULTI_STATUS); + + // PROPFOINDレスポンスボディの確認 + List>> list = new ArrayList>>(); + Map> map1 = new HashMap>(); + List rolList1 = new ArrayList(); + rolList1.add("auth"); + rolList1.add("auth-read"); + rolList1.add("read"); + map1.put(TEST_ROLE1, rolList1); + list.add(map1); + + List rolList2 = new ArrayList(); + Map> map2 = new HashMap>(); + rolList2.add("root"); + map2.put(TEST_ROLE2, rolList2); + list.add(map2); + String resorce = UrlUtils.cellRoot(TEST_CELL1); + Element root = tresponse.bodyAsXml().getDocumentElement(); + + StringBuffer sb = new StringBuffer(resorce); + sb.deleteCharAt(resorce.length() - 1); + TestMethodUtils.aclResponseTest(root, sb.toString(), list, 1, + UrlUtils.roleResource(TEST_CELL1, Box.DEFAULT_BOX_NAME, ""), null); + + // Boxの作成 + BoxUtils.create(TEST_CELL1, testBox1, TOKEN); + + // ACLをbox1に設定すればできるのは従来からの機能 + // Principal:all Privilege:read + // Principal:role1 Privilege:write + setAclAllandRole(TEST_CELL1, TOKEN, HttpStatus.SC_OK, TEST_CELL1 + "/" + testBox1, + "box/acl-setting-all-role.txt", "role1", "", "", ""); + + // PROPFINDでACLの確認 + CellUtils.propfind(TEST_CELL1 + "/" + testBox1, TOKEN, "0", HttpStatus.SC_MULTI_STATUS); + + // 認証 + JSONObject json = ResourceUtils.getLocalTokenByPassAuth(TEST_CELL1, "account1", "password1", -1); + // トークン取得 + String tokenStr = (String) json.get(OAuth2Helper.Key.ACCESS_TOKEN); + + // account1でbox1を操作 + // リソースを取得 Box1に対してGET + ResourceUtils.accessResource("", tokenStr, HttpStatus.SC_OK, testBox1, TEST_CELL1); + + // コレクションの作成 Box1に対してPUT + DavResourceUtils.createWebDavFile(TEST_CELL1, tokenStr, "box/dav-put.txt", "hoge", testBox1, + "text.txt", HttpStatus.SC_CREATED); + + } finally { + // コレクションの削除 + DavResourceUtils.deleteWebDavFile("box/dav-delete.txt", TEST_CELL1, TOKEN, "text.txt", -1, testBox1); + + // Box1の削除 + BoxUtils.delete(TEST_CELL1, TOKEN, testBox1); + + // Box ACLの設定を元に戻す + Http.request("box/acl-authtest.txt") + .with("cellPath", TEST_CELL1) + .with("colname", "") + .with("roleBaseUrl", UrlUtils.roleResource(TEST_CELL1, null, "")) + .with("token", TOKEN) + .with("level", "") + .returns() + .statusCode(HttpStatus.SC_OK); + + // Cell ACLの設定を元に戻す + Http.request("cell/acl-default.txt").with("url", TEST_CELL1) + .with("token", TOKEN) + .with("role1", TEST_ROLE1) + .with("role2", TEST_ROLE2) + .with("box", testBox1) + .with("roleBaseUrl", UrlUtils.roleResource(TEST_CELL1, null, "")) + .with("level", "") + .returns() + .statusCode(HttpStatus.SC_OK); + } + } + + /** + * CellにBoxレベルACLを設定しBoxにアクセスできることを確認. + */ + @Test + public final void CellにBoxレベルACLを設定しBoxにアクセスできることを確認() { + String testBox1 = "testNoAclBox"; + String testRole1 = "role1"; + String testRole2 = "role2"; + + try { + // role4,role5を含むACLをtestcell1に設定 + Http.request("cell/acl-setting-cell-none-box.txt") + .with("url", TEST_CELL1) + .with("token", TOKEN) + .with("role1", testRole1) + .with("role2", testRole2) + .with("roleBaseUrl", UrlUtils.roleResource(TEST_CELL1, null, "")).returns() + .statusCode(HttpStatus.SC_OK); + + // PROPFINDでtestcell1のACLを取得 + TResponse tresponse = Http.request("cell/propfind-cell-allprop.txt") + .with("url", TEST_CELL1) + .with("depth", "0") + .with("token", TOKEN) + .returns(); + tresponse.statusCode(HttpStatus.SC_MULTI_STATUS); + + // PROPFOINDレスポンスボディの確認 + List>> list = new ArrayList>>(); + Map> map1 = new HashMap>(); + List rolList1 = new ArrayList(); + rolList1.add("auth"); + rolList1.add("auth-read"); + rolList1.add("read"); + rolList1.add("write"); + map1.put(testRole1, rolList1); + list.add(map1); + + List rolList2 = new ArrayList(); + Map> map2 = new HashMap>(); + rolList2.add("root"); + map2.put(testRole2, rolList2); + list.add(map2); + String resorce = UrlUtils.cellRoot(TEST_CELL1); + Element root = tresponse.bodyAsXml().getDocumentElement(); + + StringBuffer sb = new StringBuffer(resorce); + sb.deleteCharAt(resorce.length() - 1); + TestMethodUtils.aclResponseTest(root, sb.toString(), list, 1, + UrlUtils.roleResource(TEST_CELL1, Box.DEFAULT_BOX_NAME, ""), null); + + // Boxの作成 + BoxUtils.create(TEST_CELL1, testBox1, TOKEN); + + // 認証 + JSONObject json = ResourceUtils.getLocalTokenByPassAuth(TEST_CELL1, "account1", "password1", -1); + // トークン取得 + String tokenStr = (String) json.get(OAuth2Helper.Key.ACCESS_TOKEN); + + // account1でbox1を操作 + // リソースを取得 Box1に対してGET + ResourceUtils.accessResource("", tokenStr, HttpStatus.SC_OK, testBox1, TEST_CELL1); + + // リソースの作成 Box1に対してPUT + DavResourceUtils.createWebDavFile(TEST_CELL1, tokenStr, "box/dav-put.txt", "hoge", testBox1, + "text.txt", HttpStatus.SC_CREATED); + + } finally { + // リソースの削除 + DavResourceUtils.deleteWebDavFile("box/dav-delete.txt", TEST_CELL1, TOKEN, "text.txt", -1, testBox1); + + // Box1の削除 + BoxUtils.delete(TEST_CELL1, TOKEN, testBox1); + + // Cell ACLの設定を元に戻す + Http.request("cell/acl-default.txt").with("url", TEST_CELL1) + .with("token", TOKEN) + .with("role1", TEST_ROLE1) + .with("role2", TEST_ROLE2) + .with("box", testBox1) + .with("roleBaseUrl", UrlUtils.roleResource(TEST_CELL1, null, "")) + .with("level", "") + .returns() + .statusCode(HttpStatus.SC_OK); + } + } + + /** + * ACL設定. + * @param cell セル名 + * @param token トークン + * @param code 期待するレスポンスコード + * @param path 対象のコレクションのパス + * @param settingFile ACLリクエストファイル + * @param role ACLに設定するPrincipal(Role) + * @param privilege1 ACLに設定する権限1 + * @param privilege2 ACLに設定する権限2 + * @param level スキーマ認証level + * @return レスポンス + */ + private static TResponse setAclAllandRole(String cell, String token, int code, String path, + String settingFile, String role, String privilege1, String privilege2, String level) { + TResponse tresponseWebDav = null; + // ACLの設定 + tresponseWebDav = Http.request(settingFile) + .with("cellPath", cell) + .with("colname", path) + .with("token", token) + .with("role", role) + .with("privilege1", privilege1) + .with("privilege2", privilege2) + .with("roleBaseUrl", UrlUtils.roleResource(cell, null, "")) + .with("level", level) + .returns() + .statusCode(code); + return tresponseWebDav; + } + + /** * 既にBoxに紐づかない同名のRoleが存在する状態でBoxに紐づかないRoleでのCellレベルACL設定の確認テスト. */ @@ -251,12 +475,13 @@ public AclTest() { List rolList = new ArrayList(); rolList.add("auth"); rolList.add("auth-read"); + rolList.add("read"); map.put(TEST_ROLE1, rolList); list.add(map); List rolList2 = new ArrayList(); Map> map2 = new HashMap>(); - rolList2.add("auth"); + rolList2.add("root"); map2.put(TEST_ROLE2, rolList2); list.add(map2); String resorce = UrlUtils.cellRoot(TEST_CELL1); @@ -287,12 +512,13 @@ public AclTest() { rolList = new ArrayList(); rolList.add("auth"); rolList.add("auth-read"); + rolList.add("read"); map.put(TEST_ROLE1, rolList); list.add(map); rolList2 = new ArrayList(); map2 = new HashMap>(); - rolList2.add("auth"); + rolList2.add("root"); map2.put(TEST_ROLE2, rolList2); list.add(map2); resorce = UrlUtils.cellRoot(TEST_CELL1); @@ -350,12 +576,13 @@ public AclTest() { List rolList = new ArrayList(); rolList.add("auth"); rolList.add("auth-read"); + rolList.add("read"); map.put(TEST_ROLE1, rolList); list.add(map); List rolList2 = new ArrayList(); Map> map2 = new HashMap>(); - rolList2.add("auth"); + rolList2.add("root"); map2.put(TEST_ROLE2, rolList2); list.add(map2); String resorce = UrlUtils.cellRoot(TEST_CELL1); @@ -643,7 +870,7 @@ public AclTest() { // 削除 ResourceUtils.linksDelete(TEST_CELL1, Relation.EDM_TYPE_NAME, relationName, "null", ExtCell.EDM_TYPE_NAME, - "'" + DcCoreUtils.encodeUrlComp(UrlUtils.cellRoot(Setup.TEST_CELL2) + "'"), account.get(10)); + "'" + PersoniumCoreUtils.encodeUrlComp(UrlUtils.cellRoot(Setup.TEST_CELL2) + "'"), account.get(10)); // $link extCellとrole→SOCIALとAUTHの権限が必要 ResourceUtils.linksWithBody(TEST_CELL1, Role.EDM_TYPE_NAME, "role1", @@ -661,7 +888,7 @@ public AclTest() { // 削除 ResourceUtils.linkExtCellRoleDelete(Setup.TEST_CELL1, account.get(10), - DcCoreUtils.encodeUrlComp(UrlUtils.cellRoot(Setup.TEST_CELL2)), null, "role1"); + PersoniumCoreUtils.encodeUrlComp(UrlUtils.cellRoot(Setup.TEST_CELL2)), null, "role1"); } finally { // Relationの削除 RelationUtils.delete(TEST_CELL1, TOKEN, relationName, null, HttpStatus.SC_NO_CONTENT); @@ -694,7 +921,7 @@ public AclTest() { .with("roleBaseUrl", UrlUtils.roleResource(TEST_CELL1, null, "role")) .returns() .statusCode(HttpStatus.SC_NOT_FOUND); - DcCoreException expectedException = DcCoreException.Dav.CELL_NOT_FOUND; + PersoniumCoreException expectedException = PersoniumCoreException.Dav.CELL_NOT_FOUND; ODataCommon.checkErrorResponseBody(res, expectedException.getCode(), expectedException.getMessage()); } @@ -721,7 +948,7 @@ public AclTest() { String boxName = "noneLinkedBox"; try { // Roleと紐ついていないBoxを登録 - DcRequest req = DcRequest.post(UrlUtils.cellCtl(Setup.TEST_CELL1, "Box")); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(Setup.TEST_CELL1, "Box")); String[] key = {"Name" }; String[] value = {boxName }; req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN).addJsonBody(key, value); @@ -765,8 +992,8 @@ public AclTest() { .with("body", body) .returns() .statusCode(HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.Dav.XML_VALIDATE_ERROR.getCode(), - DcCoreException.Dav.XML_VALIDATE_ERROR.getMessage()); + res.checkErrorResponse(PersoniumCoreException.Dav.XML_VALIDATE_ERROR.getCode(), + PersoniumCoreException.Dav.XML_VALIDATE_ERROR.getMessage()); } /** @@ -837,7 +1064,7 @@ private List accountAuth() { result.add(ResourceUtils.getMyCellLocalToken(TEST_CELL1, "account18", "password18")); // 9 account19 AUTH+SOCIAL result.add(ResourceUtils.getMyCellLocalToken(TEST_CELL1, "account19", "password19")); - // 10 account20 ALL + // 10 account20 ROOT result.add(ResourceUtils.getMyCellLocalToken(TEST_CELL1, "account20", "password20")); // 11 account21 auth-read result.add(ResourceUtils.getMyCellLocalToken(TEST_CELL1, "account21", "password21")); @@ -1143,7 +1370,7 @@ private void receivedMessageTest(List account) { ReceivedMessageUtils.get(account.get(0), TEST_CELL1, HttpStatus.SC_FORBIDDEN, "acltest"); // MESSAGE ReceivedMessageUtils.get(account.get(2), TEST_CELL1, HttpStatus.SC_NOT_FOUND, "acltest"); - // ALL + // ROOT ReceivedMessageUtils.get(account.get(10), TEST_CELL1, HttpStatus.SC_NOT_FOUND, "acltest"); // message-read ReceivedMessageUtils.get(account.get(12), TEST_CELL1, HttpStatus.SC_NOT_FOUND, "acltest"); @@ -1153,7 +1380,7 @@ private void receivedMessageTest(List account) { ReceivedMessageUtils.list(account.get(0), TEST_CELL1, HttpStatus.SC_FORBIDDEN); // MESSAGE ReceivedMessageUtils.list(account.get(2), TEST_CELL1, HttpStatus.SC_OK); - // ALL + // ROOT ReceivedMessageUtils.list(account.get(10), TEST_CELL1, HttpStatus.SC_OK); // message-read ReceivedMessageUtils.list(account.get(12), TEST_CELL1, HttpStatus.SC_OK); @@ -1163,7 +1390,7 @@ private void receivedMessageTest(List account) { ReceivedMessageUtils.delete(account.get(0), TEST_CELL1, HttpStatus.SC_FORBIDDEN, "acltest"); // MESSAGE ReceivedMessageUtils.delete(account.get(2), TEST_CELL1, HttpStatus.SC_NOT_FOUND, "acltest"); - // ALL + // ROOT ReceivedMessageUtils.delete(account.get(10), TEST_CELL1, HttpStatus.SC_NOT_FOUND, "acltest"); // message-read ReceivedMessageUtils.delete(account.get(12), TEST_CELL1, HttpStatus.SC_FORBIDDEN, "acltest"); @@ -1182,7 +1409,7 @@ private void sentMessageTest(List account) { SentMessageUtils.sent(account.get(0), TEST_CELL1, message01, HttpStatus.SC_FORBIDDEN); // MESSAGE response1 = SentMessageUtils.sent(account.get(2), TEST_CELL1, message01, HttpStatus.SC_CREATED); - // ALL + // ROOT response2 = SentMessageUtils.sent(account.get(10), TEST_CELL1, message01, HttpStatus.SC_CREATED); // message-read SentMessageUtils.sent(account.get(12), TEST_CELL1, message01, HttpStatus.SC_FORBIDDEN); @@ -1192,7 +1419,7 @@ private void sentMessageTest(List account) { SentMessageUtils.get(account.get(0), TEST_CELL1, HttpStatus.SC_FORBIDDEN, "acltest"); // MESSAGE SentMessageUtils.get(account.get(2), TEST_CELL1, HttpStatus.SC_NOT_FOUND, "acltest"); - // ALL + // ROOT SentMessageUtils.get(account.get(10), TEST_CELL1, HttpStatus.SC_NOT_FOUND, "acltest"); // message-read SentMessageUtils.get(account.get(12), TEST_CELL1, HttpStatus.SC_NOT_FOUND, "acltest"); @@ -1202,7 +1429,7 @@ private void sentMessageTest(List account) { SentMessageUtils.list(account.get(0), TEST_CELL1, HttpStatus.SC_FORBIDDEN); // MESSAGE SentMessageUtils.list(account.get(2), TEST_CELL1, HttpStatus.SC_OK); - // ALL + // ROOT SentMessageUtils.list(account.get(10), TEST_CELL1, HttpStatus.SC_OK); // message-read SentMessageUtils.list(account.get(12), TEST_CELL1, HttpStatus.SC_OK); @@ -1212,7 +1439,7 @@ private void sentMessageTest(List account) { SentMessageUtils.delete(account.get(0), TEST_CELL1, HttpStatus.SC_FORBIDDEN, "acltest"); // MESSAGE SentMessageUtils.delete(account.get(2), TEST_CELL1, HttpStatus.SC_NOT_FOUND, "acltest"); - // ALL + // ROOT SentMessageUtils.delete(account.get(10), TEST_CELL1, HttpStatus.SC_NOT_FOUND, "acltest"); // message-read SentMessageUtils.delete(account.get(12), TEST_CELL1, HttpStatus.SC_FORBIDDEN, "acltest"); @@ -1253,7 +1480,7 @@ private void approvedMessageTest(List account) { ReceivedMessageUtils.read(account.get(12), TEST_CELL1, uuid, HttpStatus.SC_FORBIDDEN); // NG: social-read ReceivedMessageUtils.read(account.get(14), TEST_CELL1, uuid, HttpStatus.SC_FORBIDDEN); - // OK: ALL + // OK: ROOT apvRes1 = ReceivedMessageUtils.read(account.get(10), TEST_CELL1, uuid, HttpStatus.SC_NO_CONTENT); // OK: message apvRes2 = ReceivedMessageUtils.read(account.get(2), TEST_CELL1, uuid, HttpStatus.SC_NO_CONTENT); @@ -1276,7 +1503,7 @@ private void approvedMessageTest(List account) { // NG: social-read ReceivedMessageUtils.approve(account.get(14), TEST_CELL1, uuid, HttpStatus.SC_FORBIDDEN); - // OK: ALL + // OK: ROOT apvRes4 = ReceivedMessageUtils.approve(account.get(10), TEST_CELL1, uuid, HttpStatus.SC_NO_CONTENT); // Relation-ExtCell $links削除 ResourceUtils.linkExtCellRelationDelete(AbstractCase.MASTER_TOKEN_NAME, TEST_CELL1, @@ -1318,7 +1545,7 @@ private void approvedMessageTest(List account) { ReceivedMessageUtils.reject(account.get(12), TEST_CELL1, uuid, HttpStatus.SC_FORBIDDEN); // NG: social-read ReceivedMessageUtils.reject(account.get(14), TEST_CELL1, uuid, HttpStatus.SC_FORBIDDEN); - // OK: ALL + // OK: ROOT apvRes6 = ReceivedMessageUtils.reject(account.get(10), TEST_CELL1, uuid, HttpStatus.SC_NO_CONTENT); if (rcvRes3 != null) { @@ -1572,7 +1799,7 @@ private void barInstallAclTest(List account) { } try { - // ALL: 成功 + // ROOT: 成功 res = ResourceUtils.barInstall(account.get(10), TEST_CELL1, targetBoxName2, HttpStatus.SC_ACCEPTED); } finally { deleteBox(targetBoxName2, res.getHeader(HttpHeaders.LOCATION)); @@ -1704,7 +1931,7 @@ private void logListAclTest(List account) { // 作成した$linkの削除 ResourceUtils.linksDelete(TEST_CELL1, Relation.EDM_TYPE_NAME, relationName, "null", ExtCell.EDM_TYPE_NAME, - "'" + DcCoreUtils.encodeUrlComp(extCellUrl) + "'", account.get(10)); + "'" + PersoniumCoreUtils.encodeUrlComp(extCellUrl) + "'", account.get(10)); // 作成したExtCell削除 ExtCellUtils.delete(TOKEN, TEST_CELL1, extCellUrl, HttpStatus.SC_NO_CONTENT); @@ -1714,33 +1941,33 @@ private void logListAclTest(List account) { // extCellとrole→SOCIALとAUTHの権限が必要 CellUtils.createNp(post, TEST_CELL1, ExtCell.EDM_TYPE_NAME, - DcCoreUtils.encodeUrlComp(extCellUrl), + PersoniumCoreUtils.encodeUrlComp(extCellUrl), "_" + Role.EDM_TYPE_NAME, roleBody, account.get(0), HttpStatus.SC_FORBIDDEN); CellUtils.createNp(post, TEST_CELL1, ExtCell.EDM_TYPE_NAME, - DcCoreUtils.encodeUrlComp(extCellUrl), + PersoniumCoreUtils.encodeUrlComp(extCellUrl), "_" + Role.EDM_TYPE_NAME, roleBody, account.get(1), HttpStatus.SC_FORBIDDEN); CellUtils.createNp(post, TEST_CELL1, ExtCell.EDM_TYPE_NAME, - DcCoreUtils.encodeUrlComp(extCellUrl), + PersoniumCoreUtils.encodeUrlComp(extCellUrl), "_" + Role.EDM_TYPE_NAME, roleBody, account.get(4), HttpStatus.SC_FORBIDDEN); CellUtils.createNp(post, TEST_CELL1, ExtCell.EDM_TYPE_NAME, - DcCoreUtils.encodeUrlComp(extCellUrl), + PersoniumCoreUtils.encodeUrlComp(extCellUrl), "_" + Role.EDM_TYPE_NAME, roleBody, account.get(9), HttpStatus.SC_CREATED); // 作成した$linkの削除 ResourceUtils.linkExtCellRoleDelete(TEST_CELL1, TOKEN, - DcCoreUtils.encodeUrlComp(extCellUrl), null, roleName); + PersoniumCoreUtils.encodeUrlComp(extCellUrl), null, roleName); // Role削除 RoleUtils.delete(TEST_CELL1, TOKEN, null, roleName); CellUtils.createNp(post, TEST_CELL1, ExtCell.EDM_TYPE_NAME, - DcCoreUtils.encodeUrlComp(extCellUrl), + PersoniumCoreUtils.encodeUrlComp(extCellUrl), "_" + Role.EDM_TYPE_NAME, roleBody, account.get(10), HttpStatus.SC_CREATED); // 作成した$linkの削除 ResourceUtils.linkExtCellRoleDelete(TEST_CELL1, TOKEN, - DcCoreUtils.encodeUrlComp(extCellUrl), null, roleName); + PersoniumCoreUtils.encodeUrlComp(extCellUrl), null, roleName); // Role削除 RoleUtils.delete(TEST_CELL1, TOKEN, null, roleName); @@ -1748,7 +1975,7 @@ private void logListAclTest(List account) { // 作成した$linkの削除 ResourceUtils.linksDelete(TEST_CELL1, Relation.EDM_TYPE_NAME, relationName, "null", ExtCell.EDM_TYPE_NAME, - "'" + DcCoreUtils.encodeUrlComp(extCellUrl) + "'", TOKEN); + "'" + PersoniumCoreUtils.encodeUrlComp(extCellUrl) + "'", TOKEN); // ExtCell 削除 ExtCellUtils.delete(TOKEN, TEST_CELL1, extCellUrl, HttpStatus.SC_NO_CONTENT); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/AllTests.java b/src/test/java/io/personium/test/jersey/cell/AllTests.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/AllTests.java rename to src/test/java/io/personium/test/jersey/cell/AllTests.java index f31bbcc98..f1a1047f7 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/AllTests.java +++ b/src/test/java/io/personium/test/jersey/cell/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell; +package io.personium.test.jersey.cell; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/BoxUrlTest.java b/src/test/java/io/personium/test/jersey/cell/BoxUrlTest.java similarity index 84% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/BoxUrlTest.java rename to src/test/java/io/personium/test/jersey/cell/BoxUrlTest.java index 130a51ae5..0a90b462c 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/BoxUrlTest.java +++ b/src/test/java/io/personium/test/jersey/cell/BoxUrlTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell; +package io.personium.test.jersey.cell; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -29,42 +29,42 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreAuthzException; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.auth.OAuth2Helper; -import com.fujitsu.dc.core.utils.UriUtils; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcException; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRestAdapter; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.ResourceUtils; +import io.personium.core.PersoniumCoreAuthzException; +import io.personium.core.PersoniumCoreException; +import io.personium.core.auth.OAuth2Helper; +import io.personium.core.utils.UriUtils; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumException; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumRestAdapter; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.ResourceUtils; import com.sun.jersey.test.framework.WebAppDescriptor; /** * BoxURL取得 APIのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class BoxUrlTest extends ODataCommon { private static final Map INIT_PARAMS = new HashMap(); static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("javax.ws.rs.Application", - "com.fujitsu.dc.core.rs.DcCoreApplication"); + "io.personium.core.rs.PersoniumCoreApplication"); INIT_PARAMS.put("com.sun.jersey.config.feature.DisableWADL", "true"); @@ -83,8 +83,8 @@ public BoxUrlTest() { @Test public final void 指定したschemaのBoxURLが取得できること() { try { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); @@ -94,7 +94,7 @@ public BoxUrlTest() { requestheaders); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); assertEquals(UrlUtils.boxRoot(Setup.TEST_CELL1, Setup.TEST_BOX1), res.getFirstHeader(HttpHeaders.LOCATION)); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } } @@ -113,8 +113,8 @@ public BoxUrlTest() { UriUtils.SCHEME_UNIT_URI + Setup.TEST_CELL_SCHEMA1 + "/", HttpStatus.SC_NO_CONTENT); // テスト実施 - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); @@ -126,7 +126,7 @@ public BoxUrlTest() { assertEquals(UrlUtils.boxRoot(Setup.TEST_CELL1, Setup.TEST_BOX1), res.getFirstHeader(HttpHeaders.LOCATION)); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } finally { // Box Schema更新(元に戻す) @@ -143,8 +143,8 @@ public BoxUrlTest() { public final void schemaパラメタとしてlocalunitURLの指定でhttpURLをschemaとするBoxが取得できること() { try { // Setupを流用 - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); @@ -155,7 +155,7 @@ public BoxUrlTest() { assertEquals(HttpStatus.SC_OK, res.getStatusCode()); assertEquals(UrlUtils.boxRoot(Setup.TEST_CELL1, Setup.TEST_BOX1), res.getFirstHeader(HttpHeaders.LOCATION)); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } } @@ -167,8 +167,8 @@ public BoxUrlTest() { @Test public final void 指定したローカルユニットschemaのBoxURLが不正な場合にエラーで返却されること() { try { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); @@ -180,7 +180,7 @@ public BoxUrlTest() { res = rest.getAcceptEncodingGzip(boxUrl, requestheaders); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } } @@ -191,8 +191,8 @@ public BoxUrlTest() { @Test public final void BoxURL取得でPOST以外のメソッドを指定した場合に405が返却されること() { try { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); @@ -200,9 +200,9 @@ public BoxUrlTest() { res = rest.del(UrlUtils.boxUrl(Setup.TEST_CELL1, UrlUtils.cellRoot("boxUrlTestSchema")), requestheaders); assertEquals(HttpStatus.SC_METHOD_NOT_ALLOWED, res.getStatusCode()); - DcCoreException e = DcCoreException.Misc.METHOD_NOT_ALLOWED; + PersoniumCoreException e = PersoniumCoreException.Misc.METHOD_NOT_ALLOWED; checkErrorResponse(res.bodyAsJson(), e.getCode(), e.getMessage()); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } } @@ -213,17 +213,17 @@ public BoxUrlTest() { @Test public final void schemaが空指定の場合に400が返却されること() { try { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); res = rest.getAcceptEncodingGzip(UrlUtils.boxUrl(Setup.TEST_CELL1, ""), requestheaders); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); - DcCoreException e = DcCoreException.OData.QUERY_INVALID_ERROR.params("schema", ""); + PersoniumCoreException e = PersoniumCoreException.OData.QUERY_INVALID_ERROR.params("schema", ""); checkErrorResponse(res.bodyAsJson(), e.getCode(), e.getMessage()); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } } @@ -234,17 +234,17 @@ public BoxUrlTest() { @Test public final void URI形式でないschemaを指定した場合に400が返却されること() { try { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); res = rest.getAcceptEncodingGzip(UrlUtils.boxUrl(Setup.TEST_CELL1, "test"), requestheaders); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); - DcCoreException e = DcCoreException.OData.QUERY_INVALID_ERROR.params("schema", "test"); + PersoniumCoreException e = PersoniumCoreException.OData.QUERY_INVALID_ERROR.params("schema", "test"); checkErrorResponse(res.bodyAsJson(), e.getCode(), e.getMessage()); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } } @@ -255,8 +255,8 @@ public BoxUrlTest() { @Test public final void 指定したschemaのBoxが存在しない場合に403が返却されること() { try { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); @@ -265,9 +265,9 @@ public BoxUrlTest() { UrlUtils.boxUrl(Setup.TEST_CELL1, UrlUtils.cellRoot("boxUrlTestSchema")), requestheaders); assertEquals(HttpStatus.SC_FORBIDDEN, res.getStatusCode()); - DcCoreException e = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException e = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; checkErrorResponse(res.bodyAsJson(), e.getCode(), e.getMessage()); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } } @@ -278,16 +278,16 @@ public BoxUrlTest() { @Test public final void マスタートークンを使用してschema指定がない場合に403が返却されること() { try { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); res = rest.getAcceptEncodingGzip(UrlUtils.boxUrl(Setup.TEST_CELL1), requestheaders); - DcCoreException e = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException e = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; checkErrorResponse(res.bodyAsJson(), e.getCode(), e.getMessage()); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } } @@ -311,8 +311,8 @@ public BoxUrlTest() { + ""; beforeACLTest(aclXml); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); String token = ResourceUtils.getMyCellLocalToken(Setup.TEST_CELL1, "account1", "password1"); @@ -323,7 +323,7 @@ public BoxUrlTest() { requestheaders); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); assertEquals(UrlUtils.boxRoot(Setup.TEST_CELL1, "boxUrlTest"), res.getFirstHeader(HttpHeaders.LOCATION)); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } finally { afterACLTest(); @@ -349,8 +349,8 @@ public BoxUrlTest() { + ""; beforeACLTest(aclXml); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); String token = ResourceUtils.getMyCellLocalToken(Setup.TEST_CELL1, "account2", "password2"); @@ -360,9 +360,9 @@ public BoxUrlTest() { UrlUtils.boxUrl(Setup.TEST_CELL1, UrlUtils.cellRoot("boxUrlTestSchema")), requestheaders); assertEquals(HttpStatus.SC_FORBIDDEN, res.getStatusCode()); - DcCoreException e = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException e = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; checkErrorResponse(res.bodyAsJson(), e.getCode(), e.getMessage()); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } finally { afterACLTest(); @@ -388,8 +388,8 @@ public BoxUrlTest() { + ""; beforeACLTest(aclXml); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); String token = ResourceUtils.getMyCellLocalToken(Setup.TEST_CELL1, "account1", "password1"); @@ -400,7 +400,7 @@ public BoxUrlTest() { requestheaders); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); assertEquals(UrlUtils.boxRoot(Setup.TEST_CELL1, "boxUrlTest"), res.getFirstHeader(HttpHeaders.LOCATION)); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } finally { afterACLTest(); @@ -426,8 +426,8 @@ public BoxUrlTest() { + ""; beforeACLTest(aclXml); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); @@ -436,7 +436,7 @@ public BoxUrlTest() { requestheaders); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); assertEquals(UrlUtils.boxRoot(Setup.TEST_CELL1, "boxUrlTest"), res.getFirstHeader(HttpHeaders.LOCATION)); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } finally { afterACLTest(); @@ -470,8 +470,8 @@ public BoxUrlTest() { + ""; beforeACLTest(aclXml); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); String token = ResourceUtils.getMyCellLocalToken(Setup.TEST_CELL1, "account1", "password1"); @@ -482,7 +482,7 @@ public BoxUrlTest() { requestheaders); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); assertEquals(UrlUtils.boxRoot(Setup.TEST_CELL1, "boxUrlTest"), res.getFirstHeader(HttpHeaders.LOCATION)); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } finally { afterACLTest(); @@ -516,8 +516,8 @@ public BoxUrlTest() { + ""; beforeACLTest(aclXml); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); String token = ResourceUtils.getMyCellLocalToken(Setup.TEST_CELL1, "account1", "password1"); @@ -528,7 +528,7 @@ public BoxUrlTest() { requestheaders); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); assertEquals(UrlUtils.boxRoot(Setup.TEST_CELL1, "boxUrlTest"), res.getFirstHeader(HttpHeaders.LOCATION)); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } finally { afterACLTest(); @@ -554,8 +554,8 @@ public BoxUrlTest() { + ""; beforeACLTest(aclXml); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer test"); @@ -565,7 +565,7 @@ public BoxUrlTest() { requestheaders); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); assertEquals(UrlUtils.boxRoot(Setup.TEST_CELL1, "boxUrlTest"), res.getFirstHeader(HttpHeaders.LOCATION)); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } finally { afterACLTest(); @@ -591,8 +591,8 @@ public BoxUrlTest() { + ""; beforeACLTest(aclXml); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer test"); @@ -601,9 +601,9 @@ public BoxUrlTest() { UrlUtils.boxUrl(Setup.TEST_CELL1, UrlUtils.cellRoot("boxUrlTestSchema")), requestheaders); assertEquals(HttpStatus.SC_UNAUTHORIZED, res.getStatusCode()); - DcCoreException e = DcCoreAuthzException.TOKEN_PARSE_ERROR; + PersoniumCoreException e = PersoniumCoreAuthzException.TOKEN_PARSE_ERROR; checkErrorResponse(res.bodyAsJson(), e.getCode(), e.getMessage()); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } finally { afterACLTest(); @@ -629,8 +629,8 @@ public BoxUrlTest() { + ""; beforeACLTest(aclXml); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " @@ -640,7 +640,7 @@ public BoxUrlTest() { UrlUtils.cellRoot("boxUrlTestSchema")), requestheaders); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); assertEquals(UrlUtils.boxRoot(Setup.TEST_CELL1, "boxUrlTest"), res.getFirstHeader(HttpHeaders.LOCATION)); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } finally { deleteApplicationCell("client"); @@ -654,8 +654,8 @@ public BoxUrlTest() { @Test public final void スキーマ設定がnoneかつクエリに指定されたスキーマのPublicトークンを使用してボックスURLが取得できること() { try { - String aclXml = String.format("", + String aclXml = String.format("", UrlUtils.getBaseUrl(), Setup.TEST_CELL1) + " " + " " @@ -668,8 +668,8 @@ public BoxUrlTest() { + ""; beforeACLTest(aclXml); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " @@ -679,7 +679,7 @@ public BoxUrlTest() { UrlUtils.cellRoot("boxUrlTestSchema")), requestheaders); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); assertEquals(UrlUtils.boxRoot(Setup.TEST_CELL1, "boxUrlTest"), res.getFirstHeader(HttpHeaders.LOCATION)); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } finally { deleteApplicationCell("client"); @@ -693,8 +693,8 @@ public BoxUrlTest() { @Test public final void スキーマ設定がpublicかつクエリに指定されたスキーマのPublicトークンを使用してボックスURLが取得できること() { try { - String aclXml = String.format("", + String aclXml = String.format("", UrlUtils.getBaseUrl(), Setup.TEST_CELL1) + " " + " " @@ -707,8 +707,8 @@ public BoxUrlTest() { + ""; beforeACLTest(aclXml); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " @@ -718,7 +718,7 @@ public BoxUrlTest() { UrlUtils.cellRoot("boxUrlTestSchema")), requestheaders); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); assertEquals(UrlUtils.boxRoot(Setup.TEST_CELL1, "boxUrlTest"), res.getFirstHeader(HttpHeaders.LOCATION)); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } finally { deleteApplicationCell("client"); @@ -732,8 +732,8 @@ public BoxUrlTest() { @Test public final void スキーマ設定がconfidentialClientかつクエリに指定されたスキーマのConfidentialClientトークンを使用してボックスURLが取得できること() { try { - String aclXml = String.format("", + String aclXml = String.format("", UrlUtils.getBaseUrl(), Setup.TEST_CELL1) + " " + " " @@ -746,8 +746,8 @@ public BoxUrlTest() { + ""; beforeACLTest(aclXml); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " @@ -757,7 +757,7 @@ public BoxUrlTest() { UrlUtils.cellRoot("boxUrlTestSchema")), requestheaders); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); assertEquals(UrlUtils.boxRoot(Setup.TEST_CELL1, "boxUrlTest"), res.getFirstHeader(HttpHeaders.LOCATION)); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } finally { deleteApplicationCell(OAuth2Helper.Key.CONFIDENTIAL_ROLE_NAME); @@ -784,8 +784,8 @@ public BoxUrlTest() { + ""; beforeACLTest(aclXml); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " @@ -795,7 +795,7 @@ public BoxUrlTest() { UrlUtils.cellRoot("boxUrlTestSchema")), requestheaders); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); assertEquals(UrlUtils.boxRoot(Setup.TEST_CELL1, "boxUrlTest"), res.getFirstHeader(HttpHeaders.LOCATION)); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } finally { deleteApplicationCell("client"); @@ -809,8 +809,8 @@ public BoxUrlTest() { @Test public final void スキーマ設定がnoneかつクエリに指定されたスキーマでないPublicトークンを使用してクエリに指定されたスキーマのボックスURLが取得できること() { try { - String aclXml = String.format("", + String aclXml = String.format("", UrlUtils.getBaseUrl(), Setup.TEST_CELL1) + " " + " " @@ -824,8 +824,8 @@ public BoxUrlTest() { beforeACLTest(aclXml); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " @@ -836,7 +836,7 @@ public BoxUrlTest() { assertEquals(HttpStatus.SC_OK, res.getStatusCode()); assertEquals(UrlUtils.boxRoot(Setup.TEST_CELL1, "boxUrlTest"), res.getFirstHeader(HttpHeaders.LOCATION)); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } finally { deleteApplicationCell("client"); @@ -850,8 +850,8 @@ public BoxUrlTest() { @Test public final void スキーマ設定がpublicかつクエリに指定されたスキーマでないPublicトークンを使用してクエリに指定されたスキーマのボックスURLが取得できないこと() { try { - String aclXml = String.format("", + String aclXml = String.format("", UrlUtils.getBaseUrl(), Setup.TEST_CELL1) + " " + " " @@ -864,8 +864,8 @@ public BoxUrlTest() { + ""; beforeACLTest(aclXml); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " @@ -874,9 +874,9 @@ public BoxUrlTest() { res = rest.getAcceptEncodingGzip(UrlUtils.boxUrl(Setup.TEST_CELL1, UrlUtils.cellRoot("boxUrlTestSchema")), requestheaders); assertEquals(HttpStatus.SC_FORBIDDEN, res.getStatusCode()); - DcCoreException e = DcCoreException.Auth.SCHEMA_MISMATCH; + PersoniumCoreException e = PersoniumCoreException.Auth.SCHEMA_MISMATCH; checkErrorResponse(res.bodyAsJson(), e.getCode(), e.getMessage()); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } finally { deleteApplicationCell("client"); @@ -890,8 +890,8 @@ public BoxUrlTest() { @Test public final void スキーマ設定がconfidentialかつクエリに指定されたスキーマでないConfidentialClientトークンを使用してクエリに指定されたスキーマのボックスURLが取得できないこと() { try { - String aclXml = String.format("", + String aclXml = String.format("", UrlUtils.getBaseUrl(), Setup.TEST_CELL1) + " " + " " @@ -904,8 +904,8 @@ public BoxUrlTest() { + ""; beforeACLTest(aclXml); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " @@ -914,9 +914,9 @@ public BoxUrlTest() { res = rest.getAcceptEncodingGzip(UrlUtils.boxUrl(Setup.TEST_CELL1, UrlUtils.cellRoot("boxUrlTestSchema")), requestheaders); assertEquals(HttpStatus.SC_FORBIDDEN, res.getStatusCode()); - DcCoreException e = DcCoreException.Auth.SCHEMA_MISMATCH; + PersoniumCoreException e = PersoniumCoreException.Auth.SCHEMA_MISMATCH; checkErrorResponse(res.bodyAsJson(), e.getCode(), e.getMessage()); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } finally { deleteApplicationCell(OAuth2Helper.Key.CONFIDENTIAL_ROLE_NAME); @@ -930,8 +930,8 @@ public BoxUrlTest() { @Test public final void スキーマ設定がnoneの場合にアクセストークンを使用してボックスURLが取得できないこと() { try { - String aclXml = String.format("", + String aclXml = String.format("", UrlUtils.getBaseUrl(), Setup.TEST_CELL1) + " " + " " @@ -944,8 +944,8 @@ public BoxUrlTest() { + ""; beforeACLTest(aclXml); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); String token = ResourceUtils.getMyCellLocalToken(Setup.TEST_CELL1, "account1", "password1"); @@ -953,10 +953,10 @@ public BoxUrlTest() { res = rest.getAcceptEncodingGzip(UrlUtils.boxUrl(Setup.TEST_CELL1), requestheaders); assertEquals(HttpStatus.SC_FORBIDDEN, res.getStatusCode()); - DcCoreException e = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException e = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; checkErrorResponse(res.bodyAsJson(), e.getCode(), e.getMessage()); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } finally { afterACLTest(); @@ -969,8 +969,8 @@ public BoxUrlTest() { @Test public final void スキーマ設定がpublicの場合にアクセストークンを使用してボックスURLが取得できること() { try { - String aclXml = String.format("", + String aclXml = String.format("", UrlUtils.getBaseUrl(), Setup.TEST_CELL1) + " " + " " @@ -983,8 +983,8 @@ public BoxUrlTest() { + ""; beforeACLTest(aclXml); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); String token = ResourceUtils.getMyCellLocalToken(Setup.TEST_CELL1, "account1", "password1"); @@ -992,10 +992,10 @@ public BoxUrlTest() { res = rest.getAcceptEncodingGzip(UrlUtils.boxUrl(Setup.TEST_CELL1), requestheaders); assertEquals(HttpStatus.SC_FORBIDDEN, res.getStatusCode()); - DcCoreException e = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException e = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; checkErrorResponse(res.bodyAsJson(), e.getCode(), e.getMessage()); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } finally { afterACLTest(); @@ -1008,8 +1008,8 @@ public BoxUrlTest() { @Test public final void スキーマ設定がconfidentialの場合にアクセストークンを使用してボックスURLが取得できないこと() { try { - String aclXml = String.format("", + String aclXml = String.format("", UrlUtils.getBaseUrl(), Setup.TEST_CELL1) + " " + " " @@ -1022,8 +1022,8 @@ public BoxUrlTest() { + ""; beforeACLTest(aclXml); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); String token = ResourceUtils.getMyCellLocalToken(Setup.TEST_CELL1, "account1", "password1"); @@ -1031,10 +1031,10 @@ public BoxUrlTest() { res = rest.getAcceptEncodingGzip(UrlUtils.boxUrl(Setup.TEST_CELL1), requestheaders); assertEquals(HttpStatus.SC_FORBIDDEN, res.getStatusCode()); - DcCoreException e = DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; + PersoniumCoreException e = PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING; checkErrorResponse(res.bodyAsJson(), e.getCode(), e.getMessage()); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } finally { afterACLTest(); @@ -1060,8 +1060,8 @@ public BoxUrlTest() { + ""; beforeACLTest(aclXml); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " @@ -1071,7 +1071,7 @@ public BoxUrlTest() { assertEquals(HttpStatus.SC_OK, res.getStatusCode()); assertEquals(UrlUtils.boxRoot(Setup.TEST_CELL1, "boxUrlTest"), res.getFirstHeader(HttpHeaders.LOCATION)); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } finally { deleteApplicationCell("client"); @@ -1085,8 +1085,8 @@ public BoxUrlTest() { @Test public final void スキーマ設定がnoneの場合にPublicトークンを使用してボックスURLが取得できること() { try { - String aclXml = String.format("", + String aclXml = String.format("", UrlUtils.getBaseUrl(), Setup.TEST_CELL1) + " " + " " @@ -1099,8 +1099,8 @@ public BoxUrlTest() { + ""; beforeACLTest(aclXml); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " @@ -1110,7 +1110,7 @@ public BoxUrlTest() { assertEquals(HttpStatus.SC_OK, res.getStatusCode()); assertEquals(UrlUtils.boxRoot(Setup.TEST_CELL1, "boxUrlTest"), res.getFirstHeader(HttpHeaders.LOCATION)); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } finally { deleteApplicationCell("client"); @@ -1124,8 +1124,8 @@ public BoxUrlTest() { @Test public final void スキーマ設定がpublicの場合にPublicトークンを使用してボックスURLが取得できること() { try { - String aclXml = String.format("", + String aclXml = String.format("", UrlUtils.getBaseUrl(), Setup.TEST_CELL1) + " " + " " @@ -1138,8 +1138,8 @@ public BoxUrlTest() { + ""; beforeACLTest(aclXml); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + getSchemaToken("client")); @@ -1148,7 +1148,7 @@ public BoxUrlTest() { assertEquals(HttpStatus.SC_OK, res.getStatusCode()); assertEquals(UrlUtils.boxRoot(Setup.TEST_CELL1, "boxUrlTest"), res.getFirstHeader(HttpHeaders.LOCATION)); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } finally { deleteApplicationCell("client"); @@ -1162,8 +1162,8 @@ public BoxUrlTest() { @Test public final void スキーマ設定がconfidentialの場合にPublicトークンを使用してボックスURLが取得できないこと() { try { - String aclXml = String.format("", + String aclXml = String.format("", UrlUtils.getBaseUrl(), Setup.TEST_CELL1) + " " + " " @@ -1176,8 +1176,8 @@ public BoxUrlTest() { + ""; beforeACLTest(aclXml); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " @@ -1185,10 +1185,10 @@ public BoxUrlTest() { res = rest.getAcceptEncodingGzip(UrlUtils.boxUrl(Setup.TEST_CELL1), requestheaders); assertEquals(HttpStatus.SC_FORBIDDEN, res.getStatusCode()); - DcCoreException e = DcCoreException.Auth.INSUFFICIENT_SCHEMA_AUTHZ_LEVEL; + PersoniumCoreException e = PersoniumCoreException.Auth.INSUFFICIENT_SCHEMA_AUTHZ_LEVEL; checkErrorResponse(res.bodyAsJson(), e.getCode(), e.getMessage()); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } finally { deleteApplicationCell("client"); @@ -1215,8 +1215,8 @@ public BoxUrlTest() { + ""; beforeACLTest(aclXml); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " @@ -1226,7 +1226,7 @@ public BoxUrlTest() { assertEquals(HttpStatus.SC_OK, res.getStatusCode()); assertEquals(UrlUtils.boxRoot(Setup.TEST_CELL1, "boxUrlTest"), res.getFirstHeader(HttpHeaders.LOCATION)); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } finally { deleteApplicationCell(OAuth2Helper.Key.CONFIDENTIAL_ROLE_NAME); @@ -1240,8 +1240,8 @@ public BoxUrlTest() { @Test public final void スキーマ設定がnoneの場合にConfidentialClientトークンを使用してボックスURLが取得できること() { try { - String aclXml = String.format("", + String aclXml = String.format("", UrlUtils.getBaseUrl(), Setup.TEST_CELL1) + " " + " " @@ -1254,8 +1254,8 @@ public BoxUrlTest() { + ""; beforeACLTest(aclXml); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " @@ -1265,7 +1265,7 @@ public BoxUrlTest() { assertEquals(HttpStatus.SC_OK, res.getStatusCode()); assertEquals(UrlUtils.boxRoot(Setup.TEST_CELL1, "boxUrlTest"), res.getFirstHeader(HttpHeaders.LOCATION)); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } finally { deleteApplicationCell(OAuth2Helper.Key.CONFIDENTIAL_ROLE_NAME); @@ -1279,8 +1279,8 @@ public BoxUrlTest() { @Test public final void スキーマ設定がpublicの場合にConfidentialClientトークンを使用してボックスURLが取得できること() { try { - String aclXml = String.format("", + String aclXml = String.format("", UrlUtils.getBaseUrl(), Setup.TEST_CELL1) + " " + " " @@ -1293,8 +1293,8 @@ public BoxUrlTest() { + ""; beforeACLTest(aclXml); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " @@ -1304,7 +1304,7 @@ public BoxUrlTest() { assertEquals(HttpStatus.SC_OK, res.getStatusCode()); assertEquals(UrlUtils.boxRoot(Setup.TEST_CELL1, "boxUrlTest"), res.getFirstHeader(HttpHeaders.LOCATION)); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } finally { deleteApplicationCell(OAuth2Helper.Key.CONFIDENTIAL_ROLE_NAME); @@ -1318,8 +1318,8 @@ public BoxUrlTest() { @Test public final void スキーマ設定がconfidentialの場合にConfidentialClientトークンを使用してボックスURLが取得できること() { try { - String aclXml = String.format("", + String aclXml = String.format("", UrlUtils.getBaseUrl(), Setup.TEST_CELL1) + " " + " " @@ -1332,8 +1332,8 @@ public BoxUrlTest() { + ""; beforeACLTest(aclXml); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " @@ -1343,7 +1343,7 @@ public BoxUrlTest() { assertEquals(HttpStatus.SC_OK, res.getStatusCode()); assertEquals(UrlUtils.boxRoot(Setup.TEST_CELL1, "boxUrlTest"), res.getFirstHeader(HttpHeaders.LOCATION)); - } catch (DcException e) { + } catch (PersoniumException e) { fail(e.getMessage()); } finally { deleteApplicationCell(OAuth2Helper.Key.CONFIDENTIAL_ROLE_NAME); @@ -1372,7 +1372,7 @@ private String getSchemaToken(String role) { // スキーマ認証トークンを返却する token = getSchemaAuthz(null); - } catch (DcException e) { + } catch (PersoniumException e) { fail("getConfidentialSchemaToken Fail : " + e.getMessage()); } return token; @@ -1383,7 +1383,7 @@ private String getSchemaToken(String role) { */ private String deleteApplicationCell(String role) { String token = null; - DcRestAdapter rest = new DcRestAdapter(); + PersoniumRestAdapter rest = new PersoniumRestAdapter(); HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); @@ -1395,18 +1395,18 @@ private String deleteApplicationCell(String role) { // アカウント削除 try { - rest = new DcRestAdapter(); + rest = new PersoniumRestAdapter(); rest.del(UrlUtils.cellCtl("boxUrlTestSchema", "Account", "account1"), requestheaders); - } catch (DcException e) { + } catch (PersoniumException e) { System.out.println("boxUrlTestSchema/__ctl/Account('account1') delete Fail : " + e.getMessage()); } // アプリセル削除 try { - rest = new DcRestAdapter(); + rest = new PersoniumRestAdapter(); rest.del(UrlUtils.unitCtl("Cell", "boxUrlTestSchema"), requestheaders); - } catch (DcException e) { + } catch (PersoniumException e) { System.out.println("boxUrlTestSchema delete Fail : " + e.getMessage()); } return token; @@ -1420,8 +1420,8 @@ private String deleteApplicationCell(String role) { private void beforeACLTest(String aclXml) { try { // Box作成 - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); JSONObject body = new JSONObject(); @@ -1431,14 +1431,14 @@ private void beforeACLTest(String aclXml) { assertEquals(HttpStatus.SC_CREATED, res.getStatusCode()); // BoxACL設定 - rest = new DcRestAdapter(); + rest = new PersoniumRestAdapter(); res = null; requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); requestheaders.put("X-HTTP-Method-Override", "ACL"); res = rest.post(UrlUtils.boxRoot(Setup.TEST_CELL1, "boxUrlTest"), aclXml, requestheaders); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); - } catch (DcException e) { + } catch (PersoniumException e) { fail("beforeACLTest Fail : " + e.getMessage()); } } @@ -1447,8 +1447,8 @@ private void beforeACLTest(String aclXml) { * ACL関連のテスト後処理. */ private void afterACLTest() { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); @@ -1457,15 +1457,15 @@ private void afterACLTest() { try { res = rest.del(UrlUtils.cellCtl(Setup.TEST_CELL1, "Box", "boxUrlTest"), requestheaders); assertEquals(HttpStatus.SC_NO_CONTENT, res.getStatusCode()); - } catch (DcException e) { + } catch (PersoniumException e) { fail("afterACLTest Fail : " + e.getMessage()); } } @SuppressWarnings("unchecked") - private void createAppCell() throws DcException { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + private void createAppCell() throws PersoniumException { + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; JSONObject body = new JSONObject(); HashMap requestheaders = new HashMap(); @@ -1476,23 +1476,23 @@ private void createAppCell() throws DcException { } @SuppressWarnings("unchecked") - private void createAccountForAppCell() throws DcException { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + private void createAccountForAppCell() throws PersoniumException { + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; JSONObject body = new JSONObject(); HashMap requestheaders = new HashMap(); body.put("Name", "account1"); requestheaders.put(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - requestheaders.put("X-Dc-Credential", "password1"); + requestheaders.put("X-Personium-Credential", "password1"); res = rest.post(UrlUtils.cellCtl("boxUrlTestSchema", "Account"), body.toJSONString(), requestheaders); assertEquals(HttpStatus.SC_CREATED, res.getStatusCode()); } @SuppressWarnings("unchecked") - private void createRoleForAppCell(String roleName) throws DcException { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + private void createRoleForAppCell(String roleName) throws PersoniumException { + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; JSONObject body = new JSONObject(); HashMap requestheaders = new HashMap(); @@ -1502,9 +1502,9 @@ private void createRoleForAppCell(String roleName) throws DcException { assertEquals(HttpStatus.SC_CREATED, res.getStatusCode()); } - private void linkAccountRole(String roleName) throws DcException { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + private void linkAccountRole(String roleName) throws PersoniumException { + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); @@ -1515,16 +1515,16 @@ private void linkAccountRole(String roleName) throws DcException { assertEquals(HttpStatus.SC_NO_CONTENT, res.getStatusCode()); } - private String getSchemaAuthz(String cell) throws DcException { + private String getSchemaAuthz(String cell) throws PersoniumException { if (cell == null) { cell = "boxUrlTestSchema"; } - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); // クライアントシークレット取得 - String authBody = "grant_type=password&username=account1&password=password1&dc_target=" + String authBody = "grant_type=password&username=account1&password=password1&p_target=" + UrlUtils.cellRoot(Setup.TEST_CELL1); res = rest.post(UrlUtils.auth(cell), authBody, requestheaders); @@ -1541,7 +1541,7 @@ private String getSchemaAuthz(String cell) throws DcException { } private void unlinkAccountRole(String roleName) { - DcRestAdapter rest = new DcRestAdapter(); + PersoniumRestAdapter rest = new PersoniumRestAdapter(); HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); @@ -1549,21 +1549,21 @@ private void unlinkAccountRole(String roleName) { try { rest.del(UrlUtils.getBaseUrl() + "/boxUrlTestSchema/__ctl/Account('account1')/$links/_Role('" + roleName + "')", requestheaders); - } catch (DcException e) { + } catch (PersoniumException e) { System.out.println("/boxUrlTestSchema/__ctl/Account('account1')/$links/_Role('" + roleName + "') delete Fail : " + e.getMessage()); } } private void deleteRoleForAppCell(String roleName) { - DcRestAdapter rest = new DcRestAdapter(); + PersoniumRestAdapter rest = new PersoniumRestAdapter(); HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); // ロール削除 try { rest.del(UrlUtils.cellCtl("boxUrlTestSchema", "Role", roleName), requestheaders); - } catch (DcException e) { + } catch (PersoniumException e) { System.out.println("/boxUrlTestSchema/__ctl/Role('" + roleName + "') delete Fail : " + e.getMessage()); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/CellBulkDeletionTest.java b/src/test/java/io/personium/test/jersey/cell/CellBulkDeletionTest.java similarity index 64% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/CellBulkDeletionTest.java rename to src/test/java/io/personium/test/jersey/cell/CellBulkDeletionTest.java index 6735d2aa1..2f988c913 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/CellBulkDeletionTest.java +++ b/src/test/java/io/personium/test/jersey/cell/CellBulkDeletionTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell; +package io.personium.test.jersey.cell; import static org.junit.Assert.assertEquals; @@ -27,26 +27,26 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token.TokenParseException; -import com.fujitsu.dc.common.auth.token.UnitLocalUnitUserToken; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.auth.OAuth2Helper; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.common.auth.token.AbstractOAuth2Token.TokenParseException; +import io.personium.common.auth.token.UnitLocalUnitUserToken; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.auth.OAuth2Helper; +import io.personium.core.model.Cell; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.WebAppDescriptor; /** @@ -58,11 +58,11 @@ public class CellBulkDeletionTest extends AbstractCase { private static final Map INIT_PARAMS = new HashMap(); static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } /** @@ -109,10 +109,10 @@ public void Before() { // テスト用セル準備 --------------------- // セルの一括削除APIを実行する - DcRequest request = DcRequest.delete(UrlUtils.cellRoot(cellName)); + PersoniumRequest request = PersoniumRequest.delete(UrlUtils.cellRoot(cellName)); request.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN) - .header("X-Dc-Recursive", "true"); - DcResponse response = request(request); + .header("X-Personium-Recursive", "true"); + PersoniumResponse response = request(request); // セル削除APIを実行して、204が返却されることを確認 assertEquals(HttpStatus.SC_NO_CONTENT, response.getStatusCode()); @@ -124,7 +124,7 @@ public void Before() { System.out.println(""); } // セルが削除されていることを確認する - request = DcRequest.get(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME, cellName)); + request = PersoniumRequest.get(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME, cellName)); request.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); response = request(request); assertEquals(HttpStatus.SC_NOT_FOUND, response.getStatusCode()); @@ -134,26 +134,26 @@ public void Before() { * . */ @Test - public final void セル一括削除時にX_Dc_Recursiveヘッダを指定しないで412が返却されること() { + public final void セル一括削除時にX_PERSONIUM_Recursiveヘッダを指定しないで412が返却されること() { // セルを作成する String cellName = "CellBulkDeletionTest"; CellUtils.create(cellName, MASTER_TOKEN_NAME, -1); // セルの一括削除APIを実行する - DcRequest request = DcRequest.delete(UrlUtils.cellRoot(cellName)); + PersoniumRequest request = PersoniumRequest.delete(UrlUtils.cellRoot(cellName)); request.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse response = request(request); + PersoniumResponse response = request(request); // セル削除APIを実行して、412が返却されることを確認 try { assertEquals(HttpStatus.SC_PRECONDITION_FAILED, response.getStatusCode()); - ODataCommon.checkErrorResponseBody(response, DcCoreException.Misc.PRECONDITION_FAILED.getCode(), - DcCoreException.Misc.PRECONDITION_FAILED - .params(DcCoreUtils.HttpHeaders.X_DC_RECURSIVE) + ODataCommon.checkErrorResponseBody(response, PersoniumCoreException.Misc.PRECONDITION_FAILED.getCode(), + PersoniumCoreException.Misc.PRECONDITION_FAILED + .params(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_RECURSIVE) .getMessage()); } finally { // セルを削除する - request.header("X-Dc-Recursive", "true"); + request.header("X-Personium-Recursive", "true"); request(request); } } @@ -162,27 +162,27 @@ public void Before() { * . */ @Test - public final void セル一括削除時にX_Dc_Recursiveヘッダにfalseを指定して412が返却されること() { + public final void セル一括削除時にX_PERSONIUM_Recursiveヘッダにfalseを指定して412が返却されること() { // セルを作成する String cellName = "CellBulkDeletionTest"; CellUtils.create(cellName, MASTER_TOKEN_NAME, -1); // セルの一括削除APIを実行する - DcRequest request = DcRequest.delete(UrlUtils.cellRoot(cellName)); + PersoniumRequest request = PersoniumRequest.delete(UrlUtils.cellRoot(cellName)); request.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN) - .header("X-Dc-Recursive", "false"); - DcResponse response = request(request); + .header("X-Personium-Recursive", "false"); + PersoniumResponse response = request(request); // セル削除APIを実行して、412が返却されることを確認 try { assertEquals(HttpStatus.SC_PRECONDITION_FAILED, response.getStatusCode()); - ODataCommon.checkErrorResponseBody(response, DcCoreException.Misc.PRECONDITION_FAILED.getCode(), - DcCoreException.Misc.PRECONDITION_FAILED - .params(DcCoreUtils.HttpHeaders.X_DC_RECURSIVE) + ODataCommon.checkErrorResponseBody(response, PersoniumCoreException.Misc.PRECONDITION_FAILED.getCode(), + PersoniumCoreException.Misc.PRECONDITION_FAILED + .params(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_RECURSIVE) .getMessage()); } finally { // セルを削除する - request.header("X-Dc-Recursive", "true"); + request.header("X-Personium-Recursive", "true"); request(request); } } @@ -194,17 +194,17 @@ public void Before() { public final void セル一括削除時にユニットユーザの認証トークンを指定してセルが削除できること() { // セルを作成する String cellName = "CellBulkDeletionTest"; - // マスタートークンでX-Dc-UnitUserヘッダを指定すると指定した値のOwnerでセルが作成される。 + // マスタートークンでX-Personium-UnitUserヘッダを指定すると指定した値のOwnerでセルが作成される。 CellUtils.create(cellName, AbstractCase.MASTER_TOKEN_NAME, Setup.OWNER_VET, HttpStatus.SC_CREATED); // セルの一括削除APIを実行する(マスタートークンのヘッダ指定での降格を利用) - DcRequest request = DcRequest.delete(UrlUtils.cellRoot(cellName)); + PersoniumRequest request = PersoniumRequest.delete(UrlUtils.cellRoot(cellName)); request.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN) - .header("X-Dc-Recursive", "true") - .header("X-Dc-Unit-User", Setup.OWNER_VET); + .header("X-Personium-Recursive", "true") + .header("X-Personium-Unit-User", Setup.OWNER_VET); // セル削除APIを実行して、204が返却されることを確認 - DcResponse response = request(request); + PersoniumResponse response = request(request); assertEquals(HttpStatus.SC_NO_CONTENT, response.getStatusCode()); } @@ -215,22 +215,22 @@ public void Before() { public final void セル一括削除時に異なるセルのユニットユーザの認証トークンを指定して403が返却されること() { // セルを作成する String cellName = "CellBulkDeletionTest"; - // マスタートークンでX-Dc-UnitUserヘッダを指定すると指定した値のOwnerでセルが作成される。 + // マスタートークンでX-Personium-UnitUserヘッダを指定すると指定した値のOwnerでセルが作成される。 CellUtils.create(cellName, AbstractCase.MASTER_TOKEN_NAME, Setup.OWNER_VET, HttpStatus.SC_CREATED); try { // セルの一括削除APIを実行する(マスタートークンのヘッダ指定での降格を利用) - DcRequest request = DcRequest.delete(UrlUtils.cellRoot(cellName)); + PersoniumRequest request = PersoniumRequest.delete(UrlUtils.cellRoot(cellName)); request.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN) - .header("X-Dc-Recursive", "true") - .header("X-Dc-Unit-User", Setup.OWNER_HMC); - DcResponse response = request(request); + .header("X-Personium-Recursive", "true") + .header("X-Personium-Unit-User", Setup.OWNER_HMC); + PersoniumResponse response = request(request); assertEquals(HttpStatus.SC_FORBIDDEN, response.getStatusCode()); } finally { // セルを削除する - DcRequest request = DcRequest.delete(UrlUtils.cellRoot(cellName)); + PersoniumRequest request = PersoniumRequest.delete(UrlUtils.cellRoot(cellName)); request.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN) - .header("X-Dc-Recursive", "true"); + .header("X-Personium-Recursive", "true"); request(request); } } @@ -262,22 +262,22 @@ public void Before() { assertEquals(Setup.OWNER_VET, uluut.getSubject()); assertEquals(UrlUtils.getHost(), uluut.getIssuer()); - // マスタートークンでX-Dc-UnitUserヘッダを指定すると指定した値のOwnerでセルが作成される。 + // マスタートークンでX-Personium-UnitUserヘッダを指定すると指定した値のOwnerでセルが作成される。 CellUtils.create(cellName, uluutString, -1); // セルの一括削除APIを実行する - DcRequest request = DcRequest.delete(UrlUtils.cellRoot(cellName)); + PersoniumRequest request = PersoniumRequest.delete(UrlUtils.cellRoot(cellName)); request.header(HttpHeaders.AUTHORIZATION, "Bearer " + uluutString) - .header("X-Dc-Recursive", "true"); - DcResponse response = request(request); + .header("X-Personium-Recursive", "true"); + PersoniumResponse response = request(request); assertEquals(HttpStatus.SC_NO_CONTENT, response.getStatusCode()); } catch (TokenParseException e) { e.printStackTrace(); } finally { // セルを削除する - DcRequest request = DcRequest.delete(UrlUtils.cellRoot(cellName)); + PersoniumRequest request = PersoniumRequest.delete(UrlUtils.cellRoot(cellName)); request.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN) - .header("X-Dc-Recursive", "true"); + .header("X-Personium-Recursive", "true"); request(request); } } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/CreateTest.java b/src/test/java/io/personium/test/jersey/cell/CreateTest.java similarity index 74% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/CreateTest.java rename to src/test/java/io/personium/test/jersey/cell/CreateTest.java index 6d66ccd92..f6b5fe3b8 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/CreateTest.java +++ b/src/test/java/io/personium/test/jersey/cell/CreateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell; +package io.personium.test.jersey.cell; import static org.junit.Assert.assertEquals; @@ -30,14 +30,14 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.core.model.Cell; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; /** * Cellの作成のIT. @@ -52,7 +52,7 @@ public class CreateTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public CreateTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -86,7 +86,7 @@ public void after() { */ @Test public final void Cellの作成の正常系のテスト() { - DcRequest req = DcRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); cellNormal(req, cellNameLower); } @@ -96,8 +96,8 @@ public void after() { @Test public final void 登録したCellを削除後すぐに再登録するテスト() { // Cellを作成 - DcRequest req = DcRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); - DcResponse res = cellNormalResponse(req, cellNameLower); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumResponse res = cellNormalResponse(req, cellNameLower); // Cell削除 cellDelete(res); // Cellを再作成 @@ -109,7 +109,7 @@ public void after() { */ @Test public final void Cellの作成のリクエストボディが無いパターンのテスト() { - DcRequest req = DcRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); cellErrorEmptyBody(req); } @@ -118,7 +118,7 @@ public void after() { */ @Test public final void Cellの作成のリクエストボディに不正なフィールド名を指定したパターンのテスト() { - DcRequest req = DcRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); cellErrorInvalidField(req, cellNameLower); } @@ -127,7 +127,7 @@ public void after() { */ @Test public final void Cellの作成のNameが空のパターンのテスト() { - DcRequest req = DcRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); cellErrorName0(req); } @@ -136,7 +136,7 @@ public void after() { */ @Test public final void Cellの作成のNameが1文字のパターンのテスト() { - DcRequest req = DcRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); cellName1(req); } @@ -145,7 +145,7 @@ public void after() { */ @Test public final void Cellの作成のNameが128文字のパターンのテスト() { - DcRequest req = DcRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); cellName128(req); } @@ -154,7 +154,7 @@ public void after() { */ @Test public final void Cellの作成のNameが129文字のパターンのテスト() { - DcRequest req = DcRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); cellErrorName129(req); } @@ -163,7 +163,7 @@ public void after() { */ @Test public final void Cellの作成のNameが不正な値のパターンのテスト() { - DcRequest req = DcRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); cellErrorNameCharacter(req); } @@ -172,7 +172,7 @@ public void after() { */ @Test public final void Cellの作成のNameが__の場合に400が返却されること() { - DcRequest req = DcRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); cellErrorNameUnderbaer(req); } @@ -181,7 +181,7 @@ public void after() { */ @Test public final void Cellの作成のNameが__ctlの場合に400が返却されること() { - DcRequest req = DcRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); cellErrorNameUnderbaerCtl(req); } @@ -190,7 +190,7 @@ public void after() { */ @Test public final void Cell作成のリクエストボディに管理情報__publishedが指定された場合に400が返却されること() { - DcRequest req = DcRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); cellErrorBodyDateCtl(req, PUBLISHED); } @@ -199,7 +199,7 @@ public void after() { */ @Test public final void Cell作成のリクエストボディに管理情報__updatedが指定された場合に400が返却されること() { - DcRequest req = DcRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); cellErrorBodyDateCtl(req, UPDATED); } @@ -208,7 +208,7 @@ public void after() { */ @Test public final void Cell作成のリクエストボディに管理情報__metadataが指定された場合に400が返却されること() { - DcRequest req = DcRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); cellErrorBodyMetadataCtl(req, METADATA); } @@ -217,7 +217,7 @@ public void after() { */ @Test public final void Cellの作成のJSONフォーマットエラーのテスト() { - DcRequest req = DcRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); cellErrorInvalidJson(req, cellNameLower); } @@ -226,7 +226,7 @@ public void after() { */ @Test public final void Cellの作成のXMLフォーマットエラーのテスト() { - DcRequest req = DcRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); cellErrorInvalidXml(req, cellNameLower); } @@ -235,7 +235,7 @@ public void after() { */ @Test public final void Cellの作成の認証ヘッダ無しのテスト() { - DcRequest req = DcRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); cellErrorAuthNone(req); } @@ -244,7 +244,7 @@ public void after() { */ @Test public final void Cellの作成の不正な認証ヘッダのテスト() { - DcRequest req = DcRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); cellErrorAuthInvalid(req); } @@ -253,7 +253,7 @@ public void after() { */ @Test public final void Cellの作成の不正なメソッドのテスト() { - DcRequest req = DcRequest.delete(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.delete(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); cellErrorInvalidMethod(req, cellNameLower); } @@ -262,7 +262,7 @@ public void after() { */ @Test public final void Cellの作成で小文字のCell名を登録した後に同じ小文字のCell名を登録した場合_409となることを確認() { - DcRequest req = DcRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); cellConflict(req, cellNameLower); } @@ -271,7 +271,7 @@ public void after() { */ @Test public final void Cellの作成で大文字のCell名を登録した後に同じ大文字のCell名を登録した場合_409となることを確認() { - DcRequest req = DcRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); cellConflict(req, cellNameUpper); } @@ -280,7 +280,7 @@ public void after() { */ @Test public final void Cellの作成で小文字のCell名を登録した後に大文字で同じCell名を登録した場合_201となることを確認() { - DcRequest req = DcRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); cellCreateResCheck(req, HttpMethod.POST, UrlUtils.unitCtl(Cell.EDM_TYPE_NAME), cellNameLower, cellNameUpper); } @@ -289,7 +289,7 @@ public void after() { */ @Test public final void Cellの作成で大文字のCell名を登録した後に小文字で同じCell名を登録した場合_201となることを確認() { - DcRequest req = DcRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); cellCreateResCheck(req, HttpMethod.POST, UrlUtils.unitCtl(Cell.EDM_TYPE_NAME), cellNameUpper, cellNameLower); } @@ -299,13 +299,13 @@ public void after() { @Test public final void 大文字Cell名で作成したCellに対してCellレベルAPIが利用できること() { // 大文字Cell名のCellを作成 - DcRequest req = DcRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); cellNormal(req, cellNameUpper); // 大文字Cell名を指定してBoxの一覧取得を実行 - req = DcRequest.get(UrlUtils.cellCtl(cellNameUpper, "Box")); + req = PersoniumRequest.get(UrlUtils.cellCtl(cellNameUpper, "Box")); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse response = request(req); + PersoniumResponse response = request(req); // 200になることを確認 assertEquals(HttpStatus.SC_OK, response.getStatusCode()); @@ -317,13 +317,13 @@ public void after() { @Test public final void 小文字Cell名で作成したCellに対してCellレベルAPIが利用できること() { // 小文字Cell名のCellを作成 - DcRequest req = DcRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); cellNormal(req, cellNameLower); // 小文字Cell名を指定してBoxの一覧取得を実行 - req = DcRequest.get(UrlUtils.cellCtl(cellNameLower, "Box")); + req = PersoniumRequest.get(UrlUtils.cellCtl(cellNameLower, "Box")); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse response = request(req); + PersoniumResponse response = request(req); // 200になることを確認 assertEquals(HttpStatus.SC_OK, response.getStatusCode()); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/DefaultBoxTest.java b/src/test/java/io/personium/test/jersey/cell/DefaultBoxTest.java similarity index 86% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/DefaultBoxTest.java rename to src/test/java/io/personium/test/jersey/cell/DefaultBoxTest.java index 3dc01f8e7..d47ebcbf8 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/DefaultBoxTest.java +++ b/src/test/java/io/personium/test/jersey/cell/DefaultBoxTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell; +package io.personium.test.jersey.cell; import org.apache.http.HttpStatus; import org.junit.After; @@ -24,20 +24,20 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; +import io.personium.core.model.Box; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; import com.sun.jersey.test.framework.JerseyTest; /** * UnitUserでCellをCRUDするテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class DefaultBoxTest extends JerseyTest { @@ -49,7 +49,7 @@ public class DefaultBoxTest extends JerseyTest { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public DefaultBoxTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/DeleteTest.java b/src/test/java/io/personium/test/jersey/cell/DeleteTest.java similarity index 88% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/DeleteTest.java rename to src/test/java/io/personium/test/jersey/cell/DeleteTest.java index 9d237b5bc..76acebb7c 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/DeleteTest.java +++ b/src/test/java/io/personium/test/jersey/cell/DeleteTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell; +package io.personium.test.jersey.cell; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -34,26 +34,26 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRestAdapter; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.ExtCellUtils; -import com.fujitsu.dc.test.utils.ExtRoleUtils; -import com.fujitsu.dc.test.utils.RelationUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.SentMessageUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.Box; +import io.personium.core.model.Cell; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumRestAdapter; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.ExtCellUtils; +import io.personium.test.utils.ExtRoleUtils; +import io.personium.test.utils.RelationUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.SentMessageUtils; +import io.personium.test.utils.TResponse; /** * JerseyTestFrameworkを利用したユニットテスト. @@ -70,7 +70,7 @@ private class TestCellInfo { /** テストCell ID. */ private String cellId = null; /** テストCell レスポンス. */ - private DcResponse resCell; + private PersoniumResponse resCell; /** テストBox名 . */ private String boxName = null; @@ -86,7 +86,7 @@ void initial() { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public DeleteTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -135,7 +135,7 @@ public final void initCell() { */ @After public final void afterCell() { - DcResponse res = null; + PersoniumResponse res = null; if (this.cellInfo.cellId != null) { if (this.cellInfo.boxName != null) { // テストBox 削除 @@ -158,8 +158,8 @@ public final void afterCell() { @Test public final void Cell削除の正常系のテスト() { // Cellを削除 - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); @@ -185,12 +185,12 @@ public final void afterCell() { // Acceptヘッダ なし String cellName = "123456"; String url = getUrlWithOutQuote(cellName, null); - DcResponse res = this.restDelete(url); + PersoniumResponse res = this.restDelete(url); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); checkErrorResponse(res.bodyAsJson(), - DcCoreException.OData.ENTITY_KEY_PARSE_ERROR.getCode(), - DcCoreException.OData.ENTITY_KEY_PARSE_ERROR.getMessage()); + PersoniumCoreException.OData.ENTITY_KEY_PARSE_ERROR.getCode(), + PersoniumCoreException.OData.ENTITY_KEY_PARSE_ERROR.getMessage()); } /** @@ -199,8 +199,8 @@ public final void afterCell() { @Test public final void Cell削除の存在しないCellId指定のテスト() { // Cellを削除 - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); @@ -232,8 +232,8 @@ public final void afterCell() { cellUrl.append("?$select=name"); // Cellを削除 - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); @@ -255,8 +255,8 @@ public final void afterCell() { @Test public final void Cell削除の不正Authorizationのテスト() { // Cellを削除 - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, "Illegal Authorization"); @@ -281,8 +281,8 @@ public final void afterCell() { this.boxCreate(); // Cellを削除 - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); @@ -314,8 +314,8 @@ public final void afterCell() { userName, pass, HttpStatus.SC_CREATED); // Cellを削除 - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); @@ -415,8 +415,8 @@ public final void afterCell() { RoleUtils.create(this.cellInfo.cellName, MASTER_TOKEN_NAME, null, roleName, HttpStatus.SC_CREATED); // Cellを削除 - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); @@ -462,8 +462,8 @@ public final void afterCell() { HttpStatus.SC_CREATED); // Cellを削除 - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); @@ -521,8 +521,8 @@ public final void afterCell() { HttpStatus.SC_CREATED); // Cellを削除 - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); @@ -576,8 +576,8 @@ public final void afterCell() { RelationUtils.create(this.cellInfo.cellName, MASTER_TOKEN_NAME, body, HttpStatus.SC_CREATED); // Cellを削除 - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ErrorPageTest.java b/src/test/java/io/personium/test/jersey/cell/ErrorPageTest.java similarity index 74% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ErrorPageTest.java rename to src/test/java/io/personium/test/jersey/cell/ErrorPageTest.java index fc48fc55b..0b3266da9 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ErrorPageTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ErrorPageTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell; +package io.personium.test.jersey.cell; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -29,24 +29,24 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.DcCoreMessageUtils; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DaoException; -import com.fujitsu.dc.test.jersey.DcException; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRestAdapter; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.core.PersoniumCoreException; +import io.personium.core.PersoniumCoreMessageUtils; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.DaoException; +import io.personium.test.jersey.PersoniumException; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumRestAdapter; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; import com.sun.jersey.test.framework.JerseyTest; /** * Test for Error Page. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class ErrorPageTest extends JerseyTest { @@ -54,7 +54,7 @@ public class ErrorPageTest extends JerseyTest { * constructor. */ public ErrorPageTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -63,8 +63,8 @@ public ErrorPageTest() { @Test public final void エラーページへのGETで指定したコードに対応するメッセージが返却されること() { - String code = DcCoreException.OData.JSON_PARSE_ERROR.getCode(); - DcResponse res = requesttoErrorPage(code); + String code = PersoniumCoreException.OData.JSON_PARSE_ERROR.getCode(); + PersoniumResponse res = requesttoErrorPage(code); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); @@ -83,7 +83,7 @@ public ErrorPageTest() { public final void personiumで定義されていないコードを指定してエラーページを取得しundefinedとなること() { String code = "dummyCode"; - DcResponse res = requesttoErrorPage(code); + PersoniumResponse res = requesttoErrorPage(code); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); @@ -102,7 +102,7 @@ public ErrorPageTest() { public final void コードの値を指定せずにエラーページを取得しundefinedとなること() { String code = ""; - DcResponse res = requesttoErrorPage(code); + PersoniumResponse res = requesttoErrorPage(code); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); @@ -119,8 +119,8 @@ public ErrorPageTest() { @Test public final void コードを指定せずにエラーページを取得しundefinedとなること() { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -128,7 +128,7 @@ public ErrorPageTest() { try { res = rest.getAcceptEncodingGzip( UrlUtils.cellRoot(Setup.TEST_CELL1) + "__html/error", requestheaders); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } @@ -148,16 +148,16 @@ public ErrorPageTest() { @Test public final void エラーページへのPOSTで405となること() { - String code = DcCoreException.OData.JSON_PARSE_ERROR.getCode(); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + String code = PersoniumCoreException.OData.JSON_PARSE_ERROR.getCode(); + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); try { res = rest.post(UrlUtils.cellRoot(Setup.TEST_CELL1) + "__html/error?code=" + code, "", requestheaders); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } assertEquals(HttpStatus.SC_METHOD_NOT_ALLOWED, res.getStatusCode()); @@ -169,16 +169,16 @@ public ErrorPageTest() { @Test public final void エラーページへのPUTで405となること() { - String code = DcCoreException.OData.JSON_PARSE_ERROR.getCode(); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + String code = PersoniumCoreException.OData.JSON_PARSE_ERROR.getCode(); + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); try { res = rest.put(UrlUtils.cellRoot(Setup.TEST_CELL1) + "__html/error?code=" + code, "", requestheaders); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } assertEquals(HttpStatus.SC_METHOD_NOT_ALLOWED, res.getStatusCode()); @@ -190,16 +190,16 @@ public ErrorPageTest() { @Test public final void エラーページへのDELETEで405となること() { - String code = DcCoreException.OData.JSON_PARSE_ERROR.getCode(); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + String code = PersoniumCoreException.OData.JSON_PARSE_ERROR.getCode(); + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); try { res = rest.del(UrlUtils.cellRoot(Setup.TEST_CELL1) + "__html/error?code=" + code, requestheaders); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } assertEquals(HttpStatus.SC_METHOD_NOT_ALLOWED, res.getStatusCode()); @@ -209,9 +209,9 @@ public ErrorPageTest() { * エラーページにリクエストを投入する. * @return レスポンス */ - private DcResponse requesttoErrorPage(String code) { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + private PersoniumResponse requesttoErrorPage(String code) { + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -219,7 +219,7 @@ private DcResponse requesttoErrorPage(String code) { try { res = rest.getAcceptEncodingGzip(UrlUtils.cellRoot(Setup.TEST_CELL1) + "__html/error?code=" + code, requestheaders); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } @@ -231,14 +231,14 @@ private DcResponse requesttoErrorPage(String code) { * @param res レスポンス情報 * @param expectedCode 期待するエラーコード */ - public static void checkResponseBody(DcResponse res, String expectedCode) { + public static void checkResponseBody(PersoniumResponse res, String expectedCode) { String body = null; String expectedMessage = null; - String expectedTitle = DcCoreMessageUtils.getMessage("PS-ER-0001"); + String expectedTitle = PersoniumCoreMessageUtils.getMessage("PS-ER-0001"); if (expectedCode == null) { - expectedMessage = DcCoreMessageUtils.getMessage("PS-ER-0002"); + expectedMessage = PersoniumCoreMessageUtils.getMessage("PS-ER-0002"); } else { - expectedMessage = DcCoreMessageUtils.getMessage(expectedCode); + expectedMessage = PersoniumCoreMessageUtils.getMessage(expectedCode); } try { body = res.bodyAsString(); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/EventArchiveLogGetTest.java b/src/test/java/io/personium/test/jersey/cell/EventArchiveLogGetTest.java similarity index 83% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/EventArchiveLogGetTest.java rename to src/test/java/io/personium/test/jersey/cell/EventArchiveLogGetTest.java index a2ad2d740..8a6a38cc6 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/EventArchiveLogGetTest.java +++ b/src/test/java/io/personium/test/jersey/cell/EventArchiveLogGetTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell; +package io.personium.test.jersey.cell; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -38,19 +38,19 @@ import org.w3c.dom.Element; import org.w3c.dom.NodeList; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcException; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumException; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.TResponse; /** * Log API: 過去ログ取得用テスト. @@ -58,10 +58,10 @@ * 本クラスのテストでは、過去ログに対するテストを行うため、事前に過去ログを作成しておく必要がある。
    * EventLogのローテートは、50MBのサイズローテートを行っている。
    * 毎回のテスト時に過去ログを作成すると時間がかかるため、Setup#reset()とは別の手段で初期設定する。 - * @see com.fujitsu.dc.test.setup.Setup#resetEventLog() + * @see io.personium.test.setup.Setup#resetEventLog() *

    */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class EventArchiveLogGetTest extends ODataCommon { @@ -74,16 +74,16 @@ public class EventArchiveLogGetTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public EventArchiveLogGetTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** * ローテートされた過去ログを取得して200が返却されること. * @throws IOException レスポンスボディの読み込みに失敗した場合 - * @throws DcException DcException + * @throws PersoniumException DcException */ @Test - public final void ローテートされた過去ログを取得して200が返却されること() throws IOException, DcException { + public final void ローテートされた過去ログを取得して200が返却されること() throws IOException, PersoniumException { final String cell = Setup.TEST_CELL_EVENTLOG; // 過去ログのファイル名を取得するため、いったんPROPFINDを発行する @@ -103,7 +103,7 @@ public EventArchiveLogGetTest() { for (String href : hrefList) { String[] splitedHref = href.split("log\\."); String archiveLogName = String.format(DEFAULT_LOG_FORMAT, Long.valueOf(splitedHref[1])); - DcResponse response = CellUtils.getLog(cell, ARCHIVE_COLLECTION, archiveLogName); + PersoniumResponse response = CellUtils.getLog(cell, ARCHIVE_COLLECTION, archiveLogName); assertEquals(TEXT_CSV, response.getFirstHeader(HttpHeaders.CONTENT_TYPE)); assertEquals(HttpStatus.SC_OK, response.getStatusCode()); @@ -157,7 +157,7 @@ public EventArchiveLogGetTest() { * @param response レスポンス情報 * @throws IOException レスポンスボディの読み込みに失敗した場合 */ - private void checkResponseBody(DcResponse response) throws IOException { + private void checkResponseBody(PersoniumResponse response) throws IOException { InputStream is = null; InputStreamReader isr = null; BufferedReader reader = null; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/EventTest.java b/src/test/java/io/personium/test/jersey/cell/EventTest.java similarity index 85% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/EventTest.java rename to src/test/java/io/personium/test/jersey/cell/EventTest.java index da9e56e0b..f0038a062 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/EventTest.java +++ b/src/test/java/io/personium/test/jersey/cell/EventTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell; +package io.personium.test.jersey.cell; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -30,25 +30,25 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DaoException; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.DaoException; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * Event APIのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class EventTest extends ODataCommon { @@ -56,7 +56,7 @@ public class EventTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public EventTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -117,7 +117,7 @@ public EventTest() { public final void イベント受付に対するPROPFINDで501が返却されること() { Http.request("cell/cell-event.txt") - .with("METHOD", com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPFIND) + .with("METHOD", io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPFIND) .with("token", AbstractCase.MASTER_TOKEN_NAME) .with("cellPath", Setup.TEST_CELL1) .with("requestKey", "testRequestKey") @@ -133,7 +133,7 @@ public EventTest() { public final void イベント受付に対するPROPPATCHで501が返却されること() { Http.request("cell/cell-event.txt") - .with("METHOD", com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPPATCH) + .with("METHOD", io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPPATCH) .with("token", AbstractCase.MASTER_TOKEN_NAME) .with("cellPath", Setup.TEST_CELL1) .with("requestKey", "testRequestKey") @@ -206,7 +206,7 @@ public EventTest() { .with("requestKey", "abc#123") .with("json", "") .returns(); - response.checkErrorResponse("PR400-EV-0002", DcCoreException.Event.X_DC_REQUESTKEY_INVALID.getMessage()); + response.checkErrorResponse("PR400-EV-0002", PersoniumCoreException.Event.X_PERSONIUM_REQUESTKEY_INVALID.getMessage()); response.statusCode(HttpStatus.SC_BAD_REQUEST); } @@ -233,11 +233,11 @@ public EventTest() { .statusCode(HttpStatus.SC_OK); // リクエストパラメータ設定 - DcRequest req = DcRequest.get(UrlUtils.log(Setup.TEST_CELL1) + "/current/default.log"); + PersoniumRequest req = PersoniumRequest.get(UrlUtils.log(Setup.TEST_CELL1) + "/current/default.log"); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_OK, response.getStatusCode()); String responseBody; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/LogListTest.java b/src/test/java/io/personium/test/jersey/cell/LogListTest.java similarity index 88% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/LogListTest.java rename to src/test/java/io/personium/test/jersey/cell/LogListTest.java index c12fa2347..75bfb85a8 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/LogListTest.java +++ b/src/test/java/io/personium/test/jersey/cell/LogListTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell; +package io.personium.test.jersey.cell; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -32,27 +32,27 @@ import org.w3c.dom.Element; import org.w3c.dom.NodeList; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.TResponse; /** * Log APIのテスト. * 本クラスのテストでは、過去ログに対するテストを行うため、事前に過去ログを作成しておく必要がある。
    * EventLogのローテートは、50MBのサイズローテートを行っている。
    * 毎回のテスト時に過去ログを作成すると時間がかかるため、Setup#reset()とは別の手段で初期設定する。 - * @see com.fujitsu.dc.test.setup.Setup#resetEventLog() + * @see io.personium.test.setup.Setup#resetEventLog() */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class LogListTest extends ODataCommon { @@ -63,7 +63,7 @@ public class LogListTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public LogListTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -73,7 +73,7 @@ public LogListTest() { public final void ログファイル一覧取得に対するPROPFINDで501が返却されること() { Http.request("cell/log-propfind-with-nobody.txt") - .with("METHOD", com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPFIND) + .with("METHOD", io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPFIND) .with("token", AbstractCase.MASTER_TOKEN_NAME) .with("cellPath", Setup.TEST_CELL_EVENTLOG) .with("collection", CURRENT_COLLECTION) @@ -125,7 +125,7 @@ public LogListTest() { .statusCode(HttpStatus.SC_METHOD_NOT_ALLOWED); Http.request("cell/log-propfind-with-nobody.txt") - .with("METHOD", com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPPATCH) + .with("METHOD", io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPPATCH) .with("token", AbstractCase.MASTER_TOKEN_NAME) .with("cellPath", Setup.TEST_CELL_EVENTLOG) .with("collection", CURRENT_COLLECTION) @@ -141,7 +141,7 @@ public LogListTest() { public final void ログファイル一覧取得で存在しないコレクションに対するPROPFINDで404が返却されること() { Http.request("cell/log-propfind-with-nobody.txt") - .with("METHOD", com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPFIND) + .with("METHOD", io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPFIND) .with("token", AbstractCase.MASTER_TOKEN_NAME) .with("cellPath", Setup.TEST_CELL_EVENTLOG) .with("collection", "dummy") @@ -194,7 +194,7 @@ public LogListTest() { public final void アーカイブログファイル一覧取得_ボディなしかつContentLengthありのPROPFINDで207が返却されること() { Http.request("cell/log-propfind-with-nobody.txt") - .with("METHOD", com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPFIND) + .with("METHOD", io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPFIND) .with("token", AbstractCase.MASTER_TOKEN_NAME) .with("cellPath", Setup.TEST_CELL_EVENTLOG) .with("collection", ARCHIVE_COLLECTION) @@ -210,7 +210,7 @@ public LogListTest() { public final void アーカイブログファイル一覧取得_ボディなしかつContentLengthなしのPROPFINDで207が返却されること() { Http.request("cell/log-propfind-with-nobody-non-content-length.txt") - .with("METHOD", com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPFIND) + .with("METHOD", io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPFIND) .with("token", AbstractCase.MASTER_TOKEN_NAME) .with("cellPath", Setup.TEST_CELL_EVENTLOG) .with("collection", ARCHIVE_COLLECTION) @@ -229,7 +229,7 @@ public LogListTest() { + ""; TResponse tresponse = Http.request("cell/log-propfind-with-body.txt") - .with("METHOD", com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPFIND) + .with("METHOD", io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPFIND) .with("token", AbstractCase.MASTER_TOKEN_NAME) .with("cellPath", Setup.TEST_CELL_EVENTLOG) .with("collection", ARCHIVE_COLLECTION) @@ -253,7 +253,7 @@ public LogListTest() { + ""; TResponse tresponse = Http.request("cell/log-propfind-with-body.txt") - .with("METHOD", com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPFIND) + .with("METHOD", io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPFIND) .with("token", AbstractCase.MASTER_TOKEN_NAME) .with("cellPath", Setup.TEST_CELL_EVENTLOG) .with("collection", ARCHIVE_COLLECTION) @@ -277,7 +277,7 @@ public LogListTest() { + ""; Http.request("cell/log-propfind-with-body.txt") - .with("METHOD", com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPFIND) + .with("METHOD", io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPFIND) .with("token", AbstractCase.MASTER_TOKEN_NAME) .with("cellPath", Setup.TEST_CELL_EVENTLOG) .with("collection", ARCHIVE_COLLECTION) @@ -298,7 +298,7 @@ public LogListTest() { + ""; Http.request("cell/log-propfind-with-body.txt") - .with("METHOD", com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPFIND) + .with("METHOD", io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPFIND) .with("token", AbstractCase.MASTER_TOKEN_NAME) .with("cellPath", Setup.TEST_CELL_EVENTLOG) .with("collection", ARCHIVE_COLLECTION) @@ -319,7 +319,7 @@ public LogListTest() { + ""; Http.request("cell/log-propfind-with-body.txt") - .with("METHOD", com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPFIND) + .with("METHOD", io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPFIND) .with("token", AbstractCase.MASTER_TOKEN_NAME) .with("cellPath", Setup.TEST_CELL_EVENTLOG) .with("collection", ARCHIVE_COLLECTION) @@ -339,7 +339,7 @@ public LogListTest() { + ""; Http.request("cell/log-propfind-with-body.txt") - .with("METHOD", com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPFIND) + .with("METHOD", io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPFIND) .with("token", "Invalid-Token") .with("cellPath", Setup.TEST_CELL_EVENTLOG) .with("collection", ARCHIVE_COLLECTION) @@ -359,7 +359,7 @@ public LogListTest() { + ""; Http.request("cell/log-propfind-with-body-no-depth.txt") - .with("METHOD", com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPFIND) + .with("METHOD", io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPFIND) .with("token", AbstractCase.MASTER_TOKEN_NAME) .with("cellPath", Setup.TEST_CELL_EVENTLOG) .with("collection", ARCHIVE_COLLECTION) @@ -378,7 +378,7 @@ public LogListTest() { + ""; Http.request("cell/log-propfind-with-body.txt") - .with("METHOD", com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPFIND) + .with("METHOD", io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPFIND) .with("token", AbstractCase.MASTER_TOKEN_NAME) .with("cellPath", Setup.TEST_CELL_EVENTLOG) .with("collection", ARCHIVE_COLLECTION) @@ -399,7 +399,7 @@ public LogListTest() { + ""; Http.request("cell/log-propfind-with-body.txt") - .with("METHOD", com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPFIND) + .with("METHOD", io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPFIND) .with("token", AbstractCase.MASTER_TOKEN_NAME) .with("cellPath", Setup.TEST_CELL_EVENTLOG) .with("collection", ARCHIVE_COLLECTION) diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/LogTest.java b/src/test/java/io/personium/test/jersey/cell/LogTest.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/LogTest.java rename to src/test/java/io/personium/test/jersey/cell/LogTest.java index 33cc78770..9cf415fb2 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/LogTest.java +++ b/src/test/java/io/personium/test/jersey/cell/LogTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell; +package io.personium.test.jersey.cell; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -29,25 +29,25 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DaoException; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.DaoException; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * Log APIのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class LogTest extends ODataCommon { @@ -59,7 +59,7 @@ public class LogTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public LogTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -114,11 +114,11 @@ public LogTest() { CellUtils.event(MASTER_TOKEN_NAME, HttpStatus.SC_OK, cellName, body.toJSONString()); // リクエストパラメータ設定 - DcRequest req = DcRequest.get(UrlUtils.log(cellName) + "/current/default.log"); + PersoniumRequest req = PersoniumRequest.get(UrlUtils.log(cellName) + "/current/default.log"); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); // リクエスト実行 - DcResponse response = request(req); + PersoniumResponse response = request(req); assertEquals(HttpStatus.SC_OK, response.getStatusCode()); String responseBody; @@ -247,7 +247,7 @@ public LogTest() { .statusCode(HttpStatus.SC_METHOD_NOT_ALLOWED); Http.request("cell/log-get.txt") - .with("METHOD", com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPFIND) + .with("METHOD", io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPFIND) .with("token", AbstractCase.MASTER_TOKEN_NAME) .with("cellPath", Setup.TEST_CELL1) .with("collection", CURRENT_COLLECTION) @@ -257,7 +257,7 @@ public LogTest() { .statusCode(HttpStatus.SC_METHOD_NOT_ALLOWED); Http.request("cell/log-get.txt") - .with("METHOD", com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPPATCH) + .with("METHOD", io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPPATCH) .with("token", AbstractCase.MASTER_TOKEN_NAME) .with("cellPath", Setup.TEST_CELL1) .with("collection", CURRENT_COLLECTION) diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/MessageApproveTest.java b/src/test/java/io/personium/test/jersey/cell/MessageApproveTest.java similarity index 85% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/MessageApproveTest.java rename to src/test/java/io/personium/test/jersey/cell/MessageApproveTest.java index 791d5ad19..a142a68ac 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/MessageApproveTest.java +++ b/src/test/java/io/personium/test/jersey/cell/MessageApproveTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell; +package io.personium.test.jersey.cell; import static org.junit.Assert.assertEquals; @@ -29,32 +29,32 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.common.auth.token.Role; -import com.fujitsu.dc.common.auth.token.TransCellAccessToken; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.ExtCell; -import com.fujitsu.dc.core.model.ctl.Relation; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcException; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRestAdapter; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.ExtCellUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.ReceivedMessageUtils; -import com.fujitsu.dc.test.utils.RelationUtils; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.common.auth.token.Role; +import io.personium.common.auth.token.TransCellAccessToken; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.ExtCell; +import io.personium.core.model.ctl.Relation; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumException; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumRestAdapter; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.ExtCellUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.ReceivedMessageUtils; +import io.personium.test.utils.RelationUtils; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.TResponse; /** * メッセージ承認APIのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class MessageApproveTest extends ODataCommon { @@ -62,7 +62,7 @@ public class MessageApproveTest extends ODataCommon { * コンストラクタ. */ public MessageApproveTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -84,17 +84,17 @@ public MessageApproveTest() { String locationHeader = null; try { - DcRestAdapter rest; + PersoniumRestAdapter rest; HashMap requestheaders; String requestUrl = UrlUtils.receivedMessage(Setup.TEST_CELL1); - DcResponse res = createReceivedMessage(requestUrl, body); + PersoniumResponse res = createReceivedMessage(requestUrl, body); locationHeader = res.getFirstHeader(HttpHeaders.LOCATION); String messageId = getMessageId(res); // メッセージ承認にする - rest = new DcRestAdapter(); + rest = new PersoniumRestAdapter(); res = null; // リクエストヘッダをセット @@ -115,7 +115,7 @@ public MessageApproveTest() { // 更新結果を取得 checkMessageStatus(messageId, "unread"); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } finally { if (locationHeader != null) { @@ -134,8 +134,8 @@ public MessageApproveTest() { String messageId = "notfoundid123456789"; // メッセージ承認にする - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -146,8 +146,8 @@ public MessageApproveTest() { res = rest.post(requestUrl, "{\"Command\":\"read\" }", requestheaders); assertEquals(HttpStatus.SC_NOT_FOUND, res.getStatusCode()); - checkErrorResponse(res.bodyAsJson(), DcCoreException.OData.NO_SUCH_ENTITY.getCode()); - } catch (DcException e) { + checkErrorResponse(res.bodyAsJson(), PersoniumCoreException.OData.NO_SUCH_ENTITY.getCode()); + } catch (PersoniumException e) { e.printStackTrace(); } } @@ -171,17 +171,17 @@ public MessageApproveTest() { String locationHeader = null; try { - DcRestAdapter rest; + PersoniumRestAdapter rest; HashMap requestheaders; String requestUrl = UrlUtils.receivedMessage(Setup.TEST_CELL1); - DcResponse res = createReceivedMessage(requestUrl, body); + PersoniumResponse res = createReceivedMessage(requestUrl, body); locationHeader = res.getFirstHeader(HttpHeaders.LOCATION); String messageId = getMessageId(res); // メッセージ承認にする - rest = new DcRestAdapter(); + rest = new PersoniumRestAdapter(); res = null; // リクエストヘッダをセット @@ -194,22 +194,22 @@ public MessageApproveTest() { res = rest.post(requestUrl, "{\"Command\":null }", requestheaders); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); - checkErrorResponse(res.bodyAsJson(), DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode()); + checkErrorResponse(res.bodyAsJson(), PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode()); // 空文字でメッセージ承認 requestUrl = UrlUtils.approvedMessage(Setup.TEST_CELL1, messageId); res = rest.post(requestUrl, "{\"Command\":\"\" }", requestheaders); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); - checkErrorResponse(res.bodyAsJson(), DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode()); + checkErrorResponse(res.bodyAsJson(), PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode()); // 不正な文字列でメッセージ承認 requestUrl = UrlUtils.approvedMessage(Setup.TEST_CELL1, messageId); res = rest.post(requestUrl, "{\"Command\":\"ABCDE\" }", requestheaders); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); - checkErrorResponse(res.bodyAsJson(), DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode()); - } catch (DcException e) { + checkErrorResponse(res.bodyAsJson(), PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode()); + } catch (PersoniumException e) { e.printStackTrace(); } finally { if (locationHeader != null) { @@ -237,17 +237,17 @@ public MessageApproveTest() { String locationHeader = null; try { - DcRestAdapter rest; + PersoniumRestAdapter rest; HashMap requestheaders; String requestUrl = UrlUtils.receivedMessage(Setup.TEST_CELL1); - DcResponse res = createReceivedMessage(requestUrl, body); + PersoniumResponse res = createReceivedMessage(requestUrl, body); locationHeader = res.getFirstHeader(HttpHeaders.LOCATION); String messageId = getMessageId(res); // メッセージ承認にする - rest = new DcRestAdapter(); + rest = new PersoniumRestAdapter(); res = null; // リクエストヘッダをセット @@ -260,15 +260,15 @@ public MessageApproveTest() { res = rest.post(requestUrl, "{\"Command\":\"approved\" }", requestheaders); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); - checkErrorResponse(res.bodyAsJson(), DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode()); + checkErrorResponse(res.bodyAsJson(), PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode()); // rejectedでメッセージ承認 requestUrl = UrlUtils.approvedMessage(Setup.TEST_CELL1, messageId); res = rest.post(requestUrl, "{\"Command\":\"rejected\" }", requestheaders); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); - checkErrorResponse(res.bodyAsJson(), DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode()); - } catch (DcException e) { + checkErrorResponse(res.bodyAsJson(), PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode()); + } catch (PersoniumException e) { e.printStackTrace(); } finally { if (locationHeader != null) { @@ -314,13 +314,13 @@ public MessageApproveTest() { // メッセージ受信を登録 String requestUrl = UrlUtils.receivedMessage(Setup.TEST_CELL1); - DcResponse res = createReceivedMessage(requestUrl, body); + PersoniumResponse res = createReceivedMessage(requestUrl, body); locationHeader = res.getFirstHeader(HttpHeaders.LOCATION); String messageId = getMessageId(res); // メッセージ承認にする - DcRestAdapter rest = new DcRestAdapter(); + PersoniumRestAdapter rest = new PersoniumRestAdapter(); // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -345,7 +345,7 @@ public MessageApproveTest() { // Statusが変更されていることを確認 checkMessageStatus(messageId, "approved"); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } finally { // Relation-ExtCell $links削除 @@ -389,14 +389,14 @@ public MessageApproveTest() { try { // メッセージ受信を登録 String requestUrl = UrlUtils.receivedMessage(Setup.TEST_CELL1); - DcResponse res = createReceivedMessage(requestUrl, body); + PersoniumResponse res = createReceivedMessage(requestUrl, body); locationHeader = res.getFirstHeader(HttpHeaders.LOCATION); // __idの取得 String messageId = getMessageId(res); // メッセージ承認にする - DcRestAdapter rest = new DcRestAdapter(); + PersoniumRestAdapter rest = new PersoniumRestAdapter(); // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -421,7 +421,7 @@ public MessageApproveTest() { // Statusが変更されていることを確認 checkMessageStatus(messageId, "approved"); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } finally { // Relation-ExtCell $links削除 @@ -480,13 +480,13 @@ public MessageApproveTest() { // メッセージ受信を登録 String requestUrl = UrlUtils.receivedMessage(Setup.TEST_CELL1); - DcResponse res = createReceivedMessage(requestUrl, body); + PersoniumResponse res = createReceivedMessage(requestUrl, body); locationHeader = res.getFirstHeader(HttpHeaders.LOCATION); String messageId = getMessageId(res); // メッセージ承認にする - DcRestAdapter rest = new DcRestAdapter(); + PersoniumRestAdapter rest = new PersoniumRestAdapter(); // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -496,9 +496,9 @@ public MessageApproveTest() { requestheaders); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); checkErrorResponse(res.bodyAsJson(), - DcCoreException.ReceiveMessage.REQUEST_RELATION_EXISTS_ERROR.getCode()); + PersoniumCoreException.ReceiveMessage.REQUEST_RELATION_EXISTS_ERROR.getCode()); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } finally { // Relation-ExtCell $links削除 @@ -542,13 +542,13 @@ public MessageApproveTest() { try { // メッセージ受信を登録 String requestUrl = UrlUtils.receivedMessage(Setup.TEST_CELL1); - DcResponse res = createReceivedMessage(requestUrl, body); + PersoniumResponse res = createReceivedMessage(requestUrl, body); locationHeader = res.getFirstHeader(HttpHeaders.LOCATION); String messageId = getMessageId(res); // メッセージ承認にする - DcRestAdapter rest = new DcRestAdapter(); + PersoniumRestAdapter rest = new PersoniumRestAdapter(); // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -564,7 +564,7 @@ public MessageApproveTest() { // Statusが変更されていることを確認 checkMessageStatus(messageId, "rejected"); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } finally { // Relation削除 @@ -603,13 +603,13 @@ public MessageApproveTest() { try { // メッセージ受信を登録 String requestUrl = UrlUtils.receivedMessage(Setup.TEST_CELL1); - DcResponse res = createReceivedMessage(requestUrl, body); + PersoniumResponse res = createReceivedMessage(requestUrl, body); locationHeader = res.getFirstHeader(HttpHeaders.LOCATION); String messageId = getMessageId(res); // メッセージ承認にする - DcRestAdapter rest = new DcRestAdapter(); + PersoniumRestAdapter rest = new PersoniumRestAdapter(); // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -620,23 +620,23 @@ public MessageApproveTest() { res = rest.post(requestUrl, "{\"Command\":null }", requestheaders); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); - checkErrorResponse(res.bodyAsJson(), DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode()); + checkErrorResponse(res.bodyAsJson(), PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode()); // 空文字でメッセージ承認 requestUrl = UrlUtils.approvedMessage(Setup.TEST_CELL1, messageId); res = rest.post(requestUrl, "{\"Command\":\"\" }", requestheaders); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); - checkErrorResponse(res.bodyAsJson(), DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode()); + checkErrorResponse(res.bodyAsJson(), PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode()); // 不正な文字列でメッセージ承認 requestUrl = UrlUtils.approvedMessage(Setup.TEST_CELL1, messageId); res = rest.post(requestUrl, "{\"Command\":\"ABCDE\" }", requestheaders); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); - checkErrorResponse(res.bodyAsJson(), DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode()); + checkErrorResponse(res.bodyAsJson(), PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode()); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } finally { // Relation削除 @@ -675,13 +675,13 @@ public MessageApproveTest() { try { // メッセージ受信を登録 String requestUrl = UrlUtils.receivedMessage(Setup.TEST_CELL1); - DcResponse res = createReceivedMessage(requestUrl, body); + PersoniumResponse res = createReceivedMessage(requestUrl, body); locationHeader = res.getFirstHeader(HttpHeaders.LOCATION); String messageId = getMessageId(res); // メッセージ承認にする - DcRestAdapter rest = new DcRestAdapter(); + PersoniumRestAdapter rest = new PersoniumRestAdapter(); // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -692,16 +692,16 @@ public MessageApproveTest() { res = rest.post(requestUrl, "{\"Command\":\"read\" }", requestheaders); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); - checkErrorResponse(res.bodyAsJson(), DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode()); + checkErrorResponse(res.bodyAsJson(), PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode()); // 不正な文字列でメッセージ承認 requestUrl = UrlUtils.approvedMessage(Setup.TEST_CELL1, messageId); res = rest.post(requestUrl, "{\"Command\":\"unread\" }", requestheaders); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); - checkErrorResponse(res.bodyAsJson(), DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode()); + checkErrorResponse(res.bodyAsJson(), PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode()); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } finally { // Relation削除 @@ -740,13 +740,13 @@ public MessageApproveTest() { try { // メッセージ受信を登録 String requestUrl = UrlUtils.receivedMessage(Setup.TEST_CELL1); - DcResponse res = createReceivedMessage(requestUrl, body); + PersoniumResponse res = createReceivedMessage(requestUrl, body); locationHeader = res.getFirstHeader(HttpHeaders.LOCATION); String messageId = getMessageId(res); // メッセージ承認にする - DcRestAdapter rest = new DcRestAdapter(); + PersoniumRestAdapter rest = new PersoniumRestAdapter(); // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -761,9 +761,9 @@ public MessageApproveTest() { res = rest.post(requestUrl, "{\"Command\":\"approved\" }", requestheaders); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); - checkErrorResponse(res.bodyAsJson(), DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode()); + checkErrorResponse(res.bodyAsJson(), PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode()); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } finally { // Relation-ExtCell $links削除 @@ -807,13 +807,13 @@ public MessageApproveTest() { try { // メッセージ受信を登録 String requestUrl = UrlUtils.receivedMessage(Setup.TEST_CELL1); - DcResponse res = createReceivedMessage(requestUrl, body); + PersoniumResponse res = createReceivedMessage(requestUrl, body); locationHeader = res.getFirstHeader(HttpHeaders.LOCATION); String messageId = getMessageId(res); // メッセージ拒否する - DcRestAdapter rest = new DcRestAdapter(); + PersoniumRestAdapter rest = new PersoniumRestAdapter(); // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -828,9 +828,9 @@ public MessageApproveTest() { res = rest.post(requestUrl, "{\"Command\":\"rejected\" }", requestheaders); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); - checkErrorResponse(res.bodyAsJson(), DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode()); + checkErrorResponse(res.bodyAsJson(), PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode()); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } finally { // Relation削除 @@ -853,7 +853,7 @@ public MessageApproveTest() { String messageId = "dummyMessageId"; // メッセージ承認にする - DcRestAdapter rest = new DcRestAdapter(); + PersoniumRestAdapter rest = new PersoniumRestAdapter(); // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -861,19 +861,19 @@ public MessageApproveTest() { // approved String requestUrl = UrlUtils.approvedMessage(Setup.TEST_CELL1, messageId); - DcResponse res = rest.post(requestUrl, "{\"Command\":\"approved\" }", + PersoniumResponse res = rest.post(requestUrl, "{\"Command\":\"approved\" }", requestheaders); assertEquals(HttpStatus.SC_NOT_FOUND, res.getStatusCode()); - checkErrorResponse(res.bodyAsJson(), DcCoreException.OData.NO_SUCH_ENTITY.getCode()); + checkErrorResponse(res.bodyAsJson(), PersoniumCoreException.OData.NO_SUCH_ENTITY.getCode()); // rejected requestUrl = UrlUtils.approvedMessage(Setup.TEST_CELL1, messageId); res = rest.post(requestUrl, "{\"Command\":\"rejected\" }", requestheaders); assertEquals(HttpStatus.SC_NOT_FOUND, res.getStatusCode()); - checkErrorResponse(res.bodyAsJson(), DcCoreException.OData.NO_SUCH_ENTITY.getCode()); + checkErrorResponse(res.bodyAsJson(), PersoniumCoreException.OData.NO_SUCH_ENTITY.getCode()); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } } @@ -905,13 +905,13 @@ public MessageApproveTest() { try { // メッセージ受信を登録 String requestUrl = UrlUtils.receivedMessage(Setup.TEST_CELL1); - DcResponse res = createReceivedMessage(requestUrl, body); + PersoniumResponse res = createReceivedMessage(requestUrl, body); locationHeader = res.getFirstHeader(HttpHeaders.LOCATION); String messageId = getMessageId(res); // メッセージ承認にする - DcRestAdapter rest = new DcRestAdapter(); + PersoniumRestAdapter rest = new PersoniumRestAdapter(); // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -921,9 +921,9 @@ public MessageApproveTest() { res = rest.post(requestUrl, "{\"Command\":\"approved\" }", requestheaders); assertEquals(HttpStatus.SC_CONFLICT, res.getStatusCode()); - checkErrorResponse(res.bodyAsJson(), DcCoreException.ReceiveMessage.REQUEST_RELATION_PARSE_ERROR.getCode()); + checkErrorResponse(res.bodyAsJson(), PersoniumCoreException.ReceiveMessage.REQUEST_RELATION_PARSE_ERROR.getCode()); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } finally { // Relation削除 @@ -962,13 +962,13 @@ public MessageApproveTest() { try { // メッセージ受信を登録 String requestUrl = UrlUtils.receivedMessage(Setup.TEST_CELL1); - DcResponse res = createReceivedMessage(requestUrl, body); + PersoniumResponse res = createReceivedMessage(requestUrl, body); locationHeader = res.getFirstHeader(HttpHeaders.LOCATION); String messageId = getMessageId(res); // メッセージ承認にする - DcRestAdapter rest = new DcRestAdapter(); + PersoniumRestAdapter rest = new PersoniumRestAdapter(); // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -979,9 +979,9 @@ public MessageApproveTest() { requestheaders); assertEquals(HttpStatus.SC_CONFLICT, res.getStatusCode()); checkErrorResponse(res.bodyAsJson(), - DcCoreException.ReceiveMessage.REQUEST_RELATION_TARGET_PARSE_ERROR.getCode()); + PersoniumCoreException.ReceiveMessage.REQUEST_RELATION_TARGET_PARSE_ERROR.getCode()); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } finally { // Relation削除 @@ -1021,14 +1021,14 @@ public MessageApproveTest() { try { // メッセージ受信を登録 String requestUrl = UrlUtils.receivedMessage(Setup.TEST_CELL1); - DcResponse res = createReceivedMessage(requestUrl, body); + PersoniumResponse res = createReceivedMessage(requestUrl, body); locationHeader = res.getFirstHeader(HttpHeaders.LOCATION); // __idの取得 String messageId = getMessageId(res); // メッセージ承認にする - DcRestAdapter rest = new DcRestAdapter(); + PersoniumRestAdapter rest = new PersoniumRestAdapter(); // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -1049,7 +1049,7 @@ public MessageApproveTest() { // 関係削除メッセージを承認する messageId = getMessageId(res); - rest = new DcRestAdapter(); + rest = new PersoniumRestAdapter(); // リクエストヘッダをセット requestheaders = new HashMap(); @@ -1073,7 +1073,7 @@ public MessageApproveTest() { // Statusが変更されていることを確認 checkMessageStatus(messageId, "approved"); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } finally { // Relation-ExtCell $links削除 @@ -1120,12 +1120,12 @@ public MessageApproveTest() { try { // 関係削除メッセージ受信 String requestUrl = UrlUtils.receivedMessage(Setup.TEST_CELL1); - DcResponse res = createReceivedMessage(requestUrl, body); + PersoniumResponse res = createReceivedMessage(requestUrl, body); breakLocationHeader = res.getFirstHeader(HttpHeaders.LOCATION); // 関係削除メッセージを承認する String messageId = getMessageId(res); - DcRestAdapter rest = new DcRestAdapter(); + PersoniumRestAdapter rest = new PersoniumRestAdapter(); // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -1137,7 +1137,7 @@ public MessageApproveTest() { // Statusが変更されていることを確認 checkMessageStatus(messageId, "none"); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } finally { // 受信メッセージ削除 @@ -1174,13 +1174,13 @@ public MessageApproveTest() { try { // メッセージ受信を登録 String requestUrl = UrlUtils.receivedMessage(Setup.TEST_CELL1); - DcResponse res = createReceivedMessage(requestUrl, body); + PersoniumResponse res = createReceivedMessage(requestUrl, body); locationHeader = res.getFirstHeader(HttpHeaders.LOCATION); String messageId = getMessageId(res); // メッセージ承認にする - DcRestAdapter rest = new DcRestAdapter(); + PersoniumRestAdapter rest = new PersoniumRestAdapter(); // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -1193,7 +1193,7 @@ public MessageApproveTest() { // Statusが変更されていることを確認 checkMessageStatus(messageId, "rejected"); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } finally { // 受信メッセージ削除 @@ -1203,9 +1203,9 @@ public MessageApproveTest() { } } - private DcResponse createReceivedMessage(String requestUrl, JSONObject body) throws DcException { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + private PersoniumResponse createReceivedMessage(String requestUrl, JSONObject body) throws PersoniumException { + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -1234,7 +1234,7 @@ private void checkMessageStatus(String messageId, String expectedStatus) { assertEquals(expectedStatus, status); } - private String getMessageId(DcResponse res) { + private String getMessageId(PersoniumResponse res) { JSONObject results = (JSONObject) ((JSONObject) res.bodyAsJson().get("d")).get("results"); String messageId = (String) results.get("__id"); return messageId; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/MessageEscapeTest.java b/src/test/java/io/personium/test/jersey/cell/MessageEscapeTest.java similarity index 90% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/MessageEscapeTest.java rename to src/test/java/io/personium/test/jersey/cell/MessageEscapeTest.java index c43a1b59c..46369e57f 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/MessageEscapeTest.java +++ b/src/test/java/io/personium/test/jersey/cell/MessageEscapeTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell; +package io.personium.test.jersey.cell; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -25,22 +25,22 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.ReceivedMessageUtils; -import com.fujitsu.dc.test.utils.SentMessageUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.ReceivedMessageUtils; +import io.personium.test.utils.SentMessageUtils; +import io.personium.test.utils.TResponse; /** * MessageAPIのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class MessageEscapeTest extends ODataCommon { @@ -54,7 +54,7 @@ public class MessageEscapeTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public MessageEscapeTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -238,8 +238,8 @@ public MessageEscapeTest() { // レスポンスボディのチェック ODataCommon.checkErrorResponseBody(response, - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR .params(UrlUtils.cellRoot(targetCell)).getMessage()); } finally { @@ -282,8 +282,8 @@ public MessageEscapeTest() { // レスポンスボディのチェック ODataCommon.checkErrorResponseBody(response, - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR .params("RequestRelation").getMessage()); } finally { @@ -327,8 +327,8 @@ public MessageEscapeTest() { // レスポンスボディのチェック ODataCommon.checkErrorResponseBody(response, - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR .params("RequestRelationTarget").getMessage()); } finally { diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/MessageListTest.java b/src/test/java/io/personium/test/jersey/cell/MessageListTest.java similarity index 95% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/MessageListTest.java rename to src/test/java/io/personium/test/jersey/cell/MessageListTest.java index cac1183ec..2ed33361a 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/MessageListTest.java +++ b/src/test/java/io/personium/test/jersey/cell/MessageListTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell; +package io.personium.test.jersey.cell; import static org.junit.Assert.assertEquals; @@ -26,22 +26,22 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.ReceivedMessageUtils; -import com.fujitsu.dc.test.utils.SentMessageUtils; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.ReceivedMessageUtils; +import io.personium.test.utils.SentMessageUtils; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; /** * MessageAPIの検索テスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class MessageListTest extends ODataCommon { @@ -57,7 +57,7 @@ public class MessageListTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public MessageListTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/MessageMethodNotAllowTest.java b/src/test/java/io/personium/test/jersey/cell/MessageMethodNotAllowTest.java similarity index 84% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/MessageMethodNotAllowTest.java rename to src/test/java/io/personium/test/jersey/cell/MessageMethodNotAllowTest.java index 79d912265..6aed5d52e 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/MessageMethodNotAllowTest.java +++ b/src/test/java/io/personium/test/jersey/cell/MessageMethodNotAllowTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell; +package io.personium.test.jersey.cell; import static org.junit.Assert.assertEquals; @@ -29,26 +29,26 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.model.ctl.ReceivedMessage; -import com.fujitsu.dc.core.model.ctl.SentMessage; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcException; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRestAdapter; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.model.ctl.ReceivedMessage; +import io.personium.core.model.ctl.SentMessage; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumException; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumRestAdapter; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * MessageAPIのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class MessageMethodNotAllowTest extends ODataCommon { @@ -56,7 +56,7 @@ public class MessageMethodNotAllowTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public MessageMethodNotAllowTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -77,20 +77,20 @@ public MessageMethodNotAllowTest() { String locationHeader = null; try { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); // TODO Authorizationヘッダ - requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + DcCoreConfig.getMasterToken()); + requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + PersoniumUnitConfig.getMasterToken()); try { String requestUrl = UrlUtils.receivedMessageCtl(Setup.TEST_CELL1); res = rest.post(requestUrl, body.toJSONString(), requestheaders); assertEquals(HttpStatus.SC_METHOD_NOT_ALLOWED, res.getStatusCode()); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } @@ -119,20 +119,20 @@ public MessageMethodNotAllowTest() { String locationHeader = null; try { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); // TODO Authorizationヘッダ - requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + DcCoreConfig.getMasterToken()); + requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + PersoniumUnitConfig.getMasterToken()); try { String requestUrl = UrlUtils.receivedMessageCtl(Setup.TEST_CELL1); res = rest.put(requestUrl, body.toJSONString(), requestheaders); assertEquals(HttpStatus.SC_METHOD_NOT_ALLOWED, res.getStatusCode()); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } @@ -164,7 +164,7 @@ public MessageMethodNotAllowTest() { // リクエストヘッダをセット HashMap requestheaders = new HashMap(); // TODO Authorizationヘッダ - requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + DcCoreConfig.getMasterToken()); + requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + PersoniumUnitConfig.getMasterToken()); // マージリクエスト実行 String requestUrl = ReceivedMessage.EDM_TYPE_NAME; @@ -196,20 +196,20 @@ public MessageMethodNotAllowTest() { String locationHeader = null; try { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); // TODO Authorizationヘッダ - requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + DcCoreConfig.getMasterToken()); + requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + PersoniumUnitConfig.getMasterToken()); try { String requestUrl = UrlUtils.receivedMessageCtl(Setup.TEST_CELL1, "MessageId"); res = rest.post(requestUrl, body.toJSONString(), requestheaders); assertEquals(HttpStatus.SC_METHOD_NOT_ALLOWED, res.getStatusCode()); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } @@ -238,20 +238,20 @@ public MessageMethodNotAllowTest() { String locationHeader = null; try { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); // TODO Authorizationヘッダ - requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + DcCoreConfig.getMasterToken()); + requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + PersoniumUnitConfig.getMasterToken()); try { String requestUrl = UrlUtils.receivedMessageCtl(Setup.TEST_CELL1, "MessageId"); res = rest.put(requestUrl, body.toJSONString(), requestheaders); assertEquals(HttpStatus.SC_METHOD_NOT_ALLOWED, res.getStatusCode()); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } @@ -283,7 +283,7 @@ public MessageMethodNotAllowTest() { // リクエストヘッダをセット HashMap requestheaders = new HashMap(); // TODO Authorizationヘッダ - requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + DcCoreConfig.getMasterToken()); + requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + PersoniumUnitConfig.getMasterToken()); // マージリクエスト実行 String requestUrl = ReceivedMessage.EDM_TYPE_NAME + "('MessageId')"; @@ -315,20 +315,20 @@ public MessageMethodNotAllowTest() { String locationHeader = null; try { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); // TODO Authorizationヘッダ - requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + DcCoreConfig.getMasterToken()); + requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + PersoniumUnitConfig.getMasterToken()); try { String requestUrl = UrlUtils.sentMessageCtl(Setup.TEST_CELL1); res = rest.post(requestUrl, body.toJSONString(), requestheaders); assertEquals(HttpStatus.SC_METHOD_NOT_ALLOWED, res.getStatusCode()); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } @@ -357,20 +357,20 @@ public MessageMethodNotAllowTest() { String locationHeader = null; try { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); // TODO Authorizationヘッダ - requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + DcCoreConfig.getMasterToken()); + requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + PersoniumUnitConfig.getMasterToken()); try { String requestUrl = UrlUtils.sentMessageCtl(Setup.TEST_CELL1); res = rest.put(requestUrl, body.toJSONString(), requestheaders); assertEquals(HttpStatus.SC_METHOD_NOT_ALLOWED, res.getStatusCode()); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } @@ -402,7 +402,7 @@ public MessageMethodNotAllowTest() { // リクエストヘッダをセット HashMap requestheaders = new HashMap(); // TODO Authorizationヘッダ - requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + DcCoreConfig.getMasterToken()); + requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + PersoniumUnitConfig.getMasterToken()); // マージリクエスト実行 String requestUrl = SentMessage.EDM_TYPE_NAME; @@ -434,20 +434,20 @@ public MessageMethodNotAllowTest() { String locationHeader = null; try { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); // TODO Authorizationヘッダ - requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + DcCoreConfig.getMasterToken()); + requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + PersoniumUnitConfig.getMasterToken()); try { String requestUrl = UrlUtils.sentMessageCtl(Setup.TEST_CELL1, "MessageId"); res = rest.post(requestUrl, body.toJSONString(), requestheaders); assertEquals(HttpStatus.SC_METHOD_NOT_ALLOWED, res.getStatusCode()); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } @@ -476,20 +476,20 @@ public MessageMethodNotAllowTest() { String locationHeader = null; try { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); // TODO Authorizationヘッダ - requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + DcCoreConfig.getMasterToken()); + requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + PersoniumUnitConfig.getMasterToken()); try { String requestUrl = UrlUtils.sentMessageCtl(Setup.TEST_CELL1, "MessageId"); res = rest.put(requestUrl, body.toJSONString(), requestheaders); assertEquals(HttpStatus.SC_METHOD_NOT_ALLOWED, res.getStatusCode()); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } @@ -521,7 +521,7 @@ public MessageMethodNotAllowTest() { // リクエストヘッダをセット HashMap requestheaders = new HashMap(); // TODO Authorizationヘッダ - requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + DcCoreConfig.getMasterToken()); + requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + PersoniumUnitConfig.getMasterToken()); // マージリクエスト実行 String requestUrl = SentMessage.EDM_TYPE_NAME + "('MessageId')"; @@ -545,7 +545,7 @@ private TResponse mergeRequest(String path, String ifMatch, JSONObject updateReq .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) .with("ifMatch", ifMatch) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("body", updateReqBody.toJSONString()) .returns() .debug(); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/MessageReceivedTest.java b/src/test/java/io/personium/test/jersey/cell/MessageReceivedTest.java similarity index 83% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/MessageReceivedTest.java rename to src/test/java/io/personium/test/jersey/cell/MessageReceivedTest.java index 7f41c5a27..c02bc76ab 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/MessageReceivedTest.java +++ b/src/test/java/io/personium/test/jersey/cell/MessageReceivedTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell; +package io.personium.test.jersey.cell; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -31,37 +31,37 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.common.auth.token.Role; -import com.fujitsu.dc.common.auth.token.TransCellAccessToken; -import com.fujitsu.dc.core.DcCoreAuthzException; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.Account; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.model.ctl.ReceivedMessage; -import com.fujitsu.dc.core.model.ctl.ReceivedMessagePort; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DaoException; -import com.fujitsu.dc.test.jersey.DcException; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRestAdapter; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.ReceivedMessageUtils; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.SentMessageUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.common.auth.token.Role; +import io.personium.common.auth.token.TransCellAccessToken; +import io.personium.core.PersoniumCoreAuthzException; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.Account; +import io.personium.core.model.ctl.Common; +import io.personium.core.model.ctl.ReceivedMessage; +import io.personium.core.model.ctl.ReceivedMessagePort; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.DaoException; +import io.personium.test.jersey.PersoniumException; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumRestAdapter; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.ReceivedMessageUtils; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.SentMessageUtils; +import io.personium.test.utils.TResponse; /** * MessageAPIのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class MessageReceivedTest extends ODataCommon { @@ -69,7 +69,7 @@ public class MessageReceivedTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public MessageReceivedTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -91,8 +91,8 @@ public MessageReceivedTest() { String locationHeader = null; try { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -122,7 +122,7 @@ public MessageReceivedTest() { checkResponseBody(json, locationHeader, Common.EDM_NS_CELL_CTL + "." + ReceivedMessagePort.EDM_TYPE_NAME, expected); System.out.println(json.toJSONString()); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } @@ -148,8 +148,8 @@ public MessageReceivedTest() { body.put("Priority", 3); body.put("Status", "unread"); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -163,10 +163,10 @@ public MessageReceivedTest() { requestheaders); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); checkErrorResponse(res.bodyAsJson(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), - DcCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params( + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.getCode(), + PersoniumCoreException.OData.INPUT_REQUIRED_FIELD_MISSING.params( ReceivedMessage.P_ID.getName()).getMessage()); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } } @@ -187,13 +187,13 @@ public MessageReceivedTest() { body.put("Priority", 3); body.put("Status", "unread"); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); // Authorizationヘッダ - requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + DcCoreConfig.getMasterToken()); + requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + PersoniumUnitConfig.getMasterToken()); try { String requestUrl = UrlUtils.receivedMessage(Setup.TEST_CELL1); @@ -201,9 +201,9 @@ public MessageReceivedTest() { requestheaders); assertEquals(HttpStatus.SC_FORBIDDEN, res.getStatusCode()); checkErrorResponse(res.bodyAsJson(), - DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING.getCode(), - DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING.getMessage()); - } catch (DcException e) { + PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING.getCode(), + PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING.getMessage()); + } catch (PersoniumException e) { e.printStackTrace(); } @@ -225,8 +225,8 @@ public MessageReceivedTest() { body.put("Priority", 3); body.put("Status", "unread"); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -237,9 +237,9 @@ public MessageReceivedTest() { requestheaders); assertEquals(HttpStatus.SC_UNAUTHORIZED, res.getStatusCode()); checkErrorResponse(res.bodyAsJson(), - DcCoreAuthzException.AUTHORIZATION_REQUIRED.getCode(), - DcCoreAuthzException.AUTHORIZATION_REQUIRED.getMessage()); - } catch (DcException e) { + PersoniumCoreAuthzException.AUTHORIZATION_REQUIRED.getCode(), + PersoniumCoreAuthzException.AUTHORIZATION_REQUIRED.getMessage()); + } catch (PersoniumException e) { e.printStackTrace(); } } @@ -260,8 +260,8 @@ public MessageReceivedTest() { body.put("Priority", 3); body.put("Status", "unread"); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -274,9 +274,9 @@ public MessageReceivedTest() { requestheaders); assertEquals(HttpStatus.SC_UNAUTHORIZED, res.getStatusCode()); checkErrorResponse(res.bodyAsJson(), - DcCoreAuthzException.TOKEN_PARSE_ERROR.getCode(), - DcCoreAuthzException.TOKEN_PARSE_ERROR.getMessage()); - } catch (DcException e) { + PersoniumCoreAuthzException.TOKEN_PARSE_ERROR.getCode(), + PersoniumCoreAuthzException.TOKEN_PARSE_ERROR.getMessage()); + } catch (PersoniumException e) { e.printStackTrace(); } } @@ -297,8 +297,8 @@ public MessageReceivedTest() { body.put("Priority", 3); body.put("Status", "unread"); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -316,10 +316,10 @@ public MessageReceivedTest() { requestheaders); assertEquals(HttpStatus.SC_FORBIDDEN, res.getStatusCode()); checkErrorResponse(res.bodyAsJson(), - DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING.getCode(), - DcCoreException.Auth.NECESSARY_PRIVILEGE_LACKING.getMessage()); + PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING.getCode(), + PersoniumCoreException.Auth.NECESSARY_PRIVILEGE_LACKING.getMessage()); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } @@ -341,7 +341,7 @@ public MessageReceivedTest() { body.put("Priority", 3); body.put("Status", "none"); - DcRestAdapter rest = new DcRestAdapter(); + PersoniumRestAdapter rest = new PersoniumRestAdapter(); // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -351,14 +351,14 @@ public MessageReceivedTest() { try { String requestUrl = UrlUtils.receivedMessage(Setup.TEST_CELL1); - DcResponse res = rest.post(requestUrl, body.toJSONString(), + PersoniumResponse res = rest.post(requestUrl, body.toJSONString(), requestheaders); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); checkErrorResponse(res.bodyAsJson(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params( ReceivedMessage.P_STATUS.getName()).getMessage()); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } } @@ -386,8 +386,8 @@ public MessageReceivedTest() { String locationHeader = null; try { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -419,7 +419,7 @@ public MessageReceivedTest() { + ReceivedMessagePort.EDM_TYPE_NAME, expected); System.out.println(json.toJSONString()); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } @@ -437,10 +437,10 @@ public MessageReceivedTest() { @Test public final void 受信メッセージの一覧取得ができること() { - DcRestAdapter rest1 = new DcRestAdapter(); - DcRestAdapter rest2 = new DcRestAdapter(); - DcResponse res1 = null; - DcResponse res2 = null; + PersoniumRestAdapter rest1 = new PersoniumRestAdapter(); + PersoniumRestAdapter rest2 = new PersoniumRestAdapter(); + PersoniumResponse res1 = null; + PersoniumResponse res2 = null; // リクエストボディ1作成 JSONObject body1 = new JSONObject(); @@ -486,7 +486,7 @@ public MessageReceivedTest() { JSONArray results = (JSONArray) ((JSONObject) listresponse.bodyAsJson().get("d")).get("results"); assertEquals(2, results.size()); // TODO レスポンスボディのチェック - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } finally { if (res1 != null) { @@ -506,8 +506,8 @@ public MessageReceivedTest() { @Test public final void 受信メッセージの一件取得ができること() { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストボディ作成 JSONObject body = new JSONObject(); @@ -537,7 +537,7 @@ public MessageReceivedTest() { // 送信メッセージの一件取得 ReceivedMessageUtils.get(MASTER_TOKEN_NAME, Setup.TEST_CELL1, HttpStatus.SC_OK, id); // TODO レスポンスボディのチェック - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } finally { if (res != null) { @@ -553,8 +553,8 @@ public MessageReceivedTest() { @Test public final void 受信メッセージの削除ができること() { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; String id = null; // リクエストボディ作成 @@ -582,7 +582,7 @@ public MessageReceivedTest() { // __idの取得 JSONObject results = (JSONObject) ((JSONObject) res.bodyAsJson().get("d")).get("results"); id = (String) results.get("__id"); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } finally { if (res != null) { @@ -602,14 +602,14 @@ public MessageReceivedTest() { String locationHeader = null; String messageId = null; String accountName = "account1"; - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); try { // 受信メッセージの作成 - DcResponse messageResponse = createReceivedMessage(); + PersoniumResponse messageResponse = createReceivedMessage(); locationHeader = messageResponse.getFirstHeader(HttpHeaders.LOCATION); messageId = getId(messageResponse); @@ -623,12 +623,12 @@ public MessageReceivedTest() { assertEquals(HttpStatus.SC_NO_CONTENT, res.getStatusCode()); // $links取得 - rest = new DcRestAdapter(); + rest = new PersoniumRestAdapter(); res = null; res = rest.getAcceptEncodingGzip(requestUrl, requestheaders); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } finally { // $links削除 @@ -637,10 +637,10 @@ public MessageReceivedTest() { Setup.TEST_CELL1, ReceivedMessage.EDM_TYPE_NAME, messageId, ReceivedMessage.EDM_NPNAME_FOR_ACCOUNT, accountName); try { - rest = new DcRestAdapter(); + rest = new PersoniumRestAdapter(); res = null; res = rest.del(requestUrl, requestheaders); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } assertEquals(HttpStatus.SC_NO_CONTENT, res.getStatusCode()); @@ -660,14 +660,14 @@ public MessageReceivedTest() { String locationHeader = null; String messageId = null; String accountName = "account1"; - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); try { // 受信メッセージの作成 - DcResponse messageResponse = createReceivedMessage(); + PersoniumResponse messageResponse = createReceivedMessage(); locationHeader = messageResponse.getFirstHeader(HttpHeaders.LOCATION); messageId = getId(messageResponse); @@ -679,7 +679,7 @@ public MessageReceivedTest() { body.put("uri", UrlUtils.cellCtl(Setup.TEST_CELL1, Account.EDM_TYPE_NAME, accountName)); res = rest.post(requestUrl, body.toJSONString(), requestheaders); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } finally { if (locationHeader != null) { @@ -697,14 +697,14 @@ public MessageReceivedTest() { String locationHeader = null; String messageId = null; String accountName = "account1"; - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); try { // 受信メッセージの作成 - DcResponse messageResponse = createReceivedMessage(); + PersoniumResponse messageResponse = createReceivedMessage(); locationHeader = messageResponse.getFirstHeader(HttpHeaders.LOCATION); messageId = getId(messageResponse); @@ -718,12 +718,12 @@ public MessageReceivedTest() { assertEquals(HttpStatus.SC_NO_CONTENT, res.getStatusCode()); // $links取得 - rest = new DcRestAdapter(); + rest = new PersoniumRestAdapter(); res = null; res = rest.getAcceptEncodingGzip(requestUrl, requestheaders); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } finally { // $links削除 @@ -732,10 +732,10 @@ public MessageReceivedTest() { Setup.TEST_CELL1, Account.EDM_TYPE_NAME, accountName, Account.EDM_NPNAME_FOR_RECEIVED_MESSAGE, messageId); try { - rest = new DcRestAdapter(); + rest = new PersoniumRestAdapter(); res = null; res = rest.del(requestUrl, requestheaders); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } assertEquals(HttpStatus.SC_NO_CONTENT, res.getStatusCode()); @@ -796,21 +796,21 @@ public MessageReceivedTest() { receiveAccountName)); try { - DcRestAdapter restAdapterForCreateLink = new DcRestAdapter(); - DcResponse linkCreateResponse = restAdapterForCreateLink.post(requestUrl, + PersoniumRestAdapter restAdapterForCreateLink = new PersoniumRestAdapter(); + PersoniumResponse linkCreateResponse = restAdapterForCreateLink.post(requestUrl, bodyForCreateLink.toJSONString(), requestheaders); assertEquals(HttpStatus.SC_NO_CONTENT, linkCreateResponse.getStatusCode()); - } catch (DcException ex) { + } catch (PersoniumException ex) { fail(); } // $links取得 try { - DcRestAdapter restAdapterForGetLink = new DcRestAdapter(); - DcResponse linkRetreiveResponse = restAdapterForGetLink.getAcceptEncodingGzip( + PersoniumRestAdapter restAdapterForGetLink = new PersoniumRestAdapter(); + PersoniumResponse linkRetreiveResponse = restAdapterForGetLink.getAcceptEncodingGzip( requestUrl, requestheaders); assertEquals(HttpStatus.SC_OK, linkRetreiveResponse.getStatusCode()); - } catch (DcException ex) { + } catch (PersoniumException ex) { fail(); } @@ -820,10 +820,10 @@ public MessageReceivedTest() { messageReceivedCell, ReceivedMessage.EDM_TYPE_NAME, messageId, ReceivedMessage.EDM_NPNAME_FOR_ACCOUNT, receiveAccountName); try { - DcRestAdapter restAdapterForDeleteLink = new DcRestAdapter(); - DcResponse linkDeleteResponse = restAdapterForDeleteLink.del(linkDeleteRequestUrl, requestheaders); + PersoniumRestAdapter restAdapterForDeleteLink = new PersoniumRestAdapter(); + PersoniumResponse linkDeleteResponse = restAdapterForDeleteLink.del(linkDeleteRequestUrl, requestheaders); assertEquals(HttpStatus.SC_NO_CONTENT, linkDeleteResponse.getStatusCode()); - } catch (DcException e) { + } catch (PersoniumException e) { fail(); } } @@ -887,21 +887,21 @@ public MessageReceivedTest() { receiveAccountName)); try { - DcRestAdapter restAdapterForCreateLink = new DcRestAdapter(); - DcResponse linkCreateResponse = restAdapterForCreateLink.post(requestUrl, + PersoniumRestAdapter restAdapterForCreateLink = new PersoniumRestAdapter(); + PersoniumResponse linkCreateResponse = restAdapterForCreateLink.post(requestUrl, bodyForCreateLink.toJSONString(), requestheaders); assertEquals(HttpStatus.SC_NO_CONTENT, linkCreateResponse.getStatusCode()); - } catch (DcException ex) { + } catch (PersoniumException ex) { fail(); } // $links取得 try { - DcRestAdapter restAdapterForGetLink = new DcRestAdapter(); - DcResponse linkRetreiveResponse = restAdapterForGetLink.getAcceptEncodingGzip(requestUrl, + PersoniumRestAdapter restAdapterForGetLink = new PersoniumRestAdapter(); + PersoniumResponse linkRetreiveResponse = restAdapterForGetLink.getAcceptEncodingGzip(requestUrl, requestheaders); assertEquals(HttpStatus.SC_OK, linkRetreiveResponse.getStatusCode()); - } catch (DcException ex) { + } catch (PersoniumException ex) { fail(); } @@ -911,10 +911,10 @@ public MessageReceivedTest() { messageReceivedCell, ReceivedMessage.EDM_TYPE_NAME, messageId, ReceivedMessage.EDM_NPNAME_FOR_ACCOUNT, receiveAccountName); try { - DcRestAdapter restAdapterForDeleteLink = new DcRestAdapter(); - DcResponse linkDeleteResponse = restAdapterForDeleteLink.del(linkDeleteRequestUrl, requestheaders); + PersoniumRestAdapter restAdapterForDeleteLink = new PersoniumRestAdapter(); + PersoniumResponse linkDeleteResponse = restAdapterForDeleteLink.del(linkDeleteRequestUrl, requestheaders); assertEquals(HttpStatus.SC_NO_CONTENT, linkDeleteResponse.getStatusCode()); - } catch (DcException e) { + } catch (PersoniumException e) { fail(); } } @@ -978,11 +978,11 @@ public MessageReceivedTest() { receiveAccountName)); try { - DcRestAdapter restAdapterForCreateLink = new DcRestAdapter(); - DcResponse linkCreateResponse = restAdapterForCreateLink.post(requestUrl, + PersoniumRestAdapter restAdapterForCreateLink = new PersoniumRestAdapter(); + PersoniumResponse linkCreateResponse = restAdapterForCreateLink.post(requestUrl, bodyForCreateLink.toJSONString(), requestheaders); assertEquals(HttpStatus.SC_FORBIDDEN, linkCreateResponse.getStatusCode()); - } catch (DcException ex) { + } catch (PersoniumException ex) { fail(); } } finally { @@ -1046,21 +1046,21 @@ public MessageReceivedTest() { messageId)); try { - DcRestAdapter restAdapterForCreateLink = new DcRestAdapter(); - DcResponse linkCreateResponse = restAdapterForCreateLink.post(requestUrl, + PersoniumRestAdapter restAdapterForCreateLink = new PersoniumRestAdapter(); + PersoniumResponse linkCreateResponse = restAdapterForCreateLink.post(requestUrl, bodyForCreateLink.toJSONString(), requestheaders); assertEquals(HttpStatus.SC_NO_CONTENT, linkCreateResponse.getStatusCode()); - } catch (DcException ex) { + } catch (PersoniumException ex) { fail(); } // $links取得 try { - DcRestAdapter restAdapterForGetLink = new DcRestAdapter(); - DcResponse linkRetreiveResponse = restAdapterForGetLink.getAcceptEncodingGzip(requestUrl, + PersoniumRestAdapter restAdapterForGetLink = new PersoniumRestAdapter(); + PersoniumResponse linkRetreiveResponse = restAdapterForGetLink.getAcceptEncodingGzip(requestUrl, requestheaders); assertEquals(HttpStatus.SC_OK, linkRetreiveResponse.getStatusCode()); - } catch (DcException ex) { + } catch (PersoniumException ex) { fail(); } @@ -1070,10 +1070,10 @@ public MessageReceivedTest() { messageReceivedCell, ReceivedMessage.EDM_TYPE_NAME, messageId, ReceivedMessage.EDM_NPNAME_FOR_ACCOUNT, receiveAccountName); try { - DcRestAdapter restAdapterForDeleteLink = new DcRestAdapter(); - DcResponse linkDeleteResponse = restAdapterForDeleteLink.del(linkDeleteRequestUrl, requestheaders); + PersoniumRestAdapter restAdapterForDeleteLink = new PersoniumRestAdapter(); + PersoniumResponse linkDeleteResponse = restAdapterForDeleteLink.del(linkDeleteRequestUrl, requestheaders); assertEquals(HttpStatus.SC_NO_CONTENT, linkDeleteResponse.getStatusCode()); - } catch (DcException e) { + } catch (PersoniumException e) { fail(); } } @@ -1138,21 +1138,21 @@ public MessageReceivedTest() { ReceivedMessage.EDM_TYPE_NAME, messageId)); try { - DcRestAdapter restAdapterForCreateLink = new DcRestAdapter(); - DcResponse linkCreateResponse = restAdapterForCreateLink.post(requestUrl, + PersoniumRestAdapter restAdapterForCreateLink = new PersoniumRestAdapter(); + PersoniumResponse linkCreateResponse = restAdapterForCreateLink.post(requestUrl, bodyForCreateLink.toJSONString(), requestheaders); assertEquals(HttpStatus.SC_NO_CONTENT, linkCreateResponse.getStatusCode()); - } catch (DcException ex) { + } catch (PersoniumException ex) { fail(); } // $links取得 try { - DcRestAdapter restAdapterForGetLink = new DcRestAdapter(); - DcResponse linkRetreiveResponse = restAdapterForGetLink.getAcceptEncodingGzip(requestUrl, + PersoniumRestAdapter restAdapterForGetLink = new PersoniumRestAdapter(); + PersoniumResponse linkRetreiveResponse = restAdapterForGetLink.getAcceptEncodingGzip(requestUrl, requestheaders); assertEquals(HttpStatus.SC_OK, linkRetreiveResponse.getStatusCode()); - } catch (DcException ex) { + } catch (PersoniumException ex) { fail(); } @@ -1162,10 +1162,10 @@ public MessageReceivedTest() { messageReceivedCell, ReceivedMessage.EDM_TYPE_NAME, messageId, ReceivedMessage.EDM_NPNAME_FOR_ACCOUNT, receiveAccountName); try { - DcRestAdapter restAdapterForDeleteLink = new DcRestAdapter(); - DcResponse linkDeleteResponse = restAdapterForDeleteLink.del(linkDeleteRequestUrl, requestheaders); + PersoniumRestAdapter restAdapterForDeleteLink = new PersoniumRestAdapter(); + PersoniumResponse linkDeleteResponse = restAdapterForDeleteLink.del(linkDeleteRequestUrl, requestheaders); assertEquals(HttpStatus.SC_NO_CONTENT, linkDeleteResponse.getStatusCode()); - } catch (DcException e) { + } catch (PersoniumException e) { fail(); } } @@ -1230,11 +1230,11 @@ public MessageReceivedTest() { ReceivedMessage.EDM_TYPE_NAME, messageId)); try { - DcRestAdapter restAdapterForCreateLink = new DcRestAdapter(); - DcResponse linkCreateResponse = restAdapterForCreateLink.post(requestUrl, + PersoniumRestAdapter restAdapterForCreateLink = new PersoniumRestAdapter(); + PersoniumResponse linkCreateResponse = restAdapterForCreateLink.post(requestUrl, bodyForCreateLink.toJSONString(), requestheaders); assertEquals(HttpStatus.SC_FORBIDDEN, linkCreateResponse.getStatusCode()); - } catch (DcException ex) { + } catch (PersoniumException ex) { fail(); } } finally { @@ -1256,14 +1256,14 @@ public MessageReceivedTest() { String locationHeader = null; String messageId = null; String accountName = "account1"; - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); try { // 受信メッセージの作成 - DcResponse messageResponse = createReceivedMessage(); + PersoniumResponse messageResponse = createReceivedMessage(); locationHeader = messageResponse.getFirstHeader(HttpHeaders.LOCATION); messageId = getId(messageResponse); @@ -1277,7 +1277,7 @@ public MessageReceivedTest() { assertEquals(HttpStatus.SC_NO_CONTENT, res.getStatusCode()); // ReceivedMessage基準 NavigationProperty経由 - rest = new DcRestAdapter(); + rest = new PersoniumRestAdapter(); requestUrl = UrlUtils.cellCtlNagvigationProperty( Setup.TEST_CELL1, ReceivedMessage.EDM_TYPE_NAME, messageId, ReceivedMessage.EDM_NPNAME_FOR_ACCOUNT); @@ -1285,14 +1285,14 @@ public MessageReceivedTest() { assertEquals(HttpStatus.SC_OK, res.getStatusCode()); // Account基準 NavigationProperty経由 - rest = new DcRestAdapter(); + rest = new PersoniumRestAdapter(); requestUrl = UrlUtils.cellCtlNagvigationProperty( Setup.TEST_CELL1, Account.EDM_TYPE_NAME, accountName, Account.EDM_NPNAME_FOR_RECEIVED_MESSAGE); res = rest.getAcceptEncodingGzip(requestUrl, requestheaders); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } finally { // $links削除 @@ -1301,10 +1301,10 @@ public MessageReceivedTest() { Setup.TEST_CELL1, ReceivedMessage.EDM_TYPE_NAME, messageId, ReceivedMessage.EDM_NPNAME_FOR_ACCOUNT, accountName); try { - rest = new DcRestAdapter(); + rest = new PersoniumRestAdapter(); res = null; res = rest.del(requestUrl, requestheaders); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } assertEquals(HttpStatus.SC_NO_CONTENT, res.getStatusCode()); @@ -1324,14 +1324,14 @@ public MessageReceivedTest() { String locationHeader = null; String messageId = null; String accountName = "account1"; - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); try { // 受信メッセージの作成 - DcResponse messageResponse = createReceivedMessage(); + PersoniumResponse messageResponse = createReceivedMessage(); locationHeader = messageResponse.getFirstHeader(HttpHeaders.LOCATION); messageId = getId(messageResponse); @@ -1345,7 +1345,7 @@ public MessageReceivedTest() { assertEquals(HttpStatus.SC_NO_CONTENT, res.getStatusCode()); // ReceivedMessage取得 - rest = new DcRestAdapter(); + rest = new PersoniumRestAdapter(); requestUrl = UrlUtils.cellCtl(Setup.TEST_CELL1, ReceivedMessage.EDM_TYPE_NAME) + "?$format=json&$expand=" + ReceivedMessage.EDM_NPNAME_FOR_ACCOUNT; res = rest.getAcceptEncodingGzip(requestUrl, requestheaders); @@ -1358,7 +1358,7 @@ public MessageReceivedTest() { assertEquals(HttpStatus.SC_OK, res.getStatusCode()); // Account取得 - rest = new DcRestAdapter(); + rest = new PersoniumRestAdapter(); requestUrl = UrlUtils.cellCtl(Setup.TEST_CELL1, Account.EDM_TYPE_NAME) + "?$format=json&$expand=" + Account.EDM_NPNAME_FOR_RECEIVED_MESSAGE; res = rest.getAcceptEncodingGzip(requestUrl, requestheaders); @@ -1370,7 +1370,7 @@ public MessageReceivedTest() { } assertEquals(HttpStatus.SC_OK, res.getStatusCode()); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } finally { // $links削除 @@ -1379,10 +1379,10 @@ public MessageReceivedTest() { Setup.TEST_CELL1, ReceivedMessage.EDM_TYPE_NAME, messageId, ReceivedMessage.EDM_NPNAME_FOR_ACCOUNT, accountName); try { - rest = new DcRestAdapter(); + rest = new PersoniumRestAdapter(); res = null; res = rest.del(requestUrl, requestheaders); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } assertEquals(HttpStatus.SC_NO_CONTENT, res.getStatusCode()); @@ -1418,13 +1418,13 @@ public MessageReceivedTest() { } } - private String getId(DcResponse response) { + private String getId(PersoniumResponse response) { JSONObject result = (JSONObject) ((JSONObject) response.bodyAsJson().get("d")).get("results"); return (String) result.get("__id"); } @SuppressWarnings("unchecked") - private DcResponse createReceivedMessage() { + private PersoniumResponse createReceivedMessage() { JSONObject body = new JSONObject(); body.put("__id", "12345678901234567890123456789012"); body.put("From", UrlUtils.cellRoot(Setup.TEST_CELL2)); @@ -1434,8 +1434,8 @@ private DcResponse createReceivedMessage() { body.put("Priority", 3); body.put("Status", "unread"); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -1447,7 +1447,7 @@ private DcResponse createReceivedMessage() { String requestUrl = UrlUtils.receivedMessage(Setup.TEST_CELL1); res = rest.post(requestUrl, body.toJSONString(), requestheaders); assertEquals(HttpStatus.SC_CREATED, res.getStatusCode()); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } return res; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/MessageSentTest.java b/src/test/java/io/personium/test/jersey/cell/MessageSentTest.java similarity index 93% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/MessageSentTest.java rename to src/test/java/io/personium/test/jersey/cell/MessageSentTest.java index 21f9a5eda..ec73b6308 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/MessageSentTest.java +++ b/src/test/java/io/personium/test/jersey/cell/MessageSentTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell; +package io.personium.test.jersey.cell; import static org.junit.Assert.assertEquals; @@ -25,27 +25,27 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.model.ctl.ReceivedMessagePort; -import com.fujitsu.dc.core.model.ctl.SentMessage; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.ReceivedMessageUtils; -import com.fujitsu.dc.test.utils.RelationUtils; -import com.fujitsu.dc.test.utils.SentMessageUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.Common; +import io.personium.core.model.ctl.ReceivedMessagePort; +import io.personium.core.model.ctl.SentMessage; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.ReceivedMessageUtils; +import io.personium.test.utils.RelationUtils; +import io.personium.test.utils.SentMessageUtils; +import io.personium.test.utils.TResponse; /** * MessageAPIのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class MessageSentTest extends ODataCommon { @@ -61,7 +61,7 @@ public class MessageSentTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public MessageSentTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -300,9 +300,9 @@ public MessageSentTest() { response = SentMessageUtils.sent(MASTER_TOKEN_NAME, TEST_CELL1, body.toJSONString(), HttpStatus.SC_BAD_REQUEST); // エラーメッセージチェック - String code = DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(); + String code = PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(); String detail = SentMessage.P_TO.getName() + "," + SentMessage.P_TO_RELATION.getName(); - String message = DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(detail).getMessage(); + String message = PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params(detail).getMessage(); checkErrorResponse(response.bodyAsJson(), code, message); } finally { @@ -725,8 +725,8 @@ public MessageSentTest() { response = SentMessageUtils.sent(MASTER_TOKEN_NAME, TEST_CELL1, body.toJSONString(), HttpStatus.SC_BAD_REQUEST); // エラーメッセージチェック - String code = DcCoreException.SentMessage.TO_RELATION_NOT_FOUND_ERROR.getCode(); - String message = DcCoreException.SentMessage.TO_RELATION_NOT_FOUND_ERROR.params("norelation").getMessage(); + String code = PersoniumCoreException.SentMessage.TO_RELATION_NOT_FOUND_ERROR.getCode(); + String message = PersoniumCoreException.SentMessage.TO_RELATION_NOT_FOUND_ERROR.params("norelation").getMessage(); checkErrorResponse(response.bodyAsJson(), code, message); } finally { @@ -770,8 +770,8 @@ public MessageSentTest() { response = SentMessageUtils.sent(MASTER_TOKEN_NAME, TEST_CELL1, body.toJSONString(), HttpStatus.SC_BAD_REQUEST); // エラーメッセージチェック - String code = DcCoreException.SentMessage.RELATED_EXTCELL_NOT_FOUND_ERROR.getCode(); - String message = DcCoreException.SentMessage.RELATED_EXTCELL_NOT_FOUND_ERROR.params("noExtCellRelation") + String code = PersoniumCoreException.SentMessage.RELATED_EXTCELL_NOT_FOUND_ERROR.getCode(); + String message = PersoniumCoreException.SentMessage.RELATED_EXTCELL_NOT_FOUND_ERROR.params("noExtCellRelation") .getMessage(); checkErrorResponse(response.bodyAsJson(), code, message); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/PropPatchTest.java b/src/test/java/io/personium/test/jersey/cell/PropPatchTest.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/PropPatchTest.java rename to src/test/java/io/personium/test/jersey/cell/PropPatchTest.java index d6bd10cce..59f5988b7 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/PropPatchTest.java +++ b/src/test/java/io/personium/test/jersey/cell/PropPatchTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell; +package io.personium.test.jersey.cell; import static org.junit.Assert.assertEquals; @@ -29,14 +29,14 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; /** @@ -52,7 +52,7 @@ public class PropPatchTest extends JerseyTest { * コンストラクタ. */ public PropPatchTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ReadListTest.java b/src/test/java/io/personium/test/jersey/cell/ReadListTest.java similarity index 81% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ReadListTest.java rename to src/test/java/io/personium/test/jersey/cell/ReadListTest.java index 7131c13cd..3103e68cf 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ReadListTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ReadListTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell; +package io.personium.test.jersey.cell; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -33,14 +33,14 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.core.model.Cell; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; /** * Cellの作成のIT. @@ -64,7 +64,7 @@ public class ReadListTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public ReadListTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -93,7 +93,7 @@ private void cellCreate(int num) { cellNameList[i] = CELL_NAME_PREFIX + i + Long.toString(Calendar.getInstance().getTimeInMillis()); // Cellを作成 - DcResponse res; + PersoniumResponse res; res = createCell(cellNameList[i]); // Cell作成のレスポンスチェック @@ -124,7 +124,7 @@ public void after() { @Test public final void Cellの一覧取得の正常系のテスト() { cellCreate(DEF_CELL_NUM); - DcRequest req = DcRequest.get(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.get(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); req.header("Accept", MediaType.APPLICATION_JSON); this.cellListNormal(req); } @@ -135,7 +135,7 @@ public void after() { @Test public final void Cellの一覧取得のAcceptヘッダ無しのテスト() { cellCreate(DEF_CELL_NUM); - DcRequest req = DcRequest.get(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.get(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); this.cellListNormalXml(req); } @@ -146,7 +146,7 @@ public void after() { @Test public final void Cellの一覧取得でAcceptヘッダにATOM_XMLを指定した場合XML形式で返却されること() { cellCreate(DEF_CELL_NUM); - DcRequest req = DcRequest.get(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.get(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); // 制限によりATOM_XMLを指定してもjson形式で返却される. req.header("Accept", MediaType.APPLICATION_ATOM_XML); this.cellListNormalXml(req); @@ -159,10 +159,10 @@ public void after() { @Test public final void Cellの一覧取得のAcceptを不正値指定するテスト() { cellCreate(DEF_CELL_NUM); - DcRequest req = DcRequest.get(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.get(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); req.header("Accept", MediaType.APPLICATION_OCTET_STREAM); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); - DcResponse res = request(req); + PersoniumResponse res = request(req); // 未対応のAcceptを指定した場合はUnsupportedMediaType assertEquals(HttpStatus.SC_UNSUPPORTED_MEDIA_TYPE, res.getStatusCode()); @@ -174,7 +174,7 @@ public void after() { @Test public final void Cellの一覧取得のQueryを無視するのテスト() { cellCreate(DEF_CELL_NUM); - DcRequest req = DcRequest.get(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.get(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); req.header("Accept", MediaType.APPLICATION_JSON); // 制限としているQueryを指定しても無視される事 req.query("$skiptoken=13S35K"); @@ -187,7 +187,7 @@ public void after() { @Test public final void Cellの一覧取得の不正なQueryを無視するのテスト() { cellCreate(DEF_CELL_NUM); - DcRequest req = DcRequest.get(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.get(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); req.header("Accept", MediaType.APPLICATION_JSON); // 不正なQueryを指定しても無視される事 req.query("query=test"); @@ -200,7 +200,7 @@ public void after() { @Test public final void Cellの一覧取得の不正なメソッドPUTのテスト() { cellCreate(DEF_CELL_NUM); - DcRequest req = DcRequest.put(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.put(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); this.cellErrorInvalidMethod(req); } @@ -210,7 +210,7 @@ public void after() { @Test public final void Cellの一覧取得のAuthorizationヘッダ無しのテスト() { cellCreate(DEF_CELL_NUM); - DcRequest req = DcRequest.get(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.get(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); this.cellErrorAuthNone(req); } @@ -220,7 +220,7 @@ public void after() { @Test public final void Cellの一覧取得のAuthorizationヘッダが不正なパターンのテスト() { cellCreate(DEF_CELL_NUM); - DcRequest req = DcRequest.get(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.get(UrlUtils.unitCtl(Cell.EDM_TYPE_NAME)); this.cellErrorAuthInvalid(req); } } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ReadTest.java b/src/test/java/io/personium/test/jersey/cell/ReadTest.java similarity index 90% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ReadTest.java rename to src/test/java/io/personium/test/jersey/cell/ReadTest.java index 536d73b74..164ada241 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ReadTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ReadTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell; +package io.personium.test.jersey.cell; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -38,12 +38,12 @@ import org.odata4j.core.ODataConstants; import org.odata4j.core.ODataVersion; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcResponse; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumResponse; /** * JerseyTestFrameworkを利用したユニットテスト. @@ -65,7 +65,7 @@ public class ReadTest extends AbstractCase { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public ReadTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); this.responseHeaderMap = new HashMap(); for (int i = 0; i < RESPONSE_HEADERS.length; i++) { this.responseHeaderMap.put(RESPONSE_HEADERS[i], RESPONSE_HEADER_VALUES[i]); @@ -96,7 +96,7 @@ public final void initCell() { cellName = cellName + Long.toString(Calendar.getInstance().getTimeInMillis()); // Cellを作成 - DcResponse res; + PersoniumResponse res; res = createCell(cellName); // Cell作成のレスポンスチェック @@ -128,7 +128,7 @@ public final void afterCell() { @Test public final void Cell登録直後にCellが参照できること() { // Cellを作成 - DcResponse res; + PersoniumResponse res; res = createCell("testSoonGetCell"); assertEquals(HttpStatus.SC_CREATED, res.getStatusCode()); // Cell作成のレスポンスチェック @@ -153,7 +153,7 @@ public final void afterCell() { private void settleCell() { // test用に作成したCellを削除 this.setHeaders(null); - DcResponse res = restDelete(getUrl(this.cellId)); + PersoniumResponse res = restDelete(getUrl(this.cellId)); assertEquals(HttpStatus.SC_NO_CONTENT, res.getStatusCode()); // 削除された事を確認するため、取得を行い、404になる事を確認 @@ -170,7 +170,7 @@ private void settleCell() { // $format なし // Acceptヘッダ なし String url = getUrl(this.cellId); - DcResponse res = this.restGet(url); + PersoniumResponse res = this.restGet(url); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); @@ -190,12 +190,12 @@ private void settleCell() { // Acceptヘッダ なし String cellName = "123456"; String url = getUrlWithOutQuote(cellName, null); - DcResponse res = this.restGet(url); + PersoniumResponse res = this.restGet(url); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); checkErrorResponse(res.bodyAsJson(), - DcCoreException.OData.ENTITY_KEY_PARSE_ERROR.getCode(), - DcCoreException.OData.ENTITY_KEY_PARSE_ERROR.getMessage()); + PersoniumCoreException.OData.ENTITY_KEY_PARSE_ERROR.getCode(), + PersoniumCoreException.OData.ENTITY_KEY_PARSE_ERROR.getMessage()); } /** @@ -207,7 +207,7 @@ private void settleCell() { headers.put(HttpHeaders.AUTHORIZATION, ""); this.setHeaders(headers); - DcResponse res = this.restGet(getUrl(this.cellId)); + PersoniumResponse res = this.restGet(getUrl(this.cellId)); // ステータスコード:401 // コンテンツタイプ:application/json @@ -227,7 +227,7 @@ private void settleCell() { headers.put(HttpHeaders.AUTHORIZATION, "Token token=\"" + AbstractCase.MASTER_TOKEN_NAME + "\""); this.setHeaders(headers); - DcResponse res = this.restGet(getUrl(this.cellId)); + PersoniumResponse res = this.restGet(getUrl(this.cellId)); // ステータスコード:401 // コンテンツタイプ:application/json @@ -247,7 +247,7 @@ private void settleCell() { headers.put(HttpHeaders.AUTHORIZATION, "Basic "); this.setHeaders(headers); - DcResponse res = this.restGet(getUrl(this.cellId)); + PersoniumResponse res = this.restGet(getUrl(this.cellId)); // ステータスコード:401 // コンテンツタイプ:application/json @@ -268,7 +268,7 @@ private void settleCell() { headers.put(HttpHeaders.AUTHORIZATION, "Basic " + AbstractCase.MASTER_TOKEN_NAME); this.setHeaders(headers); - DcResponse res = this.restGet(getUrl(this.cellId)); + PersoniumResponse res = this.restGet(getUrl(this.cellId)); // ステータスコード:401 // コンテンツタイプ:application/json @@ -291,7 +291,7 @@ private void settleCell() { headers.put(HttpHeaders.AUTHORIZATION, "Basic YzNzgUZpbm5vdg=="); this.setHeaders(headers); - DcResponse res = this.restGet(getUrl(this.cellId)); + PersoniumResponse res = this.restGet(getUrl(this.cellId)); // ステータスコード:401 // コンテンツタイプ:application/json @@ -311,7 +311,7 @@ private void settleCell() { headers.put(HttpHeaders.AUTHORIZATION, "Bearer "); this.setHeaders(headers); - DcResponse res = this.restGet(getUrl(this.cellId)); + PersoniumResponse res = this.restGet(getUrl(this.cellId)); // ステータスコード:401 // コンテンツタイプ:application/json @@ -331,7 +331,7 @@ private void settleCell() { headers.put(HttpHeaders.AUTHORIZATION, "Bearer test"); this.setHeaders(headers); - DcResponse res = this.restGet(getUrl(this.cellId)); + PersoniumResponse res = this.restGet(getUrl(this.cellId)); // ステータスコード:401 // コンテンツタイプ:application/json @@ -347,7 +347,7 @@ private void settleCell() { */ @Test public final void Cellの取得で不正なIDを指定した場合にBadRequestが返却されること() { - DcResponse res = this.restGet(getUrl("'a'")); + PersoniumResponse res = this.restGet(getUrl("'a'")); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); assertEquals(MediaType.APPLICATION_JSON, res.getResponseHeaders(HttpHeaders.CONTENT_TYPE)[0].getValue()); @@ -359,7 +359,7 @@ private void settleCell() { */ @Test public final void Cellの取得でIDを空文字指定した場合にjsonフォーマットでNotFoundが返却されること() { - DcResponse res = this.restGet(getUrl("")); + PersoniumResponse res = this.restGet(getUrl("")); assertEquals(HttpStatus.SC_NOT_FOUND, res.getStatusCode()); assertEquals(MediaType.APPLICATION_JSON, res.getResponseHeaders(HttpHeaders.CONTENT_TYPE)[0].getValue()); @@ -374,7 +374,7 @@ private void settleCell() { String url = getUrl(this.cellId); // $format json // Acceptヘッダ なし - DcResponse res = this.restGet(url + "?" + QUERY_FORMAT_JSON); + PersoniumResponse res = this.restGet(url + "?" + QUERY_FORMAT_JSON); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); @@ -393,7 +393,7 @@ private void settleCell() { String url = getUrl(this.cellId); // $format atom // Acceptヘッダ なし - DcResponse res = this.restGet(url + "?" + QUERY_FORMAT_ATOM); + PersoniumResponse res = this.restGet(url + "?" + QUERY_FORMAT_ATOM); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); this.responseHeaderMap.put(HTTP.CONTENT_TYPE, MediaType.APPLICATION_ATOM_XML); @@ -416,7 +416,7 @@ private void settleCell() { headers.put(HttpHeaders.ACCEPT, MediaType.APPLICATION_ATOM_XML); this.setHeaders(headers); - DcResponse res = this.restGet(url + "?" + QUERY_FORMAT_ATOM); + PersoniumResponse res = this.restGet(url + "?" + QUERY_FORMAT_ATOM); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); this.responseHeaderMap.put(HTTP.CONTENT_TYPE, MediaType.APPLICATION_ATOM_XML); @@ -439,7 +439,7 @@ private void settleCell() { headers.put(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); this.setHeaders(headers); - DcResponse res = this.restGet(url + "?" + QUERY_FORMAT_ATOM); + PersoniumResponse res = this.restGet(url + "?" + QUERY_FORMAT_ATOM); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); this.responseHeaderMap.put(HTTP.CONTENT_TYPE, MediaType.APPLICATION_ATOM_XML); @@ -462,7 +462,7 @@ private void settleCell() { headers.put(HttpHeaders.ACCEPT, MediaType.APPLICATION_ATOM_XML); this.setHeaders(headers); - DcResponse res = this.restGet(url + "?" + QUERY_FORMAT_JSON); + PersoniumResponse res = this.restGet(url + "?" + QUERY_FORMAT_JSON); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); this.checkHeaders(res); @@ -485,7 +485,7 @@ private void settleCell() { headers.put(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); this.setHeaders(headers); - DcResponse res = this.restGet(url + "?" + QUERY_FORMAT_JSON); + PersoniumResponse res = this.restGet(url + "?" + QUERY_FORMAT_JSON); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); this.checkHeaders(res); @@ -508,7 +508,7 @@ private void settleCell() { headers.put(HttpHeaders.ACCEPT, MediaType.APPLICATION_ATOM_XML); this.setHeaders(headers); - DcResponse res = this.restGet(url); + PersoniumResponse res = this.restGet(url); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); this.responseHeaderMap.put(HTTP.CONTENT_TYPE, MediaType.APPLICATION_ATOM_XML); @@ -531,7 +531,7 @@ private void settleCell() { headers.put(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); this.setHeaders(headers); - DcResponse res = this.restGet(url); + PersoniumResponse res = this.restGet(url); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); this.checkHeaders(res); @@ -549,7 +549,7 @@ private void settleCell() { public final void IfNoneMatchヘッダに一致する値を指定した場合レスポンスが304で返却されること() { String url = getUrl(this.cellId); // 一度リクエストを実行してEtagを取得する - DcResponse res = this.restGet(getUrl(this.cellId)); + PersoniumResponse res = this.restGet(getUrl(this.cellId)); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); this.checkHeaders(res); @@ -576,7 +576,7 @@ private void settleCell() { String url = getUrl(this.cellId); // $format なし // Acceptヘッダ なし - DcResponse res = this.restGet(url); + PersoniumResponse res = this.restGet(url); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); this.checkHeaders(res); @@ -609,7 +609,7 @@ private void settleCell() { @Test public final void Cellの取得で存在しないIDを指定した場合にjsonフォーマットでNotFoundが返却されること() { this.settleCell(); - DcResponse res = this.restGet(getUrl(this.cellId)); + PersoniumResponse res = this.restGet(getUrl(this.cellId)); assertEquals(HttpStatus.SC_NOT_FOUND, res.getStatusCode()); assertEquals(MediaType.APPLICATION_JSON, res.getResponseHeaders(HttpHeaders.CONTENT_TYPE)[0].getValue()); this.checkErrorResponse(res.bodyAsJson(), "PR404-OD-0002"); @@ -623,7 +623,7 @@ private void settleCell() { this.settleCell(); // $format json // Acceptヘッダ なし - DcResponse res = this.restGet(getUrl(this.cellId, QUERY_FORMAT_JSON)); + PersoniumResponse res = this.restGet(getUrl(this.cellId, QUERY_FORMAT_JSON)); assertEquals(HttpStatus.SC_NOT_FOUND, res.getStatusCode()); assertEquals(MediaType.APPLICATION_JSON, res.getResponseHeaders(HttpHeaders.CONTENT_TYPE)[0].getValue()); this.checkErrorResponse(res.bodyAsJson(), "PR404-OD-0002"); @@ -637,7 +637,7 @@ private void settleCell() { this.settleCell(); // $format atom // Acceptヘッダ なし - DcResponse res = this.restGet(getUrl(this.cellId, QUERY_FORMAT_ATOM)); + PersoniumResponse res = this.restGet(getUrl(this.cellId, QUERY_FORMAT_ATOM)); // TODO $formatのxml対応が完了したら確認内容を修正する assertEquals(HttpStatus.SC_NOT_FOUND, res.getStatusCode()); assertEquals(MediaType.APPLICATION_JSON, res.getResponseHeaders(HttpHeaders.CONTENT_TYPE)[0].getValue()); @@ -657,7 +657,7 @@ private void settleCell() { headers.put(HttpHeaders.ACCEPT, MediaType.APPLICATION_ATOM_XML); this.setHeaders(headers); - DcResponse res = this.restGet(getUrl(this.cellId, QUERY_FORMAT_ATOM)); + PersoniumResponse res = this.restGet(getUrl(this.cellId, QUERY_FORMAT_ATOM)); // TODO $formatのxml対応が完了したら確認内容を修正する assertEquals(HttpStatus.SC_NOT_FOUND, res.getStatusCode()); @@ -678,7 +678,7 @@ private void settleCell() { headers.put(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); this.setHeaders(headers); - DcResponse res = this.restGet(getUrl(this.cellId, QUERY_FORMAT_ATOM)); + PersoniumResponse res = this.restGet(getUrl(this.cellId, QUERY_FORMAT_ATOM)); // TODO $formatのxml対応が完了したら確認内容を修正する assertEquals(HttpStatus.SC_NOT_FOUND, res.getStatusCode()); @@ -700,7 +700,7 @@ private void settleCell() { headers.put(HttpHeaders.ACCEPT, MediaType.APPLICATION_ATOM_XML); this.setHeaders(headers); - DcResponse res = this.restGet(getUrl(this.cellId, QUERY_FORMAT_JSON)); + PersoniumResponse res = this.restGet(getUrl(this.cellId, QUERY_FORMAT_JSON)); assertEquals(HttpStatus.SC_NOT_FOUND, res.getStatusCode()); assertEquals(MediaType.APPLICATION_JSON, res.getResponseHeaders(HttpHeaders.CONTENT_TYPE)[0].getValue()); @@ -721,7 +721,7 @@ private void settleCell() { headers.put(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); this.setHeaders(headers); - DcResponse res = this.restGet(getUrl(this.cellId, QUERY_FORMAT_JSON)); + PersoniumResponse res = this.restGet(getUrl(this.cellId, QUERY_FORMAT_JSON)); assertEquals(HttpStatus.SC_NOT_FOUND, res.getStatusCode()); assertEquals(MediaType.APPLICATION_JSON, res.getResponseHeaders(HttpHeaders.CONTENT_TYPE)[0].getValue()); @@ -741,7 +741,7 @@ private void settleCell() { headers.put(HttpHeaders.ACCEPT, MediaType.APPLICATION_ATOM_XML); this.setHeaders(headers); - DcResponse res = this.restGet(getUrl(this.cellId)); + PersoniumResponse res = this.restGet(getUrl(this.cellId)); // TODO $formatのxml対応が完了したら確認内容を修正する assertEquals(HttpStatus.SC_NOT_FOUND, res.getStatusCode()); @@ -762,7 +762,7 @@ private void settleCell() { headers.put(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); this.setHeaders(headers); - DcResponse res = this.restGet(getUrl(this.cellId)); + PersoniumResponse res = this.restGet(getUrl(this.cellId)); assertEquals(HttpStatus.SC_NOT_FOUND, res.getStatusCode()); assertEquals(MediaType.APPLICATION_JSON, res.getResponseHeaders(HttpHeaders.CONTENT_TYPE)[0].getValue()); @@ -775,7 +775,7 @@ private void settleCell() { */ @Test public final void Cellの取得で許可されていないメソッドを指定した場合にjsonフォーマットでMethodNotAllowedが返却されること() { - DcResponse res = restPost(getUrl(this.cellId), ""); + PersoniumResponse res = restPost(getUrl(this.cellId), ""); // レスポンスのチェック assertEquals(HttpStatus.SC_METHOD_NOT_ALLOWED, res.getStatusCode()); @@ -790,7 +790,7 @@ private void settleCell() { public final void $formatがjsonでCellの取得で許可されていないメソッドを指定した場合にjsonフォーマットでMethodNotAllowedが返却されること() { // $format json // Acceptヘッダ なし - DcResponse res = restPost(getUrl(this.cellId), QUERY_FORMAT_JSON); + PersoniumResponse res = restPost(getUrl(this.cellId), QUERY_FORMAT_JSON); // レスポンスのチェック assertEquals(HttpStatus.SC_METHOD_NOT_ALLOWED, res.getStatusCode()); @@ -805,7 +805,7 @@ private void settleCell() { public final void $formatがatomでCellの取得で許可されていないメソッドを指定した場合にjsonフォーマットでMethodNotAllowedが返却されること() { // $format atom // Acceptヘッダ なし - DcResponse res = this.restPost(getUrl(this.cellId), QUERY_FORMAT_ATOM); + PersoniumResponse res = this.restPost(getUrl(this.cellId), QUERY_FORMAT_ATOM); // レスポンスのチェック // TODO formatのxml対応が完了したら確認内容を修正する @@ -826,7 +826,7 @@ private void settleCell() { headers.put(HttpHeaders.ACCEPT, MediaType.APPLICATION_ATOM_XML); this.setHeaders(headers); - DcResponse res = this.restPost(getUrl(this.cellId), QUERY_FORMAT_ATOM); + PersoniumResponse res = this.restPost(getUrl(this.cellId), QUERY_FORMAT_ATOM); // レスポンスのチェック // TODO formatのxml対応が完了したら確認内容を修正する @@ -847,7 +847,7 @@ private void settleCell() { headers.put(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); this.setHeaders(headers); - DcResponse res = this.restPost(getUrl(this.cellId), QUERY_FORMAT_ATOM); + PersoniumResponse res = this.restPost(getUrl(this.cellId), QUERY_FORMAT_ATOM); // レスポンスのチェック // TODO formatのxml対応が完了したら確認内容を修正する @@ -868,7 +868,7 @@ private void settleCell() { headers.put(HttpHeaders.ACCEPT, MediaType.APPLICATION_ATOM_XML); this.setHeaders(headers); - DcResponse res = this.restPost(getUrl(this.cellId), QUERY_FORMAT_JSON); + PersoniumResponse res = this.restPost(getUrl(this.cellId), QUERY_FORMAT_JSON); // レスポンスのチェック assertEquals(HttpStatus.SC_METHOD_NOT_ALLOWED, res.getStatusCode()); @@ -888,7 +888,7 @@ private void settleCell() { headers.put(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); this.setHeaders(headers); - DcResponse res = this.restPost(getUrl(this.cellId), QUERY_FORMAT_JSON); + PersoniumResponse res = this.restPost(getUrl(this.cellId), QUERY_FORMAT_JSON); // レスポンスのチェック assertEquals(HttpStatus.SC_METHOD_NOT_ALLOWED, res.getStatusCode()); @@ -908,7 +908,7 @@ private void settleCell() { headers.put(HttpHeaders.ACCEPT, MediaType.APPLICATION_ATOM_XML); this.setHeaders(headers); - DcResponse res = this.restPost(getUrl(this.cellId), ""); + PersoniumResponse res = this.restPost(getUrl(this.cellId), ""); // レスポンスのチェック // TODO formatのxml対応が完了したら確認内容を修正する @@ -929,7 +929,7 @@ private void settleCell() { headers.put(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); this.setHeaders(headers); - DcResponse res = this.restPost(getUrl(this.cellId), ""); + PersoniumResponse res = this.restPost(getUrl(this.cellId), ""); // レスポンスのチェック assertEquals(HttpStatus.SC_METHOD_NOT_ALLOWED, res.getStatusCode()); @@ -950,7 +950,7 @@ private void settleCell() { headers.put(HttpHeaders.ACCEPT, "image/jpeg"); this.setHeaders(headers); - DcResponse res = restGet(url); + PersoniumResponse res = restGet(url); assertEquals(HttpStatus.SC_UNSUPPORTED_MEDIA_TYPE, res.getStatusCode()); } @@ -967,7 +967,7 @@ private void settleCell() { headers.put(HttpHeaders.ACCEPT, "image/jpeg"); this.setHeaders(headers); - DcResponse res = restGet(url + "?" + QUERY_FORMAT_ATOM); + PersoniumResponse res = restGet(url + "?" + QUERY_FORMAT_ATOM); // TODO Acceptヘッダーのチェック処理が完了したら、NOT_ACCEPTABLEのチェックに変更する assertEquals(HttpStatus.SC_OK, res.getStatusCode()); this.responseHeaderMap.put(HTTP.CONTENT_TYPE, MediaType.APPLICATION_ATOM_XML); @@ -990,7 +990,7 @@ private void settleCell() { headers.put(HttpHeaders.ACCEPT, "image/jpeg"); this.setHeaders(headers); - DcResponse res = restGet(url + "?" + QUERY_FORMAT_JSON); + PersoniumResponse res = restGet(url + "?" + QUERY_FORMAT_JSON); // TODO Acceptヘッダーのチェック処理が完了したら、NOT_ACCEPTABLEのチェックに変更する assertEquals(HttpStatus.SC_OK, res.getStatusCode()); this.checkHeaders(res); @@ -1013,7 +1013,7 @@ private void settleCell() { headers.put(HttpHeaders.ACCEPT, ""); this.setHeaders(headers); - DcResponse res = restGet(url); + PersoniumResponse res = restGet(url); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); this.responseHeaderMap.put(HTTP.CONTENT_TYPE, MediaType.APPLICATION_ATOM_XML); this.checkHeaders(res); @@ -1036,7 +1036,7 @@ private void settleCell() { headers.put(HttpHeaders.ACCEPT, ""); this.setHeaders(headers); - DcResponse res = restGet(url + "?" + QUERY_FORMAT_ATOM); + PersoniumResponse res = restGet(url + "?" + QUERY_FORMAT_ATOM); // TODO Acceptヘッダーのチェック処理が完了したら、NOT_ACCEPTABLEのチェックに変更する assertEquals(HttpStatus.SC_OK, res.getStatusCode()); this.responseHeaderMap.put(HTTP.CONTENT_TYPE, MediaType.APPLICATION_ATOM_XML); @@ -1059,7 +1059,7 @@ private void settleCell() { headers.put(HttpHeaders.ACCEPT, ""); this.setHeaders(headers); - DcResponse res = restGet(url + "?" + QUERY_FORMAT_JSON); + PersoniumResponse res = restGet(url + "?" + QUERY_FORMAT_JSON); // TODO Acceptヘッダーのチェック処理が完了したら、NOT_ACCEPTABLEのチェックに変更する assertEquals(HttpStatus.SC_OK, res.getStatusCode()); this.checkHeaders(res); @@ -1077,7 +1077,7 @@ private void settleCell() { String url = getUrl(this.cellId); // $format csv // Acceptヘッダ なし - DcResponse res = restGet(url + "?" + "$format=csv"); + PersoniumResponse res = restGet(url + "?" + "$format=csv"); // TODO $formatのチェック処理が完了したら、BAD_REQUESTのチェックに変更する assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); @@ -1096,7 +1096,7 @@ private void settleCell() { headers.put(HttpHeaders.ACCEPT, MediaType.APPLICATION_ATOM_XML); this.setHeaders(headers); - DcResponse res = restGet(url + "?" + "$format=csv"); + PersoniumResponse res = restGet(url + "?" + "$format=csv"); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); } @@ -1113,11 +1113,11 @@ private void settleCell() { headers.put(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); this.setHeaders(headers); - DcResponse res = restGet(url + "?" + "$format=csv"); + PersoniumResponse res = restGet(url + "?" + "$format=csv"); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); } - private void checkHeaders(final DcResponse res) { + private void checkHeaders(final PersoniumResponse res) { for (int i = 0; i < RESPONSE_HEADERS.length; i++) { Header[] headers = res.getResponseHeaders(RESPONSE_HEADERS[i]); assertEquals(headers.length, 1); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/UnitUserCellCRUDTest.java b/src/test/java/io/personium/test/jersey/cell/UnitUserCellCRUDTest.java similarity index 93% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/UnitUserCellCRUDTest.java rename to src/test/java/io/personium/test/jersey/cell/UnitUserCellCRUDTest.java index 9fbc64bcc..1451ef5c1 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/UnitUserCellCRUDTest.java +++ b/src/test/java/io/personium/test/jersey/cell/UnitUserCellCRUDTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell; +package io.personium.test.jersey.cell; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -31,33 +31,33 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token.TokenParseException; -import com.fujitsu.dc.common.auth.token.Role; -import com.fujitsu.dc.common.auth.token.TransCellAccessToken; -import com.fujitsu.dc.common.auth.token.UnitLocalUnitUserToken; -import com.fujitsu.dc.core.auth.OAuth2Helper; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.cell.auth.AuthTestCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.common.auth.token.AbstractOAuth2Token.TokenParseException; +import io.personium.common.auth.token.Role; +import io.personium.common.auth.token.TransCellAccessToken; +import io.personium.common.auth.token.UnitLocalUnitUserToken; +import io.personium.core.auth.OAuth2Helper; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.cell.auth.AuthTestCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; /** * UnitUserでCellをCRUDするテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class UnitUserCellCRUDTest extends JerseyTest { @@ -71,7 +71,7 @@ public class UnitUserCellCRUDTest extends JerseyTest { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public UnitUserCellCRUDTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -98,11 +98,11 @@ public void after() { } /** - * マスタートークンでX_Dc_UnitUserヘッダを指定すると指定したユニットユーザトークンになることを確認. + * マスタートークンでX_PERSONIUM_UnitUserヘッダを指定すると指定したユニットユーザトークンになることを確認. */ @Test - public final void マスタートークンでX_Dc_UnitUserヘッダを指定すると指定したユニットユーザトークンになることを確認() { - // マスタートークンでX-Dc-UnitUserヘッダを指定すると指定した値のOwnerでセルが作成される。 + public final void マスタートークンでX_PERSONIUM_UnitUserヘッダを指定すると指定したユニットユーザトークンになることを確認() { + // マスタートークンでX-Personium-UnitUserヘッダを指定すると指定した値のOwnerでセルが作成される。 CellUtils.create(CREATE_CELL, AbstractCase.MASTER_TOKEN_NAME, Setup.OWNER_VET, HttpStatus.SC_CREATED); // ユニットユーザトークンを使えば取得可能なことを確認 @@ -134,7 +134,7 @@ public void after() { .with("remoteCell", UNIT_USER_CELL) .with("username", UNIT_USER_ACCOUNT) .with("password", UNIT_USER_ACCOUNT_PASS) - .with("dc_target", UrlUtils.unitRoot()) + .with("p_target", UrlUtils.unitRoot()) .returns() .statusCode(HttpStatus.SC_OK); @@ -207,7 +207,7 @@ public void after() { .with("remoteCell", UNIT_USER_CELL) .with("username", UNIT_USER_ACCOUNT) .with("password", UNIT_USER_ACCOUNT_PASS) - .with("dc_target", UrlUtils.unitRoot()) + .with("p_target", UrlUtils.unitRoot()) .returns() .statusCode(HttpStatus.SC_OK); @@ -392,7 +392,7 @@ public void after() { .with("remoteCell", Setup.TEST_CELL2) .with("username", "account1") .with("password", "password1") - .with("dc_target", UrlUtils.cellRoot(Setup.TEST_CELL1)) + .with("p_target", UrlUtils.cellRoot(Setup.TEST_CELL1)) .returns() .statusCode(HttpStatus.SC_OK); @@ -422,7 +422,7 @@ public void after() { .with("remoteCell", Setup.TEST_CELL2) .with("username", "account1") .with("password", "password1") - .with("dc_target", UrlUtils.cellRoot(Setup.TEST_CELL1)) + .with("p_target", UrlUtils.cellRoot(Setup.TEST_CELL1)) .returns() .statusCode(HttpStatus.SC_OK); @@ -692,7 +692,7 @@ public void after() { .with("remoteCell", Setup.TEST_CELL1) .with("username", "account1") .with("password", "password1") - .with("dc_target", UrlUtils.cellRoot(Setup.TEST_CELL2)) + .with("p_target", UrlUtils.cellRoot(Setup.TEST_CELL2)) .returns() .statusCode(HttpStatus.SC_OK); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/UpdateTest.java b/src/test/java/io/personium/test/jersey/cell/UpdateTest.java similarity index 93% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/UpdateTest.java rename to src/test/java/io/personium/test/jersey/cell/UpdateTest.java index 10df38710..a1afbbeeb 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/UpdateTest.java +++ b/src/test/java/io/personium/test/jersey/cell/UpdateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell; +package io.personium.test.jersey.cell; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -37,19 +37,19 @@ import org.junit.experimental.categories.Category; import org.w3c.dom.NodeList; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRestAdapter; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.Cell; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumRestAdapter; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * Cellの更新のIT. @@ -59,7 +59,7 @@ public class UpdateTest extends AbstractCase { private String cellName; private String cellNameToDelete; - private DcResponse res; + private PersoniumResponse res; private static String eTag = ""; private static String published = ""; @@ -72,7 +72,7 @@ public class UpdateTest extends AbstractCase { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public UpdateTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -101,7 +101,7 @@ public void before() { JSONObject requestBody = new JSONObject(); requestBody.put("Name", cellName); - DcResponse beforeres = createCell(headers, requestBody); + PersoniumResponse beforeres = createCell(headers, requestBody); // 更新したCellのIDを保持する // Header[] resHeadersLocate = beforeres.getResponseHeaders(HttpHeaders.LOCATION); @@ -148,7 +148,7 @@ public void after() { cellNameToDelete = updateCellName; // __publishedを取得する - DcResponse getResp = restGet(getUrl(updateCellName)); + PersoniumResponse getResp = restGet(getUrl(updateCellName)); String resPublished = ODataCommon.getPublished(getResp); // Cell更新のレスポンスチェック @@ -194,7 +194,8 @@ public void after() { boolean existsPrivilegeAll = false; for (int i = 0; i < nodeListPrivilege.getLength(); i++) { String nodename = nodeListPrivilege.item(i).getNodeName(); - if ("all".equals(nodename)) { + // all -> root への対応が必要 + if ("root".equals(nodename)) { existsPrivilegeAll = true; } } @@ -217,7 +218,7 @@ public void after() { cellNameToDelete = updateCellName; // __publishedを取得する - DcResponse getResp = restGet(getUrl(updateCellName)); + PersoniumResponse getResp = restGet(getUrl(updateCellName)); String resPublished = ODataCommon.getPublished(getResp); // Cell更新のレスポンスチェック @@ -248,7 +249,8 @@ public void after() { existsPrivilegeAll = false; for (int i = 0; i < nodeListPrivilege.getLength(); i++) { String nodename = nodeListPrivilege.item(i).getNodeName(); - if ("all".equals(nodename)) { + // all -> root への対応が必要 + if ("root".equals(nodename)) { existsPrivilegeAll = true; } } @@ -265,12 +267,12 @@ public void after() { // Acceptヘッダ なし String cellNameAsInteger = "123456"; String url = getUrlWithOutQuote(cellNameAsInteger, null); - DcResponse response = this.restPut(url, ""); + PersoniumResponse response = this.restPut(url, ""); assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode()); checkErrorResponse(response.bodyAsJson(), - DcCoreException.OData.ENTITY_KEY_PARSE_ERROR.getCode(), - DcCoreException.OData.ENTITY_KEY_PARSE_ERROR.getMessage()); + PersoniumCoreException.OData.ENTITY_KEY_PARSE_ERROR.getCode(), + PersoniumCoreException.OData.ENTITY_KEY_PARSE_ERROR.getMessage()); } /** @@ -673,7 +675,7 @@ private void cellJsonFormatErr(String accept) { } // リクエストボディを生成 - DcRestAdapter rest = new DcRestAdapter(); + PersoniumRestAdapter rest = new PersoniumRestAdapter(); String data = "\"test\""; @@ -735,7 +737,7 @@ private void cellXmlFormatErr(String accept) { } // リクエストボディを生成 - DcRestAdapter rest = new DcRestAdapter(); + PersoniumRestAdapter rest = new PersoniumRestAdapter(); String data = "\"test\""; @@ -926,7 +928,7 @@ private void cellPost(String accept) { accept = MediaType.APPLICATION_ATOM_XML; } - DcRestAdapter rest = new DcRestAdapter(); + PersoniumRestAdapter rest = new PersoniumRestAdapter(); try { // リクエストボディを生成 @@ -1001,12 +1003,12 @@ private void cellPost(String accept) { requestBody.put("Name", conflictName); // Cellを作成 - DcResponse beforeres = createCell(headers, requestBody); + PersoniumResponse beforeres = createCell(headers, requestBody); // 201になることを確認 assertEquals(HttpStatus.SC_CREATED, beforeres.getStatusCode()); // 新規作成したCellと同一のNameを指定して更新を実行する - DcResponse resConflict; + PersoniumResponse resConflict; headers.put(HttpHeaders.IF_MATCH, "*"); resConflict = updateCell(headers, requestBody); this.cellNameToDelete = conflictName; @@ -1262,7 +1264,7 @@ private void cellPost(String accept) { headers.put(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON); headers.put(HttpHeaders.IF_MATCH, "*"); - DcRestAdapter rest = new DcRestAdapter(); + PersoniumRestAdapter rest = new PersoniumRestAdapter(); // リクエスト先のURL文字列を生成 String cellNameHoge = "hoge" + Long.toString(Calendar.getInstance().getTimeInMillis()); @@ -1372,7 +1374,7 @@ private void cellPost(String accept) { * @param requestBody リクエストボディ * @return Cell更新時のレスポンスオブジェクト */ - private static DcResponse createCell(final HashMap headers, final JSONObject requestBody) { + private static PersoniumResponse createCell(final HashMap headers, final JSONObject requestBody) { return createCellQuery(headers, requestBody, null); } @@ -1383,11 +1385,11 @@ private static DcResponse createCell(final HashMap headers, fina * @param query クエリ文字列 * @return Cell更新時のレスポンスオブジェクト */ - private static DcResponse createCellQuery(final HashMap headers, + private static PersoniumResponse createCellQuery(final HashMap headers, final JSONObject requestBody, final String query) { - DcResponse ret = null; - DcRestAdapter rest = new DcRestAdapter(); + PersoniumResponse ret = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); String data = requestBody.toJSONString(); @@ -1412,7 +1414,7 @@ private static DcResponse createCellQuery(final HashMap headers, * @param requestBody リクエストボディ * @return Cell更新時のレスポンスオブジェクト */ - private DcResponse updateCell(final HashMap headers, final JSONObject requestBody) { + private PersoniumResponse updateCell(final HashMap headers, final JSONObject requestBody) { return updateCellQuery(headers, requestBody, null); } @@ -1423,11 +1425,11 @@ private DcResponse updateCell(final HashMap headers, final JSONO * @param query クエリ文字列 * @return Cell更新時のレスポンスオブジェクト */ - private DcResponse updateCellQuery(final HashMap headers, + private PersoniumResponse updateCellQuery(final HashMap headers, final JSONObject requestBody, final String query) { - DcResponse ret = null; - DcRestAdapter rest = new DcRestAdapter(); + PersoniumResponse ret = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); String data = requestBody.toJSONString(); @@ -1453,11 +1455,11 @@ private DcResponse updateCellQuery(final HashMap headers, * @param cellNameStr 更新前セル名 * @return Cell更新時のレスポンスオブジェクト */ - private DcResponse updateCellName(final HashMap headers, + private PersoniumResponse updateCellName(final HashMap headers, final JSONObject requestBody, final String cellNameStr) { - DcResponse ret = null; - DcRestAdapter rest = new DcRestAdapter(); + PersoniumResponse ret = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); String data = requestBody.toJSONString(); @@ -1489,8 +1491,8 @@ private void deleteCell(String id) { private void deleteCell(String id, Boolean checkStatusCode) { // Cellを削除 - DcRestAdapter rest = new DcRestAdapter(); - DcResponse delresponse = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse delresponse = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AllTests.java b/src/test/java/io/personium/test/jersey/cell/auth/AllTests.java similarity index 97% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AllTests.java rename to src/test/java/io/personium/test/jersey/cell/auth/AllTests.java index 3429f19d8..7ab891d3b 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AllTests.java +++ b/src/test/java/io/personium/test/jersey/cell/auth/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.auth; +package io.personium.test.jersey.cell.auth; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthAccountLockTest.java b/src/test/java/io/personium/test/jersey/cell/auth/AuthAccountLockTest.java similarity index 88% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthAccountLockTest.java rename to src/test/java/io/personium/test/jersey/cell/auth/AuthAccountLockTest.java index 394862f2e..02dee5309 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthAccountLockTest.java +++ b/src/test/java/io/personium/test/jersey/cell/auth/AuthAccountLockTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.auth; +package io.personium.test.jersey.cell.auth; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; @@ -29,20 +29,20 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.core.model.lock.LockManager; -import com.fujitsu.dc.core.rs.cell.TokenEndPointResource; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.model.lock.LockManager; +import io.personium.core.rs.cell.TokenEndPointResource; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; /** * 認証のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class AuthAccountLockTest extends JerseyTest { @@ -75,12 +75,12 @@ public void after() { * コンストラクタ. */ public AuthAccountLockTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** * パスワード認証失敗後1秒以内に成功する認証をリクエストした場合400が返却されること(PR400-AN-0019). - * com.fujitsu.dc.core.lock.accountlock.timeを1秒に設定すると失敗するためIgnore + * io.personium.core.lock.accountlock.timeを1秒に設定すると失敗するためIgnore */ @Test @Ignore @@ -101,7 +101,7 @@ public AuthAccountLockTest() { /** * パスワード認証失敗後1秒以内に失敗する認証をリクエストした場合400が返却されること(PR400-AN-0019). - * com.fujitsu.dc.core.lock.accountlock.timeを1秒に設定すると失敗するためIgnore + * io.personium.core.lock.accountlock.timeを1秒に設定すると失敗するためIgnore */ @Test @Ignore diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthAccountUpdateTest.java b/src/test/java/io/personium/test/jersey/cell/auth/AuthAccountUpdateTest.java similarity index 93% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthAccountUpdateTest.java rename to src/test/java/io/personium/test/jersey/cell/auth/AuthAccountUpdateTest.java index a532adeaf..99593fbef 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthAccountUpdateTest.java +++ b/src/test/java/io/personium/test/jersey/cell/auth/AuthAccountUpdateTest.java @@ -14,34 +14,34 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.auth; +package io.personium.test.jersey.cell.auth; import org.apache.http.HttpStatus; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.cell.ctl.CellCtlUtils; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.RoleUtils; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.cell.ctl.CellCtlUtils; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.RoleUtils; import com.sun.jersey.test.framework.JerseyTest; /** * 認証(Account名更新)のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({ Unit.class, Integration.class, Regression.class }) public class AuthAccountUpdateTest extends JerseyTest { @@ -51,7 +51,7 @@ public class AuthAccountUpdateTest extends JerseyTest { * コンストラクタ. */ public AuthAccountUpdateTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthBasicTest.java b/src/test/java/io/personium/test/jersey/cell/auth/AuthBasicTest.java similarity index 87% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthBasicTest.java rename to src/test/java/io/personium/test/jersey/cell/auth/AuthBasicTest.java index 27d231eca..19cfb11e4 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthBasicTest.java +++ b/src/test/java/io/personium/test/jersey/cell/auth/AuthBasicTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.auth; +package io.personium.test.jersey.cell.auth; import static org.fest.assertions.Assertions.assertThat; import static org.junit.Assert.assertEquals; @@ -35,43 +35,43 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreAuthzException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.acl.jaxb.Acl; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.RelationUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumCoreAuthzException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.acl.jaxb.Acl; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.RelationUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; /** * Basic認証のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class AuthBasicTest extends JerseyTest { // セル再帰的削除を使用するための準備 private static final Map INIT_PARAMS = new HashMap(); static { - INIT_PARAMS.put("com.sun.jersey.config.property.packages", "com.fujitsu.dc.core.rs"); + INIT_PARAMS.put("com.sun.jersey.config.property.packages", "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } static final String TEST_CELL1 = Setup.TEST_CELL1; @@ -153,8 +153,8 @@ public AuthBasicTest() { assertThat(headers).contains(expectedBasic); // レスポンスボディのチェック - ODataCommon.checkErrorResponseBody(res, DcCoreAuthzException.BASIC_AUTHENTICATION_FAILED.getCode(), - DcCoreAuthzException.BASIC_AUTHENTICATION_FAILED.getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreAuthzException.BASIC_AUTHENTICATION_FAILED.getCode(), + PersoniumCoreAuthzException.BASIC_AUTHENTICATION_FAILED.getMessage()); AuthTestCommon.waitForAccountLock(); } finally { // Cellを再帰的削除 @@ -198,8 +198,8 @@ public AuthBasicTest() { assertThat(headers).contains(expectedBasic); // レスポンスボディのチェック - ODataCommon.checkErrorResponseBody(res, DcCoreAuthzException.BASIC_AUTHENTICATION_FAILED.getCode(), - DcCoreAuthzException.BASIC_AUTHENTICATION_FAILED.getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreAuthzException.BASIC_AUTHENTICATION_FAILED.getCode(), + PersoniumCoreAuthzException.BASIC_AUTHENTICATION_FAILED.getMessage()); // Accountロック後のBasic認証(正しい認証情報)で401エラーとなること res = UserDataUtils.createWithBasic(TEST_ACCOUNT, TEST_ACCOUNT_PASSWORD, HttpStatus.SC_UNAUTHORIZED, body, @@ -212,8 +212,8 @@ public AuthBasicTest() { // レスポンスボディのチェック ODataCommon.checkErrorResponseBody(res, - DcCoreAuthzException.BASIC_AUTHENTICATION_FAILED_IN_ACCOUNT_LOCK.getCode(), - DcCoreAuthzException.BASIC_AUTHENTICATION_FAILED_IN_ACCOUNT_LOCK.getMessage()); + PersoniumCoreAuthzException.BASIC_AUTHENTICATION_FAILED_IN_ACCOUNT_LOCK.getCode(), + PersoniumCoreAuthzException.BASIC_AUTHENTICATION_FAILED_IN_ACCOUNT_LOCK.getMessage()); // Accountロック解除後のBasic認証(正しい認証情報)で作成できること AuthTestCommon.waitForAccountLock(); @@ -259,8 +259,8 @@ public AuthBasicTest() { assertThat(headers).contains(expectedBasic); // レスポンスボディのチェック - ODataCommon.checkErrorResponseBody(res, DcCoreAuthzException.BASIC_AUTH_FORMAT_ERROR.getCode(), - DcCoreAuthzException.BASIC_AUTH_FORMAT_ERROR.getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreAuthzException.BASIC_AUTH_FORMAT_ERROR.getCode(), + PersoniumCoreAuthzException.BASIC_AUTH_FORMAT_ERROR.getMessage()); } finally { // Cellを再帰的削除 Setup.cellBulkDeletion(MY_CELL); @@ -309,8 +309,8 @@ public AuthBasicTest() { assertThat(headers).contains(expectedBasic); // レスポンスボディのチェック - ODataCommon.checkErrorResponseBody(res, DcCoreAuthzException.BASIC_AUTH_FORMAT_ERROR.getCode(), - DcCoreAuthzException.BASIC_AUTH_FORMAT_ERROR.getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreAuthzException.BASIC_AUTH_FORMAT_ERROR.getCode(), + PersoniumCoreAuthzException.BASIC_AUTH_FORMAT_ERROR.getMessage()); } finally { // Cellを再帰的削除 Setup.cellBulkDeletion(MY_CELL); @@ -365,8 +365,8 @@ public AuthBasicTest() { List headers = res.getHeaders(HttpHeaders.WWW_AUTHENTICATE); assertEquals(1, headers.size()); assertThat(headers).contains(expected); - ODataCommon.checkErrorResponseBody(res, DcCoreAuthzException.AUTHORIZATION_REQUIRED.getCode(), - DcCoreAuthzException.AUTHORIZATION_REQUIRED.getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreAuthzException.AUTHORIZATION_REQUIRED.getCode(), + PersoniumCoreAuthzException.AUTHORIZATION_REQUIRED.getMessage()); } finally { // Cellを再帰的削除 Setup.cellBulkDeletion(MY_CELL); @@ -400,8 +400,8 @@ public AuthBasicTest() { List headers = res.getHeaders(HttpHeaders.WWW_AUTHENTICATE); assertEquals(1, headers.size()); assertThat(headers).contains(expected); - ODataCommon.checkErrorResponseBody(res, DcCoreAuthzException.AUTHORIZATION_REQUIRED.getCode(), - DcCoreAuthzException.AUTHORIZATION_REQUIRED.getMessage()); + ODataCommon.checkErrorResponseBody(res, PersoniumCoreAuthzException.AUTHORIZATION_REQUIRED.getCode(), + PersoniumCoreAuthzException.AUTHORIZATION_REQUIRED.getMessage()); AuthTestCommon.waitForAccountLock(); } finally { UserDataUtils.delete(AbstractCase.MASTER_TOKEN_NAME, -1, TEST_CELL1, TEST_BOX1, TEST_ODATA, entityType, diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthBatchTest.java b/src/test/java/io/personium/test/jersey/cell/auth/AuthBatchTest.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthBatchTest.java rename to src/test/java/io/personium/test/jersey/cell/auth/AuthBatchTest.java index c48e36783..98493aa84 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthBatchTest.java +++ b/src/test/java/io/personium/test/jersey/cell/auth/AuthBatchTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.auth; +package io.personium.test.jersey.cell.auth; import static org.junit.Assert.assertTrue; @@ -24,23 +24,23 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.auth.OAuth2Helper; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.auth.OAuth2Helper; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.setup.Setup; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; import com.sun.jersey.test.framework.JerseyTest; /** * $bacth認証のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class AuthBatchTest extends JerseyTest { @@ -81,7 +81,7 @@ public class AuthBatchTest extends JerseyTest { * コンストラクタ. */ public AuthBatchTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthCheckTest.java b/src/test/java/io/personium/test/jersey/cell/auth/AuthCheckTest.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthCheckTest.java rename to src/test/java/io/personium/test/jersey/cell/auth/AuthCheckTest.java index 86f12f754..9bb11afbe 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthCheckTest.java +++ b/src/test/java/io/personium/test/jersey/cell/auth/AuthCheckTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.auth; +package io.personium.test.jersey.cell.auth; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -33,42 +33,42 @@ import org.w3c.dom.Element; import org.w3c.dom.NodeList; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token.TokenDsigException; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token.TokenParseException; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token.TokenRootCrtException; -import com.fujitsu.dc.common.auth.token.CellLocalAccessToken; -import com.fujitsu.dc.common.auth.token.Role; -import com.fujitsu.dc.common.auth.token.TransCellAccessToken; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.auth.OAuth2Helper; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.ctl.ExtCell; -import com.fujitsu.dc.core.model.ctl.Relation; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.ExtCellUtils; -import com.fujitsu.dc.test.utils.ExtRoleUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.RelationUtils; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.TestMethodUtils; +import io.personium.common.auth.token.AbstractOAuth2Token.TokenDsigException; +import io.personium.common.auth.token.AbstractOAuth2Token.TokenParseException; +import io.personium.common.auth.token.AbstractOAuth2Token.TokenRootCrtException; +import io.personium.common.auth.token.CellLocalAccessToken; +import io.personium.common.auth.token.Role; +import io.personium.common.auth.token.TransCellAccessToken; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.auth.OAuth2Helper; +import io.personium.core.model.Box; +import io.personium.core.model.ctl.ExtCell; +import io.personium.core.model.ctl.Relation; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.ExtCellUtils; +import io.personium.test.utils.ExtRoleUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.RelationUtils; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.TestMethodUtils; import com.sun.jersey.test.framework.JerseyTest; /** * 認証のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class AuthCheckTest extends JerseyTest { @@ -108,7 +108,7 @@ public class AuthCheckTest extends JerseyTest { * コンストラクタ. */ public AuthCheckTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -148,7 +148,7 @@ public AuthCheckTest() { .with("remoteCell", testCellName) .with("username", userName) .with("password", pass) - .with("dc_target", UrlUtils.cellRoot(TEST_CELL1)) + .with("p_target", UrlUtils.cellRoot(TEST_CELL1)) .returns() .statusCode(HttpStatus.SC_OK); @@ -220,7 +220,7 @@ public AuthCheckTest() { .with("remoteCell", testCellName) .with("username", userName) .with("password", pass) - .with("dc_target", UrlUtils.cellRoot(TEST_CELL1)) + .with("p_target", UrlUtils.cellRoot(TEST_CELL1)) .returns() .statusCode(HttpStatus.SC_OK); @@ -290,7 +290,7 @@ public AuthCheckTest() { .with("remoteCell", testCellName) .with("username", userName) .with("password", pass) - .with("dc_target", UrlUtils.cellRoot(TEST_CELL1)) + .with("p_target", UrlUtils.cellRoot(TEST_CELL1)) .returns() .statusCode(HttpStatus.SC_OK); @@ -396,7 +396,7 @@ public AuthCheckTest() { // Cell1のExtCellとRelationの削除 ResourceUtils.linksDelete(testCellName1, Relation.EDM_TYPE_NAME, relationName, "null", ExtCell.EDM_TYPE_NAME, - "'" + DcCoreUtils.encodeUrlComp(UrlUtils.cellRoot(testCellName2) + "'"), masterToken); + "'" + PersoniumCoreUtils.encodeUrlComp(UrlUtils.cellRoot(testCellName2) + "'"), masterToken); // Cell1のRelationを削除 RelationUtils.delete(testCellName1, masterToken, relationName, null, HttpStatus.SC_NO_CONTENT); // Cell1のExtCellを削除 @@ -488,11 +488,11 @@ public AuthCheckTest() { ResourceUtils.linksWithBody(CELL_NAME1, Relation.EDM_TYPE_NAME, RELATION_NAME, "null", ExtCell.EDM_TYPE_NAME, EXTCELL_URL, masterToken, HttpStatus.SC_NO_CONTENT); // Cell1のExtRoleとRoleを結びつけ - ResourceUtils.linksExtRoleToRole(CELL_NAME1, DcCoreUtils.encodeUrlComp(EXTROLE_NAME1), + ResourceUtils.linksExtRoleToRole(CELL_NAME1, PersoniumCoreUtils.encodeUrlComp(EXTROLE_NAME1), "'" + RELATION_NAME + "'", RELATION_BOX_NAME, ROLE_URI, masterToken); - ResourceUtils.linksExtRoleToRole(CELL_NAME1, DcCoreUtils.encodeUrlComp(EXTROLE_NAME2), + ResourceUtils.linksExtRoleToRole(CELL_NAME1, PersoniumCoreUtils.encodeUrlComp(EXTROLE_NAME2), "'" + RELATION_NAME + "'", RELATION_BOX_NAME, ROLE_URI, masterToken); - ResourceUtils.linksExtRoleToRole(CELL_NAME1, DcCoreUtils.encodeUrlComp(EXTROLE_NAME4), + ResourceUtils.linksExtRoleToRole(CELL_NAME1, PersoniumCoreUtils.encodeUrlComp(EXTROLE_NAME4), "'" + RELATION_NAME + "'", RELATION_BOX_NAME, ROLE_URI, masterToken); // テスト @@ -527,15 +527,15 @@ public AuthCheckTest() { assertEquals(0, tokenRoles4.size()); } finally { // Cell1のExtRoleとRoleを結びつけを削除 - ResourceUtils.linksDeleteExtRoleToRole(CELL_NAME1, DcCoreUtils.encodeUrlComp(EXTROLE_NAME1), + ResourceUtils.linksDeleteExtRoleToRole(CELL_NAME1, PersoniumCoreUtils.encodeUrlComp(EXTROLE_NAME1), RELATION_NAME, RELATION_BOX_NAME, ROLE_NAME, masterToken); - ResourceUtils.linksDeleteExtRoleToRole(CELL_NAME1, DcCoreUtils.encodeUrlComp(EXTROLE_NAME2), + ResourceUtils.linksDeleteExtRoleToRole(CELL_NAME1, PersoniumCoreUtils.encodeUrlComp(EXTROLE_NAME2), RELATION_NAME, RELATION_BOX_NAME, ROLE_NAME, masterToken); - ResourceUtils.linksDeleteExtRoleToRole(CELL_NAME1, DcCoreUtils.encodeUrlComp(EXTROLE_NAME4), + ResourceUtils.linksDeleteExtRoleToRole(CELL_NAME1, PersoniumCoreUtils.encodeUrlComp(EXTROLE_NAME4), RELATION_NAME, RELATION_BOX_NAME, ROLE_NAME, masterToken); // Cell1のExtCellとRelationの削除 ResourceUtils.linksDelete(CELL_NAME1, Relation.EDM_TYPE_NAME, RELATION_NAME, "null", ExtCell.EDM_TYPE_NAME, - "'" + DcCoreUtils.encodeUrlComp(UrlUtils.cellRoot(CELL_NAME2) + "'"), masterToken); + "'" + PersoniumCoreUtils.encodeUrlComp(UrlUtils.cellRoot(CELL_NAME2) + "'"), masterToken); // Cell1のExtRoleを削除する ExtRoleUtils.delete(masterToken, CELL_NAME1, EXTROLE_NAME1, "'" + RELATION_NAME + "'", RELATION_BOX_NAME, HttpStatus.SC_NO_CONTENT); @@ -745,7 +745,7 @@ public AuthCheckTest() { boxNameNoneScheme, roleNameWithBox1, HttpStatus.SC_CREATED); // extCellとロールの結びつけ - ResourceUtils.linkExtCelltoRole(DcCoreUtils.encodeUrlComp(UrlUtils.cellRoot(testCellName)), testCellName2, + ResourceUtils.linkExtCelltoRole(PersoniumCoreUtils.encodeUrlComp(UrlUtils.cellRoot(testCellName)), testCellName2, UrlUtils.roleUrl(testCellName2, boxNameNoneScheme, roleNameWithBox1), AbstractCase.MASTER_TOKEN_NAME, HttpStatus.SC_NO_CONTENT); @@ -754,7 +754,7 @@ public AuthCheckTest() { .with("remoteCell", testCellName) .with("username", userName) .with("password", pass) - .with("dc_target", UrlUtils.cellRoot(testCellName2)) + .with("p_target", UrlUtils.cellRoot(testCellName2)) .returns() .statusCode(HttpStatus.SC_OK); @@ -766,7 +766,7 @@ public AuthCheckTest() { Http.request("authn/saml-tc-c0.txt") .with("remoteCell", testCellName2) .with("assertion", transCellAccessToken) - .with("dc_target", UrlUtils.cellRoot("schema1")) + .with("p_target", UrlUtils.cellRoot("schema1")) .returns() .statusCode(HttpStatus.SC_OK); @@ -782,7 +782,7 @@ public AuthCheckTest() { // ロールとextCellの結びつけ削除 ResourceUtils.linkExtCellRoleDelete(testCellName2, AbstractCase.MASTER_TOKEN_NAME, - DcCoreUtils.encodeUrlComp(UrlUtils.cellRoot(testCellName)), boxNameNoneScheme, roleNameWithBox1); + PersoniumCoreUtils.encodeUrlComp(UrlUtils.cellRoot(testCellName)), boxNameNoneScheme, roleNameWithBox1); // ExtCell削除 ExtCellUtils.delete(AbstractCase.MASTER_TOKEN_NAME, testCellName2, @@ -818,7 +818,7 @@ public AuthCheckTest() { String userName = "blankUser"; try { - // アカウント追加(X-Dc-Credentialヘッダなし) + // アカウント追加(X-Personium-Credentialヘッダなし) AccountUtils.createNonCredential(AbstractCase.MASTER_TOKEN_NAME, TEST_CELL1, userName, HttpStatus.SC_CREATED); @@ -1146,7 +1146,7 @@ private String authByPasswordAndGetAccessToken(String user1, String pass) { .with("remoteCell", UNIT_USER_CELL) .with("username", user1) .with("password", pass) - .with("dc_target", UrlUtils.getBaseUrl()) + .with("p_target", UrlUtils.getBaseUrl()) .returns() .statusCode(HttpStatus.SC_OK); JSONObject json = res.bodyAsJson(); @@ -1160,7 +1160,7 @@ private List checkTransCellAccessToken(final String tokenAuthCellName, fin .with("remoteCell", accountAuthCellName) .with("username", userName) .with("password", pass) - .with("dc_target", UrlUtils.cellRoot(tokenAuthCellName)) + .with("p_target", UrlUtils.cellRoot(tokenAuthCellName)) .returns() .statusCode(HttpStatus.SC_OK); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthCookieTest.java b/src/test/java/io/personium/test/jersey/cell/auth/AuthCookieTest.java similarity index 85% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthCookieTest.java rename to src/test/java/io/personium/test/jersey/cell/auth/AuthCookieTest.java index a7232b62b..ff5a8f244 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthCookieTest.java +++ b/src/test/java/io/personium/test/jersey/cell/auth/AuthCookieTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.auth; +package io.personium.test.jersey.cell.auth; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -34,34 +34,34 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token; -import com.fujitsu.dc.common.auth.token.Role; -import com.fujitsu.dc.common.auth.token.TransCellAccessToken; -import com.fujitsu.dc.core.auth.OAuth2Helper; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.ExtCellUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.common.auth.token.AbstractOAuth2Token; +import io.personium.common.auth.token.Role; +import io.personium.common.auth.token.TransCellAccessToken; +import io.personium.core.auth.OAuth2Helper; +import io.personium.core.model.Box; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.ExtCellUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; /** * 認証のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class AuthCookieTest extends JerseyTest { @@ -79,11 +79,11 @@ public class AuthCookieTest extends JerseyTest { static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } /** @@ -94,21 +94,21 @@ public AuthCookieTest() { } /** - * dc_target指定なしでdc_cookieがtrueの場合にCookieが返却されること. + * p_target指定なしでp_cookieがtrueの場合にCookieが返却されること. */ @Test - public final void dc_target指定なしでdc_cookieがtrueの場合にCookieが返却されること() { + public final void p_target指定なしでp_cookieがtrueの場合にCookieが返却されること() { Long lastAuthenticatedTime = AuthTestCommon.getAccountLastAuthenticated(TEST_CELL1, "account1"); TResponse passRes = requestAuthentication(TEST_CELL1, "account1", "password1", "true", HttpStatus.SC_OK); AuthTestCommon.accountLastAuthenticatedCheck(TEST_CELL1, "account1", lastAuthenticatedTime); - String body = (String) passRes.bodyAsJson().get("dc_cookie_peer"); + String body = (String) passRes.bodyAsJson().get("p_cookie_peer"); assertNotNull(body); String header = passRes.getHeader("Set-Cookie"); assertNotNull(header); Map cookie = resolveCookie(header); - assertTrue(cookie.containsKey("dc_cookie")); + assertTrue(cookie.containsKey("p_cookie")); assertTrue(cookie.containsKey("Version")); assertEquals("0", cookie.get("Version")); assertTrue(cookie.containsKey("Domain")); @@ -118,23 +118,23 @@ public AuthCookieTest() { } /** - * dc_target指定なしでdc_cookieがfalseの場合にCookieが返却されないこと. + * p_target指定なしでp_cookieがfalseの場合にCookieが返却されないこと. */ @Test - public final void dc_target指定なしでdc_cookieがfalseの場合にCookieが返却されないこと() { + public final void p_target指定なしでp_cookieがfalseの場合にCookieが返却されないこと() { TResponse passRes = requestAuthentication(TEST_CELL1, "account1", "password1", "false", HttpStatus.SC_OK); - String body = (String) passRes.bodyAsJson().get("dc_cookie_peer"); + String body = (String) passRes.bodyAsJson().get("p_cookie_peer"); assertNull(body); String header = passRes.getHeader("Set-Cookie"); assertNull(header); } /** - * dc_target指定ありでdc_cookieがtrueの場合にCookieが返却されないこと. + * p_target指定ありでp_cookieがtrueの場合にCookieが返却されないこと. */ @Test - public final void dc_target指定ありでdc_cookieがtrueの場合にCookieが返却されないこと() { + public final void p_target指定ありでp_cookieがtrueの場合にCookieが返却されないこと() { try { // 本テスト用セルの作成 CellUtils.create(TESTCELL_NAME, AbstractCase.MASTER_TOKEN_NAME, HttpStatus.SC_CREATED); @@ -154,7 +154,7 @@ public AuthCookieTest() { TResponse passRes = requestAuthorizationWithTarget(TESTCELL_NAME, USERNAME, PASS, "true", UrlUtils.cellRoot(TEST_CELL1), HttpStatus.SC_OK); - String body = (String) passRes.bodyAsJson().get("dc_cookie_peer"); + String body = (String) passRes.bodyAsJson().get("p_cookie_peer"); assertNull(body); String header = passRes.getHeader("Set-Cookie"); assertNull(header); @@ -174,10 +174,10 @@ public AuthCookieTest() { } /** - * dc_target指定ありでdc_cookieがfalseの場合にCookieが返却されないこと. + * p_target指定ありでp_cookieがfalseの場合にCookieが返却されないこと. */ @Test - public final void dc_target指定ありでdc_cookieがfalseの場合にCookieが返却されないこと() { + public final void p_target指定ありでp_cookieがfalseの場合にCookieが返却されないこと() { try { // 本テスト用セルの作成 CellUtils.create(TESTCELL_NAME, AbstractCase.MASTER_TOKEN_NAME, HttpStatus.SC_CREATED); @@ -197,7 +197,7 @@ public AuthCookieTest() { TResponse passRes = requestAuthorizationWithTarget(TESTCELL_NAME, USERNAME, PASS, "false", UrlUtils.cellRoot(TEST_CELL1), HttpStatus.SC_OK); - String body = (String) passRes.bodyAsJson().get("dc_cookie_peer"); + String body = (String) passRes.bodyAsJson().get("p_cookie_peer"); assertNull(body); String header = passRes.getHeader("Set-Cookie"); assertNull(header); @@ -217,23 +217,23 @@ public AuthCookieTest() { } /** - * dc_target指定なしでdc_cookieが指定なしの場合にCookieが返却されないこと. + * p_target指定なしでp_cookieが指定なしの場合にCookieが返却されないこと. */ @Test - public final void dc_target指定なしでdc_cookieが指定なしの場合にCookieが返却されないこと() { + public final void p_target指定なしでp_cookieが指定なしの場合にCookieが返却されないこと() { TResponse passRes = requestAuthentication(TEST_CELL1, "account1", "password1", null, HttpStatus.SC_OK); - String body = (String) passRes.bodyAsJson().get("dc_cookie_peer"); + String body = (String) passRes.bodyAsJson().get("p_cookie_peer"); assertNull(body); String header = passRes.getHeader("Set-Cookie"); assertNull(header); } /** - * dc_target指定ありでdc_cookieが指定なしの場合にCookieが返却されないこと. + * p_target指定ありでp_cookieが指定なしの場合にCookieが返却されないこと. */ @Test - public final void dc_target指定ありでdc_cookieが指定なしの場合にCookieが返却されないこと() { + public final void p_target指定ありでp_cookieが指定なしの場合にCookieが返却されないこと() { try { // 本テスト用セルの作成 CellUtils.create(TESTCELL_NAME, AbstractCase.MASTER_TOKEN_NAME, HttpStatus.SC_CREATED); @@ -253,7 +253,7 @@ public AuthCookieTest() { TResponse passRes = requestAuthorizationWithTarget(TESTCELL_NAME, USERNAME, PASS, null, UrlUtils.cellRoot(TEST_CELL1), HttpStatus.SC_OK); - String body = (String) passRes.bodyAsJson().get("dc_cookie_peer"); + String body = (String) passRes.bodyAsJson().get("p_cookie_peer"); assertNull(body); String header = passRes.getHeader("Set-Cookie"); assertNull(header); @@ -281,7 +281,7 @@ public AuthCookieTest() { // パスワード認証要求、クッキーを取得 TResponse passRes = requestAuthentication(TEST_CELL1, "account2", "password2", "true", HttpStatus.SC_OK); - String cookiePeer = (String) passRes.bodyAsJson().get("dc_cookie_peer"); + String cookiePeer = (String) passRes.bodyAsJson().get("p_cookie_peer"); assertNotNull(cookiePeer); // クッキーを受け取る @@ -292,7 +292,7 @@ public AuthCookieTest() { // クッキーを与えてオペレーションを実行できるか確認する。 requestOperation(TEST_CELL1, cookiePeer, - "dc_cookie=" + cookie.get("dc_cookie"), HttpStatus.SC_OK); + "p_cookie=" + cookie.get("p_cookie"), HttpStatus.SC_OK); } /** @@ -304,7 +304,7 @@ public AuthCookieTest() { // パスワード認証要求、クッキーを取得 TResponse passRes = requestAuthentication(TEST_CELL1, "account2", "password2", "true", HttpStatus.SC_OK); - String cookiePeer = (String) passRes.bodyAsJson().get("dc_cookie_peer"); + String cookiePeer = (String) passRes.bodyAsJson().get("p_cookie_peer"); assertNotNull(cookiePeer); // クッキーを受け取る @@ -315,7 +315,7 @@ public AuthCookieTest() { // クッキーを改変してオペレーションが失敗することを確認する。 TResponse res = requestOperation(TEST_CELL1, cookiePeer, - "dc_cookie=" + cookie.get("dc_cookie") + "invalid", HttpStatus.SC_UNAUTHORIZED); + "p_cookie=" + cookie.get("p_cookie") + "invalid", HttpStatus.SC_UNAUTHORIZED); AuthTestCommon.checkAuthenticateHeader(res, OAuth2Helper.Scheme.BEARER, TEST_CELL1); } @@ -348,7 +348,7 @@ public AuthCookieTest() { .returns() .statusCode(HttpStatus.SC_OK); - String cookiePeer = (String) passRes.bodyAsJson().get("dc_cookie_peer"); + String cookiePeer = (String) passRes.bodyAsJson().get("p_cookie_peer"); assertNotNull(cookiePeer); // クッキーを受け取る @@ -359,7 +359,7 @@ public AuthCookieTest() { // クッキーを与えてオペレーション(セル1のBox一覧取得)で認証エラーにならないことを確認する。 requestOperation(LOCAL_CELL, cookiePeer, - "dc_cookie=" + cookie.get("dc_cookie"), HttpStatus.SC_OK); + "p_cookie=" + cookie.get("p_cookie"), HttpStatus.SC_OK); } finally { // セル1とセル2を削除 Setup.cellBulkDeletion(TARGET_CELL); @@ -397,7 +397,7 @@ public AuthCookieTest() { .returns() .statusCode(HttpStatus.SC_OK); - String cookiePeer = (String) passRes.bodyAsJson().get("dc_cookie_peer"); + String cookiePeer = (String) passRes.bodyAsJson().get("p_cookie_peer"); assertNotNull(cookiePeer); // クッキーを受け取る @@ -408,7 +408,7 @@ public AuthCookieTest() { // クッキーを改変してオペレーションが失敗することを確認する。 TResponse res = requestOperation(LOCAL_CELL, cookiePeer, - "dc_cookie=" + cookie.get("dc_cookie") + "invalid", HttpStatus.SC_UNAUTHORIZED); + "p_cookie=" + cookie.get("p_cookie") + "invalid", HttpStatus.SC_UNAUTHORIZED); AuthTestCommon.checkAuthenticateHeader(res, LOCAL_CELL); } finally { // セル1とセル2を削除 @@ -439,12 +439,12 @@ public AuthCookieTest() { Map cookie = resolveCookie(header); - String cookiePeer = (String) passRes.bodyAsJson().get("dc_cookie_peer"); + String cookiePeer = (String) passRes.bodyAsJson().get("p_cookie_peer"); assertNotNull(cookiePeer); // クッキーを与えてオペレーションを実行できるか確認する。 requestOperation(TEST_CELL1, cookiePeer, - "dc_cookie=" + cookie.get("dc_cookie"), HttpStatus.SC_OK); + "p_cookie=" + cookie.get("p_cookie"), HttpStatus.SC_OK); } /** @@ -468,12 +468,12 @@ public AuthCookieTest() { Map cookie = resolveCookie(header); - String cookiePeer = (String) passRes.bodyAsJson().get("dc_cookie_peer"); + String cookiePeer = (String) passRes.bodyAsJson().get("p_cookie_peer"); assertNotNull(cookiePeer); // クッキーを改変してオペレーションが失敗することを確認する。 TResponse res = requestOperation(TEST_CELL1, cookiePeer, - "dc_cookie=" + cookie.get("dc_cookie") + "invalid", HttpStatus.SC_UNAUTHORIZED); + "p_cookie=" + cookie.get("p_cookie") + "invalid", HttpStatus.SC_UNAUTHORIZED); AuthTestCommon.checkAuthenticateHeader(res, OAuth2Helper.Scheme.BEARER, TEST_CELL1); } @@ -498,7 +498,7 @@ public AuthCookieTest() { // パスワード認証要求、クッキーを取得 TResponse passRes = requestAuthentication(TEST_CELL1, "account2", "password2", "true", HttpStatus.SC_OK); - String cookiePeer = (String) passRes.bodyAsJson().get("dc_cookie_peer"); + String cookiePeer = (String) passRes.bodyAsJson().get("p_cookie_peer"); assertNotNull(cookiePeer); // クッキーを受け取る @@ -508,7 +508,7 @@ public AuthCookieTest() { Map cookie = resolveCookie(header); // クッキー認証 - String dcCookie = "dc_cookie=" + cookie.get("dc_cookie"); + String dcCookie = "p_cookie=" + cookie.get("p_cookie"); requestOperation(TEST_CELL1, boxName, colName, cookiePeer, dcCookie, HttpStatus.SC_OK); } finally { // コレクション削除 @@ -537,7 +537,7 @@ public AuthCookieTest() { // パスワード認証要求、クッキーを取得 TResponse passRes = requestAuthentication(TEST_CELL1, "account2", "password2", "true", HttpStatus.SC_OK); - String cookiePeer = (String) passRes.bodyAsJson().get("dc_cookie_peer"); + String cookiePeer = (String) passRes.bodyAsJson().get("p_cookie_peer"); assertNotNull(cookiePeer); // クッキーを受け取る @@ -547,15 +547,15 @@ public AuthCookieTest() { Map cookie = resolveCookie(header); // クッキー認証 - // dc_cookieが不正 - String dcCookie = "dc_cookie=" + cookie.get("dc_cookie") + "invalid"; + // p_cookieが不正 + String dcCookie = "p_cookie=" + cookie.get("p_cookie") + "invalid"; requestOperation(TEST_CELL1, boxName, colName, cookiePeer, dcCookie, HttpStatus.SC_OK); - // dc_cookieが空 + // p_cookieが空 requestOperationWithoutCookie(TEST_CELL1, boxName, colName, cookiePeer, HttpStatus.SC_OK); - // dc_cookie_peerが不正 - dcCookie = "dc_cookie=" + cookie.get("dc_cookie"); + // p_cookie_peerが不正 + dcCookie = "p_cookie=" + cookie.get("p_cookie"); String dcCookiePeer = cookiePeer + "invalid"; requestOperation(TEST_CELL1, boxName, colName, dcCookiePeer, dcCookie, HttpStatus.SC_OK); } finally { @@ -586,7 +586,7 @@ public AuthCookieTest() { // パスワード認証要求、クッキーを取得 TResponse passRes = requestAuthentication(TEST_CELL1, "account2", "password2", "true", HttpStatus.SC_OK); - String cookiePeer = (String) passRes.bodyAsJson().get("dc_cookie_peer"); + String cookiePeer = (String) passRes.bodyAsJson().get("p_cookie_peer"); assertNotNull(cookiePeer); // クッキーを受け取る @@ -596,7 +596,7 @@ public AuthCookieTest() { Map cookie = resolveCookie(header); // クッキー認証 - String dcCookie = "dc_cookie=" + cookie.get("dc_cookie"); + String dcCookie = "p_cookie=" + cookie.get("p_cookie"); requestOperation(TEST_CELL1, boxName, colName, cookiePeer, dcCookie, HttpStatus.SC_OK); } finally { // コレクション削除 @@ -625,7 +625,7 @@ public AuthCookieTest() { // パスワード認証要求、クッキーを取得 TResponse passRes = requestAuthentication(TEST_CELL1, "account2", "password2", "true", HttpStatus.SC_OK); - String cookiePeer = (String) passRes.bodyAsJson().get("dc_cookie_peer"); + String cookiePeer = (String) passRes.bodyAsJson().get("p_cookie_peer"); assertNotNull(cookiePeer); // クッキーを受け取る @@ -635,18 +635,18 @@ public AuthCookieTest() { Map cookie = resolveCookie(header); // クッキー認証 - // dc_cookieが不正 - String dcCookie = "dc_cookie=" + cookie.get("dc_cookie") + "invalid"; + // p_cookieが不正 + String dcCookie = "p_cookie=" + cookie.get("p_cookie") + "invalid"; TResponse res = requestOperation(TEST_CELL1, boxName, colName, cookiePeer, dcCookie, HttpStatus.SC_UNAUTHORIZED); AuthTestCommon.checkAuthenticateHeader(res, OAuth2Helper.Scheme.BEARER, TEST_CELL1); - // dc_cookieが空 + // p_cookieが空 res = requestOperationWithoutCookie(TEST_CELL1, boxName, colName, cookiePeer, HttpStatus.SC_UNAUTHORIZED); AuthTestCommon.checkAuthenticateHeader(res, OAuth2Helper.Scheme.BEARER, TEST_CELL1); - // dc_cookie_peerが不正 - dcCookie = "dc_cookie=" + cookie.get("dc_cookie"); + // p_cookie_peerが不正 + dcCookie = "p_cookie=" + cookie.get("p_cookie"); String dcCookiePeer = cookiePeer + "invalid"; res = requestOperation(TEST_CELL1, boxName, colName, dcCookiePeer, dcCookie, HttpStatus.SC_UNAUTHORIZED); AuthTestCommon.checkAuthenticateHeader(res, OAuth2Helper.Scheme.BEARER, TEST_CELL1); @@ -678,7 +678,7 @@ public AuthCookieTest() { // パスワード認証要求、クッキーを取得 TResponse passRes = requestAuthentication(TEST_CELL1, "account1", "password1", "true", HttpStatus.SC_OK); - String cookiePeer = (String) passRes.bodyAsJson().get("dc_cookie_peer"); + String cookiePeer = (String) passRes.bodyAsJson().get("p_cookie_peer"); assertNotNull(cookiePeer); // クッキーを受け取る @@ -688,7 +688,7 @@ public AuthCookieTest() { Map cookie = resolveCookie(header); // クッキー認証 - String dcCookie = "dc_cookie=" + cookie.get("dc_cookie"); + String dcCookie = "p_cookie=" + cookie.get("p_cookie"); TResponse res = requestOperation(TEST_CELL1, boxName, colName, cookiePeer, dcCookie, HttpStatus.SC_FORBIDDEN); AuthTestCommon.checkAuthenticateHeaderNotExists(res); @@ -719,7 +719,7 @@ public AuthCookieTest() { // パスワード認証要求、クッキーを取得 TResponse passRes = requestAuthentication(TEST_CELL1, "account1", "password1", "true", HttpStatus.SC_OK); - String cookiePeer = (String) passRes.bodyAsJson().get("dc_cookie_peer"); + String cookiePeer = (String) passRes.bodyAsJson().get("p_cookie_peer"); assertNotNull(cookiePeer); // クッキーを受け取る @@ -729,17 +729,17 @@ public AuthCookieTest() { Map cookie = resolveCookie(header); // クッキー認証 - // dc_cookieが不正 - String dcCookie = "dc_cookie=" + cookie.get("dc_cookie") + "invalid"; + // p_cookieが不正 + String dcCookie = "p_cookie=" + cookie.get("p_cookie") + "invalid"; TResponse res = requestOperation(TEST_CELL1, boxName, colName, cookiePeer, dcCookie, HttpStatus.SC_UNAUTHORIZED); AuthTestCommon.checkAuthenticateHeader(res, OAuth2Helper.Scheme.BEARER, TEST_CELL1); - // dc_cookieが空 + // p_cookieが空 res = requestOperationWithoutCookie(TEST_CELL1, boxName, colName, cookiePeer, HttpStatus.SC_UNAUTHORIZED); AuthTestCommon.checkAuthenticateHeader(res, OAuth2Helper.Scheme.BEARER, TEST_CELL1); - // dc_cookie_peerが不正 - dcCookie = "dc_cookie=" + cookie.get("dc_cookie"); + // p_cookie_peerが不正 + dcCookie = "p_cookie=" + cookie.get("p_cookie"); String dcCookiePeer = cookiePeer + "invalid"; res = requestOperation(TEST_CELL1, boxName, colName, dcCookiePeer, dcCookie, HttpStatus.SC_UNAUTHORIZED); AuthTestCommon.checkAuthenticateHeader(res, OAuth2Helper.Scheme.BEARER, TEST_CELL1); @@ -763,7 +763,7 @@ private TResponse requestOperation(String cellName, .with("cellPath", cellName) .with("boxName", boxName) .with("colName", colName) - .with("dc_cookie_peer", cookiePeer) + .with("p_cookie_peer", cookiePeer) .with("cookie", cookie) .returns() .debug() @@ -779,7 +779,7 @@ private TResponse requestOperationWithoutCookie(String cellName, .with("cellPath", cellName) .with("boxName", boxName) .with("colName", colName) - .with("dc_cookie_peer", cookiePeer) + .with("p_cookie_peer", cookiePeer) .returns() .debug() .statusCode(expectedStatus); @@ -802,7 +802,7 @@ private TResponse requestAuthentication(String cellName, String userName, .with("remoteCell", cellName) .with("username", userName) .with("password", password) - .with("dc_cookie", dcCookie) + .with("p_cookie", dcCookie) .returns() .statusCode(expectedStatus); } @@ -831,7 +831,7 @@ private TResponse requestAuthorizationWithTarget(String cellName, String userNam .with("remoteCell", cellName) .with("username", userName) .with("password", password) - .with("dc_target", dcTarget) + .with("p_target", dcTarget) .returns() .statusCode(code); } else { @@ -840,8 +840,8 @@ private TResponse requestAuthorizationWithTarget(String cellName, String userNam .with("remoteCell", cellName) .with("username", userName) .with("password", password) - .with("dc_cookie", dcCookie) - .with("dc_target", dcTarget) + .with("p_cookie", dcCookie) + .with("p_target", dcTarget) .returns() .statusCode(code); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthErrorTest.java b/src/test/java/io/personium/test/jersey/cell/auth/AuthErrorTest.java similarity index 85% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthErrorTest.java rename to src/test/java/io/personium/test/jersey/cell/auth/AuthErrorTest.java index 58902ce71..0e13cf49c 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthErrorTest.java +++ b/src/test/java/io/personium/test/jersey/cell/auth/AuthErrorTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.auth; +package io.personium.test.jersey.cell.auth; import static org.junit.Assert.assertEquals; @@ -24,26 +24,26 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreAuthnException; -import com.fujitsu.dc.core.auth.OAuth2Helper; -import com.fujitsu.dc.core.auth.OAuth2Helper.Error; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumCoreAuthnException; +import io.personium.core.auth.OAuth2Helper; +import io.personium.core.auth.OAuth2Helper.Error; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; import com.sun.jersey.test.framework.JerseyTest; /** * 認証のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class AuthErrorTest extends JerseyTest { @@ -55,7 +55,7 @@ public class AuthErrorTest extends JerseyTest { * コンストラクタ. */ public AuthErrorTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -118,7 +118,7 @@ public AuthErrorTest() { .with("remoteCell", TEST_CELL2) .with("username", "account1") .with("password", "password1") - .with("dc_target", UrlUtils.cellRoot(TEST_CELL1)) + .with("p_target", UrlUtils.cellRoot(TEST_CELL1)) .returns() .statusCode(HttpStatus.SC_OK); @@ -144,7 +144,7 @@ public AuthErrorTest() { .with("remoteCell", TEST_CELL2) .with("username", "account1") .with("password", "password1") - .with("dc_target", UrlUtils.cellRoot(TEST_APP_CELL1)) + .with("p_target", UrlUtils.cellRoot(TEST_APP_CELL1)) .returns() .statusCode(HttpStatus.SC_OK); @@ -170,7 +170,7 @@ public AuthErrorTest() { .with("remoteCell", TEST_CELL2) .with("username", "account1") .with("password", "password1") - .with("dc_target", UrlUtils.cellRoot(TEST_CELL1)) + .with("p_target", UrlUtils.cellRoot(TEST_CELL1)) .returns() .statusCode(HttpStatus.SC_OK); @@ -182,7 +182,7 @@ public AuthErrorTest() { Http.request("authn/saml-tc-c0.txt") .with("remoteCell", TEST_CELL1) .with("assertion", transCellAccessToken) - .with("dc_target", UrlUtils.cellRoot(TEST_CELL2)) + .with("p_target", UrlUtils.cellRoot(TEST_CELL2)) .returns() .statusCode(HttpStatus.SC_OK); @@ -208,8 +208,8 @@ public AuthErrorTest() { .statusCode(HttpStatus.SC_BAD_REQUEST); AuthTestCommon.checkAuthenticateHeaderNotExists(passRes); - String code = DcCoreAuthnException.AUTH_HEADER_IS_INVALID.getCode(); - String message = DcCoreAuthnException.AUTH_HEADER_IS_INVALID.getMessage(); + String code = PersoniumCoreAuthnException.AUTH_HEADER_IS_INVALID.getCode(); + String message = PersoniumCoreAuthnException.AUTH_HEADER_IS_INVALID.getMessage(); String errDesc = String.format("[%s] - %s", code, message); checkErrorResponseBody(passRes, Error.INVALID_CLIENT, errDesc); @@ -226,7 +226,7 @@ public AuthErrorTest() { .with("remoteCell", TEST_CELL2) .with("username", "account1") .with("password", "password1") - .with("dc_target", UrlUtils.cellRoot(TEST_CELL1)) + .with("p_target", UrlUtils.cellRoot(TEST_CELL1)) .returns() .statusCode(HttpStatus.SC_OK); @@ -244,8 +244,8 @@ public AuthErrorTest() { .statusCode(HttpStatus.SC_BAD_REQUEST); AuthTestCommon.checkAuthenticateHeaderNotExists(tokenRes); - String code = DcCoreAuthnException.AUTH_HEADER_IS_INVALID.getCode(); - String message = DcCoreAuthnException.AUTH_HEADER_IS_INVALID.getMessage(); + String code = PersoniumCoreAuthnException.AUTH_HEADER_IS_INVALID.getCode(); + String message = PersoniumCoreAuthnException.AUTH_HEADER_IS_INVALID.getMessage(); String errDesc = String.format("[%s] - %s", code, message); checkErrorResponseBody(tokenRes, Error.INVALID_CLIENT, errDesc); @@ -277,8 +277,8 @@ public AuthErrorTest() { .debug(); AuthTestCommon.checkAuthenticateHeaderNotExists(tokenRes); - String code = DcCoreAuthnException.AUTH_HEADER_IS_INVALID.getCode(); - String message = DcCoreAuthnException.AUTH_HEADER_IS_INVALID.getMessage(); + String code = PersoniumCoreAuthnException.AUTH_HEADER_IS_INVALID.getCode(); + String message = PersoniumCoreAuthnException.AUTH_HEADER_IS_INVALID.getMessage(); String errDesc = String.format("[%s] - %s", code, message); checkErrorResponseBody(tokenRes, Error.INVALID_CLIENT, errDesc); @@ -299,8 +299,8 @@ public AuthErrorTest() { .statusCode(HttpStatus.SC_BAD_REQUEST); AuthTestCommon.checkAuthenticateHeaderNotExists(passRes); - String code = DcCoreAuthnException.CLIENT_SERCRET_PARSE_ERROR.getCode(); - String message = DcCoreAuthnException.CLIENT_SERCRET_PARSE_ERROR.getMessage(); + String code = PersoniumCoreAuthnException.CLIENT_SECRET_PARSE_ERROR.getCode(); + String message = PersoniumCoreAuthnException.CLIENT_SECRET_PARSE_ERROR.getMessage(); String errDesc = String.format("[%s] - %s", code, message); checkErrorResponseBody(passRes, Error.INVALID_CLIENT, errDesc); @@ -312,7 +312,7 @@ public AuthErrorTest() { @Test public final void パスワード認証APIのヘッダにclient_secretの指定がない場合_400が返却されること() { String schemaTransCellAccessTokenHeader = - "Basic " + DcCoreUtils.createBasicAuthzHeader(UrlUtils.cellRoot(TEST_APP_CELL1), ""); + "Basic " + PersoniumCoreUtils.createBasicAuthzHeader(UrlUtils.cellRoot(TEST_APP_CELL1), ""); // セルに対してパスワード認証 TResponse passRes = Http.request("authn/auth-with-header.txt") @@ -323,8 +323,8 @@ public AuthErrorTest() { .statusCode(HttpStatus.SC_BAD_REQUEST); AuthTestCommon.checkAuthenticateHeaderNotExists(passRes); - String code = DcCoreAuthnException.CLIENT_SERCRET_PARSE_ERROR.getCode(); - String message = DcCoreAuthnException.CLIENT_SERCRET_PARSE_ERROR.getMessage(); + String code = PersoniumCoreAuthnException.CLIENT_SECRET_PARSE_ERROR.getCode(); + String message = PersoniumCoreAuthnException.CLIENT_SECRET_PARSE_ERROR.getMessage(); String errDesc = String.format("[%s] - %s", code, message); checkErrorResponseBody(passRes, Error.INVALID_CLIENT, errDesc); @@ -341,7 +341,7 @@ public AuthErrorTest() { .with("remoteCell", TEST_CELL2) .with("username", "account1") .with("password", "password1") - .with("dc_target", UrlUtils.cellRoot(TEST_CELL1)) + .with("p_target", UrlUtils.cellRoot(TEST_CELL1)) .returns() .statusCode(HttpStatus.SC_OK); @@ -360,8 +360,8 @@ public AuthErrorTest() { .statusCode(HttpStatus.SC_BAD_REQUEST); AuthTestCommon.checkAuthenticateHeaderNotExists(tokenRes); - String code = DcCoreAuthnException.CLIENT_SERCRET_PARSE_ERROR.getCode(); - String message = DcCoreAuthnException.CLIENT_SERCRET_PARSE_ERROR.getMessage(); + String code = PersoniumCoreAuthnException.CLIENT_SECRET_PARSE_ERROR.getCode(); + String message = PersoniumCoreAuthnException.CLIENT_SECRET_PARSE_ERROR.getMessage(); String errDesc = String.format("[%s] - %s", code, message); checkErrorResponseBody(tokenRes, Error.INVALID_CLIENT, errDesc); @@ -378,7 +378,7 @@ public AuthErrorTest() { .with("remoteCell", TEST_CELL2) .with("username", "account1") .with("password", "password1") - .with("dc_target", UrlUtils.cellRoot(TEST_CELL1)) + .with("p_target", UrlUtils.cellRoot(TEST_CELL1)) .returns() .statusCode(HttpStatus.SC_OK); @@ -386,7 +386,7 @@ public AuthErrorTest() { String transCellAccessToken = (String) json.get(OAuth2Helper.Key.ACCESS_TOKEN); String schemaTransCellAccessTokenHeader = - "Basic " + DcCoreUtils.createBasicAuthzHeader(UrlUtils.cellRoot(TEST_APP_CELL1), ""); + "Basic " + PersoniumCoreUtils.createBasicAuthzHeader(UrlUtils.cellRoot(TEST_APP_CELL1), ""); // セルに対してトークン認証 TResponse tokenRes = @@ -399,8 +399,8 @@ public AuthErrorTest() { .statusCode(HttpStatus.SC_BAD_REQUEST); AuthTestCommon.checkAuthenticateHeaderNotExists(tokenRes); - String code = DcCoreAuthnException.CLIENT_SERCRET_PARSE_ERROR.getCode(); - String message = DcCoreAuthnException.CLIENT_SERCRET_PARSE_ERROR.getMessage(); + String code = PersoniumCoreAuthnException.CLIENT_SECRET_PARSE_ERROR.getCode(); + String message = PersoniumCoreAuthnException.CLIENT_SECRET_PARSE_ERROR.getMessage(); String errDesc = String.format("[%s] - %s", code, message); checkErrorResponseBody(tokenRes, Error.INVALID_CLIENT, errDesc); @@ -433,8 +433,8 @@ public AuthErrorTest() { .debug(); AuthTestCommon.checkAuthenticateHeaderNotExists(tokenRes); - String code = DcCoreAuthnException.CLIENT_SERCRET_PARSE_ERROR.getCode(); - String message = DcCoreAuthnException.CLIENT_SERCRET_PARSE_ERROR.getMessage(); + String code = PersoniumCoreAuthnException.CLIENT_SECRET_PARSE_ERROR.getCode(); + String message = PersoniumCoreAuthnException.CLIENT_SECRET_PARSE_ERROR.getMessage(); String errDesc = String.format("[%s] - %s", code, message); checkErrorResponseBody(tokenRes, Error.INVALID_CLIENT, errDesc); @@ -458,7 +458,7 @@ public AuthErrorTest() { String refreshToken = (String) json.get(OAuth2Helper.Key.REFRESH_TOKEN); String schemaTransCellAccessTokenHeader = - "Basic " + DcCoreUtils.createBasicAuthzHeader(UrlUtils.cellRoot(TEST_APP_CELL1), ""); + "Basic " + PersoniumCoreUtils.createBasicAuthzHeader(UrlUtils.cellRoot(TEST_APP_CELL1), ""); // リフレッシュトークン認証 TResponse tokenRes = Http.request("authn/auth-with-header.txt") .with("remoteCell", TEST_CELL1) @@ -469,8 +469,8 @@ public AuthErrorTest() { .debug(); AuthTestCommon.checkAuthenticateHeaderNotExists(tokenRes); - String code = DcCoreAuthnException.CLIENT_SERCRET_PARSE_ERROR.getCode(); - String message = DcCoreAuthnException.CLIENT_SERCRET_PARSE_ERROR.getMessage(); + String code = PersoniumCoreAuthnException.CLIENT_SECRET_PARSE_ERROR.getCode(); + String message = PersoniumCoreAuthnException.CLIENT_SECRET_PARSE_ERROR.getMessage(); String errDesc = String.format("[%s] - %s", code, message); checkErrorResponseBody(tokenRes, Error.INVALID_CLIENT, errDesc); @@ -490,8 +490,8 @@ public AuthErrorTest() { .debug(); AuthTestCommon.checkAuthenticateHeaderNotExists(tokenRes); - String code = DcCoreAuthnException.TOKEN_PARSE_ERROR.getCode(); - String message = DcCoreAuthnException.TOKEN_PARSE_ERROR.getMessage(); + String code = PersoniumCoreAuthnException.TOKEN_PARSE_ERROR.getCode(); + String message = PersoniumCoreAuthnException.TOKEN_PARSE_ERROR.getMessage(); String errDesc = String.format("[%s] - %s", code, message); checkErrorResponseBody(tokenRes, Error.INVALID_GRANT, errDesc); @@ -511,8 +511,8 @@ public AuthErrorTest() { .debug(); AuthTestCommon.checkAuthenticateHeaderNotExists(tokenRes); - String code = DcCoreAuthnException.TOKEN_PARSE_ERROR.getCode(); - String message = DcCoreAuthnException.TOKEN_PARSE_ERROR.getMessage(); + String code = PersoniumCoreAuthnException.TOKEN_PARSE_ERROR.getCode(); + String message = PersoniumCoreAuthnException.TOKEN_PARSE_ERROR.getMessage(); String errDesc = String.format("[%s] - %s", code, message); checkErrorResponseBody(tokenRes, Error.INVALID_GRANT, errDesc); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthOidcTest.java b/src/test/java/io/personium/test/jersey/cell/auth/AuthOidcTest.java similarity index 95% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthOidcTest.java rename to src/test/java/io/personium/test/jersey/cell/auth/AuthOidcTest.java index 174334727..ee762b023 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthOidcTest.java +++ b/src/test/java/io/personium/test/jersey/cell/auth/AuthOidcTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.auth; +package io.personium.test.jersey.cell.auth; import org.apache.http.HttpStatus; @@ -23,13 +23,13 @@ import org.junit.runner.RunWith; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.Http; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.Http; import com.sun.jersey.test.framework.JerseyTest; /** @@ -39,7 +39,7 @@ * 検証可能なIDTokenを用いた異常系のテストも同様に未実装. * : 正常系テスト */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class AuthOidcTest extends JerseyTest { @@ -80,7 +80,7 @@ public class AuthOidcTest extends JerseyTest { * コンストラクタ. */ public AuthOidcTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** * 不正なIDTokenを指定し400エラーが返却されること. diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthTest.java b/src/test/java/io/personium/test/jersey/cell/auth/AuthTest.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthTest.java rename to src/test/java/io/personium/test/jersey/cell/auth/AuthTest.java index 229d6b6c2..516b1b59c 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthTest.java +++ b/src/test/java/io/personium/test/jersey/cell/auth/AuthTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.auth; +package io.personium.test.jersey.cell.auth; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -31,29 +31,29 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token.TokenParseException; -import com.fujitsu.dc.common.auth.token.CellLocalRefreshToken; -import com.fujitsu.dc.common.auth.token.Role; -import com.fujitsu.dc.common.auth.token.TransCellRefreshToken; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.auth.OAuth2Helper; -import com.fujitsu.dc.core.model.ctl.ExtCell; -import com.fujitsu.dc.core.model.ctl.Relation; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.box.acl.jaxb.Acl; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.ExtCellUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.RelationUtils; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.common.auth.token.AbstractOAuth2Token.TokenParseException; +import io.personium.common.auth.token.CellLocalRefreshToken; +import io.personium.common.auth.token.Role; +import io.personium.common.auth.token.TransCellRefreshToken; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.auth.OAuth2Helper; +import io.personium.core.model.ctl.ExtCell; +import io.personium.core.model.ctl.Relation; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.box.acl.jaxb.Acl; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.ExtCellUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.RelationUtils; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; /** @@ -81,7 +81,7 @@ * 13.スキーマ付きトークン認証リフレッシュトークンートランセル. * 15.スキーマ付きトークン認証リフレッシュトークンー他人セルトークン. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class AuthTest extends JerseyTest { @@ -115,7 +115,7 @@ public class AuthTest extends JerseyTest { * コンストラクタ. */ public AuthTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -218,7 +218,7 @@ public AuthTest() { .with("remoteCell", "schema1") .with("username", "account1") .with("password", "password1") - .with("dc_target", UrlUtils.cellRoot(TEST_CELL1)) + .with("p_target", UrlUtils.cellRoot(TEST_CELL1)) .returns() .statusCode(HttpStatus.SC_OK); @@ -238,7 +238,7 @@ public AuthTest() { AuthTestCommon.accountLastAuthenticatedCheck(TEST_CELL1, "account1", lastAuthenticatedTime); String schemaTransCellAccessTokenHeader = - DcCoreUtils.createBasicAuthzHeader(UrlUtils.cellRoot(TEST_APP_CELL1), + PersoniumCoreUtils.createBasicAuthzHeader(UrlUtils.cellRoot(TEST_APP_CELL1), transCellAccessToken); // Authorizationヘッダでスキーマ認証 Http.request("authn/password-cl-ch.txt") @@ -261,7 +261,7 @@ public AuthTest() { .with("remoteCell", "schema1") .with("username", "account1") .with("password", "password1") - .with("dc_target", UrlUtils.cellRoot(TEST_CELL1)) + .with("p_target", UrlUtils.cellRoot(TEST_CELL1)) .returns() .statusCode(HttpStatus.SC_OK); @@ -279,7 +279,7 @@ public AuthTest() { .statusCode(HttpStatus.SC_OK); String schemaTransCellAccessTokenHeader = - DcCoreUtils.createBasicAuthzHeader(UrlUtils.cellRoot(TEST_APP_CELL1), + PersoniumCoreUtils.createBasicAuthzHeader(UrlUtils.cellRoot(TEST_APP_CELL1), schemaTransCellAccessToken); // Authorizationヘッダでスキーマ認証 Http.request("authn/password-cl-ch.txt") @@ -331,7 +331,7 @@ public AuthTest() { .with("remoteCell", TEST_CELL1) .with("username", "account1") .with("password", "password1") - .with("dc_target", UrlUtils.cellRoot(TEST_CELL2)) + .with("p_target", UrlUtils.cellRoot(TEST_CELL2)) .returns() .statusCode(HttpStatus.SC_OK); @@ -342,7 +342,7 @@ public AuthTest() { Http.request("authn/saml-tc-c0.txt") .with("remoteCell", TEST_CELL2) .with("assertion", transCellAccessToken) - .with("dc_target", UrlUtils.cellRoot(TEST_APP_CELL1)) + .with("p_target", UrlUtils.cellRoot(TEST_APP_CELL1)) .returns() .statusCode(HttpStatus.SC_OK); @@ -359,7 +359,7 @@ public AuthTest() { .with("remoteCell", TEST_CELL1) .with("username", "account1") .with("password", "password1") - .with("dc_target", "personium-localunit:/" + TEST_CELL2 + "/") + .with("p_target", "personium-localunit:/" + TEST_CELL2 + "/") .returns() .statusCode(HttpStatus.SC_OK); @@ -370,7 +370,7 @@ public AuthTest() { Http.request("authn/saml-tc-c0.txt") .with("remoteCell", TEST_CELL2) .with("assertion", transCellAccessToken) - .with("dc_target", "personium-localunit:/" + TEST_APP_CELL1 + "/") + .with("p_target", "personium-localunit:/" + TEST_APP_CELL1 + "/") .returns() .statusCode(HttpStatus.SC_OK); @@ -405,7 +405,7 @@ public AuthTest() { // Setupで作成されたrole1を紐づけ。 Http.request("cell/link-extCell-role.txt") .with("cellPath", TEST_CELL2) - .with("cellName", DcCoreUtils.encodeUrlComp(localunitCell1Url)) + .with("cellName", PersoniumCoreUtils.encodeUrlComp(localunitCell1Url)) .with("token", MASTER_TOKEN) .with("roleUrl", roleUrl) .returns().statusCode(HttpStatus.SC_NO_CONTENT); @@ -429,7 +429,7 @@ public AuthTest() { .with("remoteCell", TEST_CELL1) .with("username", "account1") .with("password", "password1") - .with("dc_target", httpCell2Url) + .with("p_target", httpCell2Url) .returns() .statusCode(HttpStatus.SC_OK); @@ -486,7 +486,7 @@ public AuthTest() { .with("sourceEntity", "Role") .with("sourceKey", "'" + testrole + "'") .with("navPropName", "_ExtCell") - .with("navPropKey", "'" + DcCoreUtils.encodeUrlComp(localunitCell1Url) + "'") + .with("navPropKey", "'" + PersoniumCoreUtils.encodeUrlComp(localunitCell1Url) + "'") .with("token", "Bearer " + MASTER_TOKEN) .with("ifMatch", "*") .returns(); @@ -560,7 +560,7 @@ public AuthTest() { .with("remoteCell", TEST_CELL1) .with("username", "account1") .with("password", "password1") - .with("dc_target", httpCell2Url) + .with("p_target", httpCell2Url) .returns() .statusCode(HttpStatus.SC_OK); @@ -618,7 +618,7 @@ public AuthTest() { // Cell1のExtCellとRelationの削除 ResourceUtils.linksDelete(TEST_CELL2, Relation.EDM_TYPE_NAME, testrelation, "null", ExtCell.EDM_TYPE_NAME, - "'" + DcCoreUtils.encodeUrlComp(localunitCell1Url) + "'", MASTER_TOKEN); + "'" + PersoniumCoreUtils.encodeUrlComp(localunitCell1Url) + "'", MASTER_TOKEN); // Cell1のRelationを削除 RelationUtils.delete(TEST_CELL2, MASTER_TOKEN, testrelation, null, HttpStatus.SC_NO_CONTENT); @@ -683,7 +683,7 @@ private TResponse resetAcl(String cellName, String boxName, String token, String .with("remoteCell", TEST_CELL1) .with("username", "account1") .with("password", "password1") - .with("dc_target", UrlUtils.cellRoot(TEST_CELL2)) + .with("p_target", UrlUtils.cellRoot(TEST_CELL2)) .returns() .statusCode(HttpStatus.SC_OK); @@ -710,7 +710,7 @@ private TResponse resetAcl(String cellName, String boxName, String token, String .with("remoteCell", TEST_CELL1) .with("username", "account1") .with("password", "password1") - .with("dc_target", UrlUtils.cellRoot(TEST_CELL2)) + .with("p_target", UrlUtils.cellRoot(TEST_CELL2)) .returns() .statusCode(HttpStatus.SC_OK); @@ -723,7 +723,7 @@ private TResponse resetAcl(String cellName, String boxName, String token, String .with("remoteCell", TEST_APP_CELL1) .with("username", "account1") .with("password", "password1") - .with("dc_target", UrlUtils.cellRoot(TEST_CELL2)) + .with("p_target", UrlUtils.cellRoot(TEST_CELL2)) .returns() .statusCode(HttpStatus.SC_OK); @@ -740,7 +740,7 @@ private TResponse resetAcl(String cellName, String boxName, String token, String .statusCode(HttpStatus.SC_OK); String schemaTransCellAccessTokenHeader = - DcCoreUtils.createBasicAuthzHeader(UrlUtils.cellRoot(TEST_APP_CELL1), + PersoniumCoreUtils.createBasicAuthzHeader(UrlUtils.cellRoot(TEST_APP_CELL1), schemaTransCellAccessToken); // Authorizationヘッダでスキーマ認証 Http.request("authn/saml-cl-ch.txt") @@ -762,7 +762,7 @@ private TResponse resetAcl(String cellName, String boxName, String token, String .with("remoteCell", TEST_CELL1) .with("username", "account1") .with("password", "password1") - .with("dc_target", UrlUtils.cellRoot(TEST_CELL2)) + .with("p_target", UrlUtils.cellRoot(TEST_CELL2)) .returns() .statusCode(HttpStatus.SC_OK); @@ -775,7 +775,7 @@ private TResponse resetAcl(String cellName, String boxName, String token, String .with("remoteCell", TEST_APP_CELL1) .with("username", "account1") .with("password", "password1") - .with("dc_target", UrlUtils.cellRoot(TEST_CELL2)) + .with("p_target", UrlUtils.cellRoot(TEST_CELL2)) .returns() .statusCode(HttpStatus.SC_OK); @@ -788,11 +788,11 @@ private TResponse resetAcl(String cellName, String boxName, String token, String .with("assertion", transCellAccessToken) .with("client_id", UrlUtils.cellRoot(TEST_APP_CELL1)) .with("client_secret", schemaTransCellAccessToken) - .with("dc_target", UrlUtils.cellRoot(TEST_APP_CELL1)) + .with("p_target", UrlUtils.cellRoot(TEST_APP_CELL1)) .returns() .statusCode(HttpStatus.SC_OK); - String schemaTransCellAccessTokenHeader = DcCoreUtils.createBasicAuthzHeader( + String schemaTransCellAccessTokenHeader = PersoniumCoreUtils.createBasicAuthzHeader( UrlUtils.cellRoot(TEST_APP_CELL1), schemaTransCellAccessToken); @@ -801,7 +801,7 @@ private TResponse resetAcl(String cellName, String boxName, String token, String .with("remoteCell", TEST_CELL2) .with("assertion", transCellAccessToken) .with("base64idpw", schemaTransCellAccessTokenHeader) - .with("dc_target", UrlUtils.cellRoot(TEST_APP_CELL1)) + .with("p_target", UrlUtils.cellRoot(TEST_APP_CELL1)) .returns() .statusCode(HttpStatus.SC_OK); } @@ -848,7 +848,7 @@ private TResponse resetAcl(String cellName, String boxName, String token, String TResponse res = Http.request("authn/refresh-tc.txt") .with("remoteCell", TEST_CELL1) .with("refresh_token", refreshToken) - .with("dc_target", UrlUtils.cellRoot(TEST_CELL2)) + .with("p_target", UrlUtils.cellRoot(TEST_CELL2)) .returns() .statusCode(HttpStatus.SC_OK); String refreshToken2 = (String) res.bodyAsJson().get(OAuth2Helper.Key.REFRESH_TOKEN); @@ -945,7 +945,7 @@ private TResponse resetAcl(String cellName, String boxName, String token, String .with("remoteCell", TEST_APP_CELL1) .with("username", "account1") .with("password", "password1") - .with("dc_target", UrlUtils.cellRoot(TEST_CELL1)) + .with("p_target", UrlUtils.cellRoot(TEST_CELL1)) .returns() .statusCode(HttpStatus.SC_OK); JSONObject json = res.bodyAsJson(); @@ -977,7 +977,7 @@ private TResponse resetAcl(String cellName, String boxName, String token, String Http.request("authn/refresh-tc.txt") .with("remoteCell", TEST_CELL1) .with("refresh_token", refreshToken) - .with("dc_target", UrlUtils.cellRoot(TEST_CELL2)) + .with("p_target", UrlUtils.cellRoot(TEST_CELL2)) .returns() .statusCode(HttpStatus.SC_OK); String refreshToken2 = (String) res3.bodyAsJson().get(OAuth2Helper.Key.REFRESH_TOKEN); @@ -1009,7 +1009,7 @@ private TResponse resetAcl(String cellName, String boxName, String token, String .with("remoteCell", TEST_APP_CELL1) .with("username", "account1") .with("password", "password1") - .with("dc_target", UrlUtils.cellRoot(TEST_CELL1)) + .with("p_target", UrlUtils.cellRoot(TEST_CELL1)) .returns() .statusCode(HttpStatus.SC_OK); @@ -1106,7 +1106,7 @@ private TResponse resetAcl(String cellName, String boxName, String token, String .with("remoteCell", TEST_CELL1) .with("username", "account1") .with("password", "password1") - .with("dc_target", UrlUtils.cellRoot(TEST_CELL2)) + .with("p_target", UrlUtils.cellRoot(TEST_CELL2)) .returns() .statusCode(HttpStatus.SC_OK); @@ -1118,7 +1118,7 @@ private TResponse resetAcl(String cellName, String boxName, String token, String Http.request("authn/saml-tc-c0.txt") .with("remoteCell", TEST_CELL2) .with("assertion", transCellAccessToken) - .with("dc_target", UrlUtils.cellRoot(TEST_APP_CELL1)) + .with("p_target", UrlUtils.cellRoot(TEST_APP_CELL1)) .returns() .statusCode(HttpStatus.SC_OK); @@ -1139,7 +1139,7 @@ private TResponse resetAcl(String cellName, String boxName, String token, String Http.request("authn/refresh-tc.txt") .with("remoteCell", TEST_CELL2) .with("refresh_token", refreshToken) - .with("dc_target", UrlUtils.cellRoot(TEST_APP_CELL1)) + .with("p_target", UrlUtils.cellRoot(TEST_APP_CELL1)) .returns() .statusCode(HttpStatus.SC_OK); JSONObject json3 = res3.bodyAsJson(); @@ -1197,7 +1197,7 @@ private TResponse resetAcl(String cellName, String boxName, String token, String .with("remoteCell", TEST_CELL1) .with("username", "account1") .with("password", "password1") - .with("dc_target", UrlUtils.cellRoot(TEST_CELL2)) + .with("p_target", UrlUtils.cellRoot(TEST_CELL2)) .returns() .statusCode(HttpStatus.SC_OK); @@ -1209,7 +1209,7 @@ private TResponse resetAcl(String cellName, String boxName, String token, String Http.request("authn/saml-tc-c0.txt") .with("remoteCell", TEST_CELL2) .with("assertion", transCellAccessToken) - .with("dc_target", UrlUtils.cellRoot(TEST_APP_CELL1)) + .with("p_target", UrlUtils.cellRoot(TEST_APP_CELL1)) .returns() .statusCode(HttpStatus.SC_OK); @@ -1256,7 +1256,7 @@ private TResponse resetAcl(String cellName, String boxName, String token, String .with("remoteCell", TEST_CELL1) .with("username", "account1") .with("password", "password1") - .with("dc_target", UrlUtils.cellRoot(TEST_CELL2)) + .with("p_target", UrlUtils.cellRoot(TEST_CELL2)) .returns() .statusCode(HttpStatus.SC_OK); @@ -1269,7 +1269,7 @@ private TResponse resetAcl(String cellName, String boxName, String token, String .with("remoteCell", TEST_APP_CELL1) .with("username", "account1") .with("password", "password1") - .with("dc_target", UrlUtils.cellRoot(TEST_CELL2)) + .with("p_target", UrlUtils.cellRoot(TEST_CELL2)) .returns() .statusCode(HttpStatus.SC_OK); @@ -1301,7 +1301,7 @@ private TResponse resetAcl(String cellName, String boxName, String token, String Http.request("authn/refresh-tc.txt") .with("remoteCell", TEST_CELL2) .with("refresh_token", refreshToken) - .with("dc_target", UrlUtils.cellRoot(TEST_APP_CELL1)) + .with("p_target", UrlUtils.cellRoot(TEST_APP_CELL1)) .returns() .statusCode(HttpStatus.SC_OK); String refreshToken2 = (String) res4.bodyAsJson().get(OAuth2Helper.Key.REFRESH_TOKEN); @@ -1335,7 +1335,7 @@ private TResponse resetAcl(String cellName, String boxName, String token, String .with("remoteCell", TEST_CELL1) .with("username", "account1") .with("password", "password1") - .with("dc_target", UrlUtils.cellRoot(TEST_CELL2)) + .with("p_target", UrlUtils.cellRoot(TEST_CELL2)) .returns() .statusCode(HttpStatus.SC_OK); @@ -1348,7 +1348,7 @@ private TResponse resetAcl(String cellName, String boxName, String token, String .with("remoteCell", TEST_APP_CELL1) .with("username", "account1") .with("password", "password1") - .with("dc_target", UrlUtils.cellRoot(TEST_CELL2)) + .with("p_target", UrlUtils.cellRoot(TEST_CELL2)) .returns() .statusCode(HttpStatus.SC_OK); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthTestCommon.java b/src/test/java/io/personium/test/jersey/cell/auth/AuthTestCommon.java similarity index 97% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthTestCommon.java rename to src/test/java/io/personium/test/jersey/cell/auth/AuthTestCommon.java index c37d8a597..f7c40024c 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/AuthTestCommon.java +++ b/src/test/java/io/personium/test/jersey/cell/auth/AuthTestCommon.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.auth; +package io.personium.test.jersey.cell.auth; import static org.fest.assertions.Assertions.assertThat; import static org.junit.Assert.assertEquals; @@ -28,19 +28,19 @@ import org.apache.http.HttpStatus; import org.json.simple.JSONObject; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.box.odatacol.UserDataListFilterTest; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.box.odatacol.UserDataListFilterTest; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; import com.sun.jersey.test.framework.JerseyTest; /** @@ -81,7 +81,7 @@ public class AuthTestCommon extends JerseyTest { * コンストラクタ. */ public AuthTestCommon() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -1122,7 +1122,7 @@ public static void refreshAuthForCellLocal(String cell, /** * 認証テストに必要なトークンを取得する(パスワード認証でトランスセルトークン). * @param cell 認証先のセル - * @param targetCell dc_target + * @param targetCell p_target * @param token トークンを入れるリスト * @param refreshToken リフレッシュトークンを入れるリスト */ @@ -1175,7 +1175,7 @@ public static void accountAuthForTransCell(String cell, String targetCell, HashM /** * リフレッシュトークン認証でトークンを取り直す. * @param cell 認証先のセル - * @param targetCell dc_target + * @param targetCell p_target * @param beforeRefreshToken リフレッシュ認証に利用するトークンのリスト * @param token トークンを入れるリスト * @param refreshToken リフレッシュトークンを入れるリスト @@ -1230,7 +1230,7 @@ public static void refreshAuthForTransCell(String cell, String targetCell, /** * 認証テストに必要なトークンを取得する(トークン認証でトランスセルトークン). * @param cell 認証先のセル - * @param targetCell dc_target + * @param targetCell p_target * @param beforeRefreshToken トークン認証に利用するトークンのリスト * @param token トークンを入れるリスト * @param refreshToken リフレッシュトークンを入れるリスト @@ -1339,7 +1339,7 @@ private static JSONObject transCellToken(String cell, String account, String pas .with("remoteCell", cell) .with("username", account) .with("password", pass) - .with("dc_target", target) + .with("p_target", target) .returns() .statusCode(HttpStatus.SC_OK); return res.bodyAsJson(); @@ -1360,7 +1360,7 @@ private static JSONObject refreshTransCell(String cell, String target, String re TResponse res = Http.request("authn/refresh-tc.txt") .with("remoteCell", cell) .with("refresh_token", refreshToken) - .with("dc_target", UrlUtils.cellRoot(target)) + .with("p_target", UrlUtils.cellRoot(target)) .returns() .statusCode(HttpStatus.SC_OK); return res.bodyAsJson(); @@ -1370,7 +1370,7 @@ private static JSONObject samlTransCell(String cell, String target, String token TResponse res = Http.request("authn/saml-tc-c0.txt") .with("remoteCell", cell) .with("assertion", token) - .with("dc_target", UrlUtils.cellRoot(target)) + .with("p_target", UrlUtils.cellRoot(target)) .returns() .statusCode(HttpStatus.SC_OK); return res.bodyAsJson(); @@ -1390,7 +1390,7 @@ private static JSONObject samlCellLocal(String cell, String token) { */ public static void waitForAccountLock() { try { - Thread.sleep(Long.parseLong(DcCoreConfig.getAccountLockLifetime()) * SLEEP_MILLES); + Thread.sleep(Long.parseLong(PersoniumUnitConfig.getAccountLockLifetime()) * SLEEP_MILLES); } catch (InterruptedException e) { e.printStackTrace(); } @@ -1408,7 +1408,7 @@ public static void checkAuthenticateHeaderNotExists(TResponse res) { * WWW-Authenticateヘッダが返却されないことのチェック. * @param dcRes レスポンス */ - public static void checkAuthenticateHeaderNotExists(DcResponse dcRes) { + public static void checkAuthenticateHeaderNotExists(PersoniumResponse dcRes) { assertThat(dcRes.getFirstHeader(HttpHeaders.WWW_AUTHENTICATE)).isNull(); } @@ -1431,7 +1431,7 @@ public static void checkAuthenticateHeader(TResponse res, String expectedAuthSch * @param expectedAuthScheme WWW-Authenticateヘッダに指定されるべきAuth Scheme("Bearer" or "Basic") * @param expectedCellName 期待するrealmに含まれるCell名 */ - public static void checkAuthenticateHeader(DcResponse res, String expectedAuthScheme, String expectedCellName) { + public static void checkAuthenticateHeader(PersoniumResponse res, String expectedAuthScheme, String expectedCellName) { String expected = String.format("%s realm=\"%s\"", expectedAuthScheme, UrlUtils.cellRoot(expectedCellName)); Header[] headers = res.getResponseHeaders(HttpHeaders.WWW_AUTHENTICATE); assertEquals(1, headers.length); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/BasicAuthCellLevelTest.java b/src/test/java/io/personium/test/jersey/cell/auth/BasicAuthCellLevelTest.java similarity index 85% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/auth/BasicAuthCellLevelTest.java rename to src/test/java/io/personium/test/jersey/cell/auth/BasicAuthCellLevelTest.java index 34f383214..0d3b90534 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/BasicAuthCellLevelTest.java +++ b/src/test/java/io/personium/test/jersey/cell/auth/BasicAuthCellLevelTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.auth; +package io.personium.test.jersey.cell.auth; import static org.fest.assertions.Assertions.assertThat; import static org.junit.Assert.assertEquals; @@ -31,30 +31,30 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.auth.OAuth2Helper; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcException; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.bar.BarInstallTestUtils; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.SentMessageUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.auth.OAuth2Helper; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumException; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.bar.BarInstallTestUtils; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.SentMessageUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; /** * Basic認証のCellレベルのリソースに対するテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class BasicAuthCellLevelTest extends JerseyTest { @@ -68,7 +68,7 @@ public class BasicAuthCellLevelTest extends JerseyTest { * コンストラクタ. */ public BasicAuthCellLevelTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -82,17 +82,17 @@ public void after() { /** * Basic認証_認証APIの操作_正常系. - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ @Test - public final void Basic認証_認証APIの操作_正常系() throws DcException { + public final void Basic認証_認証APIの操作_正常系() throws PersoniumException { String authTargetCell = Setup.TEST_CELL1; String authSchemaCell = Setup.TEST_CELL_SCHEMA1; String authSchemaAccount = "account0"; String authSchemaPassword = "password0"; // __auth(スキーマ認証) - DcResponse dcRes = CellUtils.schemaAuthenticateWithBasic( + PersoniumResponse dcRes = CellUtils.schemaAuthenticateWithBasic( authTargetCell, "account4", "password4", authSchemaCell, authSchemaAccount, authSchemaPassword); assertThat(dcRes.getStatusCode()).isEqualTo(HttpStatus.SC_OK); @@ -109,10 +109,10 @@ public void after() { /** * Basic認証_認証APIの操作_異常系. - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ @Test - public final void Basic認証_認証APIの操作_異常系() throws DcException { + public final void Basic認証_認証APIの操作_異常系() throws PersoniumException { String authTargetCell = Setup.TEST_CELL1; String authSchemaCell = Setup.TEST_CELL_SCHEMA1; String authSchemaAccount = "account0"; @@ -120,7 +120,7 @@ public void after() { // __auth(スキーマ認証) // 認証失敗時:400が返却され、WWW-Authenticateヘッダー(Auth Scheme: Basic)が付与される。 - DcResponse dcRes = CellUtils.schemaAuthenticateWithBasic( + PersoniumResponse dcRes = CellUtils.schemaAuthenticateWithBasic( authTargetCell, "account4", "invlid_password", authSchemaCell, authSchemaAccount, authSchemaPassword); assertThat(dcRes.getStatusCode()).isEqualTo(HttpStatus.SC_BAD_REQUEST); @@ -143,10 +143,10 @@ public void after() { /** * Basic認証ーBoxURL取得の操作. - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ @Test - public final void Basic認証ーBoxURL取得の操作() throws DcException { + public final void Basic認証ーBoxURL取得の操作() throws PersoniumException { String schemaCell = Setup.TEST_CELL_SCHEMA1; String schemaBox = "schemaBox"; @@ -156,7 +156,7 @@ public void after() { UrlUtils.cellRoot(schemaCell)); // 401エラーとなること - DcResponse dcRes = CellUtils.getBoxUrl(cellName, schemaCell, authorization); + PersoniumResponse dcRes = CellUtils.getBoxUrl(cellName, schemaCell, authorization); assertThat(dcRes.getStatusCode()).isEqualTo(HttpStatus.SC_UNAUTHORIZED); AuthTestCommon.checkAuthenticateHeader(dcRes, OAuth2Helper.Scheme.BEARER, cellName); @@ -174,10 +174,10 @@ public void after() { /** * Basic認証ーBoxインストールの操作. - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ @Test - public final void Basic認証ーBoxインストールの操作() throws DcException { + public final void Basic認証ーBoxインストールの操作() throws PersoniumException { String boxName = "installBox"; String location = null; @@ -204,13 +204,13 @@ public void after() { /** * Basic認証ー__mypasswordの操作. - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ @Test - public final void Basic認証ー__mypasswordの操作() throws DcException { + public final void Basic認証ー__mypasswordの操作() throws PersoniumException { try { // 401エラーとなること - DcResponse dcRes = CellUtils.changePassword(cellName, "newPassword", authorization); + PersoniumResponse dcRes = CellUtils.changePassword(cellName, "newPassword", authorization); assertThat(dcRes.getStatusCode()).isEqualTo(HttpStatus.SC_UNAUTHORIZED); AuthTestCommon.checkAuthenticateHeader(dcRes, OAuth2Helper.Scheme.BEARER, cellName); @@ -227,10 +227,10 @@ public void after() { /** * Basic認証ーaclの操作. - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ @Test - public final void Basic認証ーaclの操作() throws DcException { + public final void Basic認証ーaclの操作() throws PersoniumException { // 401エラーとなること TResponse res = CellUtils.setAclPriviriegeAllPrincipalAll(cellName, authorization).statusCode( HttpStatus.SC_UNAUTHORIZED); @@ -246,10 +246,10 @@ public void after() { /** * Basic認証ーpropfindの操作. - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ @Test - public final void Basic認証ーpropfindの操作() throws DcException { + public final void Basic認証ーpropfindの操作() throws PersoniumException { // 401エラーとなること TResponse res = CellUtils.propfindWithAnyAuthSchema(cellName, authorization, "1", HttpStatus.SC_UNAUTHORIZED); AuthTestCommon.checkAuthenticateHeader(res, OAuth2Helper.Scheme.BEARER, cellName); @@ -263,10 +263,10 @@ public void after() { /** * Basic認証ーproppatchの操作. - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ @Test - public final void Basic認証ーproppatchの操作() throws DcException { + public final void Basic認証ーproppatchの操作() throws PersoniumException { // 401エラーとなること TResponse res = CellUtils.proppatchWithAnyAuthSchema(cellName, authorization, HttpStatus.SC_UNAUTHORIZED, "hoge", "huga"); @@ -283,10 +283,10 @@ public void after() { /** * Basic認証ー__messageの操作. - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ @Test - public final void Basic認証ー__messageの操作() throws DcException { + public final void Basic認証ー__messageの操作() throws PersoniumException { String title = "BasicAuthCellLevelTest"; String messageBody = "BasicAuthCellLevelTest000000000000"; String targetCell = Setup.TEST_CELL1; @@ -316,10 +316,10 @@ public void after() { /** * Basic認証ー__eventの操作. - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ @Test - public final void Basic認証ー__eventの操作() throws DcException { + public final void Basic認証ー__eventの操作() throws PersoniumException { // 401エラーとなること TResponse res = CellUtils.eventWithAnyAuthSchema(authorization, HttpStatus.SC_UNAUTHORIZED, cellName, "INFO", "authSchema", "/cell/app", "success"); @@ -335,10 +335,10 @@ public void after() { /** * Basic認証ーボックスの__eventの操作. - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ @Test - public final void Basic認証ーボックスの__eventの操作() throws DcException { + public final void Basic認証ーボックスの__eventの操作() throws PersoniumException { String boxName = "boxName"; try { @@ -346,7 +346,7 @@ public void after() { BoxUtils.create(cellName, boxName, AbstractCase.MASTER_TOKEN_NAME, HttpStatus.SC_CREATED); // 401エラーとなること - DcResponse dcRes = CellUtils.eventUnderBox(authorization, cellName, boxName, + PersoniumResponse dcRes = CellUtils.eventUnderBox(authorization, cellName, boxName, "info", "Action", null, null); assertThat(dcRes.getStatusCode()).isEqualTo(HttpStatus.SC_UNAUTHORIZED); AuthTestCommon.checkAuthenticateHeader(dcRes, OAuth2Helper.Scheme.BEARER, cellName); @@ -365,13 +365,13 @@ public void after() { /** * Basic認証ー__logの操作. - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ @Test - public final void Basic認証ー__logの操作() throws DcException { + public final void Basic認証ー__logの操作() throws PersoniumException { // 401エラーとなること // ログ取得 - DcResponse dcRes = CellUtils.getCurrentLogWithAnyAuth(cellName, "default.log", authorization); + PersoniumResponse dcRes = CellUtils.getCurrentLogWithAnyAuth(cellName, "default.log", authorization); assertThat(dcRes.getStatusCode()).isEqualTo(HttpStatus.SC_UNAUTHORIZED); AuthTestCommon.checkAuthenticateHeader(dcRes, OAuth2Helper.Scheme.BEARER, cellName); @@ -394,10 +394,10 @@ public void after() { /** * Basic認証ーOPTIONSの操作. - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ @Test - public final void Basic認証ーOPTIONSの操作() throws DcException { + public final void Basic認証ーOPTIONSの操作() throws PersoniumException { // 401エラーとなること TResponse res = ResourceUtils.requestUtilWithAuthSchema("OPTIONS", authorization, "/" + cellName, HttpStatus.SC_UNAUTHORIZED); @@ -413,10 +413,10 @@ public void after() { /** * Basic認証ーCell再帰削除. - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ @Test - public final void Basic認証ーCell再帰削除() throws DcException { + public final void Basic認証ーCell再帰削除() throws PersoniumException { String testCell = "BasicTestCellForBulkDeletion"; try { // 事前準備 @@ -424,7 +424,7 @@ public void after() { CellUtils.create(testCell, AbstractCase.MASTER_TOKEN_NAME, HttpStatus.SC_CREATED); // 401エラーとなること - DcResponse dcRes = CellUtils.bulkDeletion(authorization, testCell); + PersoniumResponse dcRes = CellUtils.bulkDeletion(authorization, testCell); assertThat(dcRes.getStatusCode()).isEqualTo(HttpStatus.SC_UNAUTHORIZED); AuthTestCommon.checkAuthenticateHeader(dcRes, OAuth2Helper.Scheme.BEARER, testCell); @@ -444,14 +444,14 @@ public void after() { /** * Basic認証ーCell制御オブジェクトの作成.
    * (共通ロジックのためBoxのみ実施) - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ @Test - public final void Basic認証ーCell制御オブジェクトの作成() throws DcException { + public final void Basic認証ーCell制御オブジェクトの作成() throws PersoniumException { String testBox = "BasicTestBox"; try { // 401エラーとなること - DcResponse dcRes = BoxUtils.createWithAuthSchema(cellName, testBox, authorization); + PersoniumResponse dcRes = BoxUtils.createWithAuthSchema(cellName, testBox, authorization); assertThat(dcRes.getStatusCode()).isEqualTo(HttpStatus.SC_UNAUTHORIZED); AuthTestCommon.checkAuthenticateHeader(dcRes, OAuth2Helper.Scheme.BEARER, cellName); @@ -470,14 +470,14 @@ public void after() { /** * Basic認証ーCell制御オブジェクトの取得.
    * (共通ロジックのためBoxのみ実施) - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ @Test - public final void Basic認証ーCell制御オブジェクトの取得() throws DcException { + public final void Basic認証ーCell制御オブジェクトの取得() throws PersoniumException { String testBox = Setup.TEST_BOX1; // 401エラーとなること - DcResponse dcRes = BoxUtils.getWithAuthSchema(cellName, testBox, authorization); + PersoniumResponse dcRes = BoxUtils.getWithAuthSchema(cellName, testBox, authorization); assertThat(dcRes.getStatusCode()).isEqualTo(HttpStatus.SC_UNAUTHORIZED); AuthTestCommon.checkAuthenticateHeader(dcRes, OAuth2Helper.Scheme.BEARER, cellName); @@ -492,12 +492,12 @@ public void after() { /** * Basic認証ーCell制御オブジェクトの一覧取得.
    * (共通ロジックのためBoxのみ実施) - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ @Test - public final void Basic認証ーCell制御オブジェクトの一覧取得() throws DcException { + public final void Basic認証ーCell制御オブジェクトの一覧取得() throws PersoniumException { // 401エラーとなること - DcResponse dcRes = BoxUtils.listWithAuthSchema(cellName, authorization); + PersoniumResponse dcRes = BoxUtils.listWithAuthSchema(cellName, authorization); AuthTestCommon.checkAuthenticateHeader(dcRes, OAuth2Helper.Scheme.BEARER, cellName); // ACL all-all の場合正常終了すること @@ -511,10 +511,10 @@ public void after() { /** * Basic認証ーCell制御オブジェクトの更新.
    * (共通ロジックのためBoxのみ実施) - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ @Test - public final void Basic認証ーCell制御オブジェクトの更新() throws DcException { + public final void Basic認証ーCell制御オブジェクトの更新() throws PersoniumException { String testBox = "BasicTestBox"; String newBox = "BasicTestBoxNew"; try { @@ -522,7 +522,7 @@ public void after() { BoxUtils.create(cellName, testBox, AbstractCase.MASTER_TOKEN_NAME); // 401エラーとなること - DcResponse dcRes = BoxUtils.updateWithAuthSchema(cellName, testBox, newBox, authorization); + PersoniumResponse dcRes = BoxUtils.updateWithAuthSchema(cellName, testBox, newBox, authorization); assertThat(dcRes.getStatusCode()).isEqualTo(HttpStatus.SC_UNAUTHORIZED); AuthTestCommon.checkAuthenticateHeader(dcRes, OAuth2Helper.Scheme.BEARER, cellName); @@ -542,17 +542,17 @@ public void after() { /** * Basic認証ーCell制御オブジェクトの削除.
    * (共通ロジックのためBoxのみ実施) - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ @Test - public final void Basic認証ーCell制御オブジェクトの削除() throws DcException { + public final void Basic認証ーCell制御オブジェクトの削除() throws PersoniumException { String testBox = "BasicTestBox"; try { // 事前準備 BoxUtils.create(cellName, testBox, AbstractCase.MASTER_TOKEN_NAME); // 401エラーとなること - DcResponse dcRes = BoxUtils.deleteWithAuthSchema(cellName, testBox, authorization); + PersoniumResponse dcRes = BoxUtils.deleteWithAuthSchema(cellName, testBox, authorization); assertThat(dcRes.getStatusCode()).isEqualTo(HttpStatus.SC_UNAUTHORIZED); AuthTestCommon.checkAuthenticateHeader(dcRes, OAuth2Helper.Scheme.BEARER, cellName); @@ -571,10 +571,10 @@ public void after() { /** * Basic認証ーCell制御オブジェクトのNP登録.
    * (共通ロジックのためBox -> Roleのみ実施) - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ @Test - public final void Basic認証ーCell制御オブジェクトのNP登録() throws DcException { + public final void Basic認証ーCell制御オブジェクトのNP登録() throws PersoniumException { String testBox = Setup.TEST_BOX1; String testRole = "BasicTestRole"; try { @@ -598,10 +598,10 @@ public void after() { /** * Basic認証ーCell制御オブジェクトのNP一覧.
    * (共通ロジックのためBox -> Roleのみ実施) - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ @Test - public final void Basic認証ーCell制御オブジェクトのNP一覧() throws DcException { + public final void Basic認証ーCell制御オブジェクトのNP一覧() throws PersoniumException { String testBox = Setup.TEST_BOX1; // 401エラーとなること @@ -620,10 +620,10 @@ public void after() { /** * Basic認証ーCell制御オブジェクトのlinks登録.
    * (共通ロジックのためBox -> Roleのみ実施) - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ @Test - public final void Basic認証ーCell制御オブジェクトのlinks登録() throws DcException { + public final void Basic認証ーCell制御オブジェクトのlinks登録() throws PersoniumException { String testBox = Setup.TEST_BOX1; String testRole = "BasicTestRole"; try { @@ -651,10 +651,10 @@ public void after() { /** * Basic認証ーCell制御オブジェクトのlinks一覧.
    * (共通ロジックのためBox -> Roleのみ実施) - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ @Test - public final void Basic認証ーCell制御オブジェクトのlinks一覧() throws DcException { + public final void Basic認証ーCell制御オブジェクトのlinks一覧() throws PersoniumException { String testBox = Setup.TEST_BOX1; // 401エラーとなること TResponse res = RoleUtils.listLinkWithAuthSchema(cellName, authorization, "Box", testBox, @@ -671,10 +671,10 @@ public void after() { /** * Basic認証ーCell制御オブジェクトのlinks削除.
    * (共通ロジックのためBox -> Roleのみ実施) - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ @Test - public final void Basic認証ーCell制御オブジェクトのlinks削除() throws DcException { + public final void Basic認証ーCell制御オブジェクトのlinks削除() throws PersoniumException { String testBox = Setup.TEST_BOX1; String testRole = "BasicTestRole"; String testRoleKey = RoleUtils.keyString(testRole, testBox); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/BasicAuthDavCollectionLevelTest.java b/src/test/java/io/personium/test/jersey/cell/auth/BasicAuthDavCollectionLevelTest.java similarity index 95% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/auth/BasicAuthDavCollectionLevelTest.java rename to src/test/java/io/personium/test/jersey/cell/auth/BasicAuthDavCollectionLevelTest.java index dca487f5c..2ad5b9379 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/BasicAuthDavCollectionLevelTest.java +++ b/src/test/java/io/personium/test/jersey/cell/auth/BasicAuthDavCollectionLevelTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.auth; +package io.personium.test.jersey.cell.auth; import org.apache.commons.codec.binary.Base64; import org.apache.http.HttpStatus; @@ -22,25 +22,25 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.common.auth.token.Role; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.bar.BarInstallTestUtils; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.common.auth.token.Role; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.bar.BarInstallTestUtils; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; /** * Basic認証のBoxレベルのリソースに対するテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class BasicAuthDavCollectionLevelTest extends JerseyTest { @@ -62,7 +62,7 @@ public class BasicAuthDavCollectionLevelTest extends JerseyTest { * コンストラクタ. */ public BasicAuthDavCollectionLevelTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/BasicAuthODataCollectionLevelTest.java b/src/test/java/io/personium/test/jersey/cell/auth/BasicAuthODataCollectionLevelTest.java similarity index 95% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/auth/BasicAuthODataCollectionLevelTest.java rename to src/test/java/io/personium/test/jersey/cell/auth/BasicAuthODataCollectionLevelTest.java index d328186d1..00bb37dc2 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/BasicAuthODataCollectionLevelTest.java +++ b/src/test/java/io/personium/test/jersey/cell/auth/BasicAuthODataCollectionLevelTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.auth; +package io.personium.test.jersey.cell.auth; import static org.fest.assertions.Assertions.assertThat; import static org.junit.Assert.assertEquals; @@ -30,27 +30,27 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.auth.OAuth2Helper; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcException; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.box.odatacol.batch.AbstractUserDataBatchTest; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.BatchUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.core.auth.OAuth2Helper; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumException; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.box.odatacol.batch.AbstractUserDataBatchTest; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.BatchUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; import com.sun.jersey.test.framework.JerseyTest; /** * Basic認証のBoxレベルのリソースに対するテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class BasicAuthODataCollectionLevelTest extends JerseyTest { @@ -75,7 +75,7 @@ public class BasicAuthODataCollectionLevelTest extends JerseyTest { * コンストラクタ. */ public BasicAuthODataCollectionLevelTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -95,10 +95,10 @@ public BasicAuthODataCollectionLevelTest() { /** * Basic認証ー$batchでのUserODataの操作. - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ @Test - public final void Basic認証ー$batchでのUserODataの操作() throws DcException { + public final void Basic認証ー$batchでのUserODataの操作() throws PersoniumException { // ※$batchは通常のODataの操作とは別ルートでの処理になっているため、テストも分離。 try { // $batchのボディ(ユーザOData 作成 - 取得 - 削除)を作成 diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/BasicAuthSvcCollectionLevelTest.java b/src/test/java/io/personium/test/jersey/cell/auth/BasicAuthSvcCollectionLevelTest.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/auth/BasicAuthSvcCollectionLevelTest.java rename to src/test/java/io/personium/test/jersey/cell/auth/BasicAuthSvcCollectionLevelTest.java index 62a3dc517..0a984ec84 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/BasicAuthSvcCollectionLevelTest.java +++ b/src/test/java/io/personium/test/jersey/cell/auth/BasicAuthSvcCollectionLevelTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.auth; +package io.personium.test.jersey.cell.auth; import static org.fest.assertions.Assertions.assertThat; import static org.junit.Assert.assertEquals; @@ -29,25 +29,25 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.common.auth.token.Role; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.common.auth.token.Role; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; /** * Basic認証のBoxレベル_Serviceコレクションリソースに対するテスト. * テストで使用するセル・ボックスは、他のBasic認証テストと同じものを使用する。 */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class BasicAuthSvcCollectionLevelTest extends JerseyTest { @@ -69,7 +69,7 @@ public class BasicAuthSvcCollectionLevelTest extends JerseyTest { * コンストラクタ. */ public BasicAuthSvcCollectionLevelTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/BasicAuthUnitLevelTest.java b/src/test/java/io/personium/test/jersey/cell/auth/BasicAuthUnitLevelTest.java similarity index 83% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/auth/BasicAuthUnitLevelTest.java rename to src/test/java/io/personium/test/jersey/cell/auth/BasicAuthUnitLevelTest.java index 40d0fafd3..e0debf4d3 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/BasicAuthUnitLevelTest.java +++ b/src/test/java/io/personium/test/jersey/cell/auth/BasicAuthUnitLevelTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.auth; +package io.personium.test.jersey.cell.auth; import static org.fest.assertions.Assertions.assertThat; import static org.junit.Assert.assertEquals; @@ -29,21 +29,21 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; /** * Basic認証のUnitレベルのリソースに対するテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class BasicAuthUnitLevelTest extends JerseyTest { @@ -57,7 +57,7 @@ public class BasicAuthUnitLevelTest extends JerseyTest { * コンストラクタ. */ public BasicAuthUnitLevelTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/ImplicitFlowTest.java b/src/test/java/io/personium/test/jersey/cell/auth/ImplicitFlowTest.java similarity index 88% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/auth/ImplicitFlowTest.java rename to src/test/java/io/personium/test/jersey/cell/auth/ImplicitFlowTest.java index ed15bfbb8..bacdda366 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/ImplicitFlowTest.java +++ b/src/test/java/io/personium/test/jersey/cell/auth/ImplicitFlowTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.auth; +package io.personium.test.jersey.cell.auth; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -46,45 +46,45 @@ import org.xml.sax.InputSource; import org.xml.sax.SAXException; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token.TokenDsigException; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token.TokenParseException; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token.TokenRootCrtException; -import com.fujitsu.dc.common.auth.token.AccountAccessToken; -import com.fujitsu.dc.common.auth.token.CellLocalAccessToken; -import com.fujitsu.dc.common.auth.token.CellLocalRefreshToken; -import com.fujitsu.dc.common.auth.token.TransCellAccessToken; -import com.fujitsu.dc.common.auth.token.UnitLocalUnitUserToken; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreMessageUtils; -import com.fujitsu.dc.core.auth.OAuth2Helper; -import com.fujitsu.dc.core.model.lock.LockManager; -import com.fujitsu.dc.core.rs.cell.AuthResourceUtils; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcException; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRestAdapter; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.ExtCellUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.common.auth.token.AbstractOAuth2Token; +import io.personium.common.auth.token.AbstractOAuth2Token.TokenDsigException; +import io.personium.common.auth.token.AbstractOAuth2Token.TokenParseException; +import io.personium.common.auth.token.AbstractOAuth2Token.TokenRootCrtException; +import io.personium.common.auth.token.AccountAccessToken; +import io.personium.common.auth.token.CellLocalAccessToken; +import io.personium.common.auth.token.CellLocalRefreshToken; +import io.personium.common.auth.token.TransCellAccessToken; +import io.personium.common.auth.token.UnitLocalUnitUserToken; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreMessageUtils; +import io.personium.core.auth.OAuth2Helper; +import io.personium.core.model.lock.LockManager; +import io.personium.core.rs.cell.AuthResourceUtils; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumException; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumRestAdapter; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.ExtCellUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; import com.sun.org.apache.xerces.internal.parsers.DOMParser; /** * ImplicitFlow認証のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) @SuppressWarnings("restriction") public class ImplicitFlowTest extends JerseyTest { @@ -115,7 +115,7 @@ public void after() { * コンストラクタ. */ public ImplicitFlowTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -125,7 +125,7 @@ public ImplicitFlowTest() { public final void 存在しないCellに対してImplicitFlow認証リクエストを実行し404エラーとなること() { String reqCell = UrlUtils.cellRoot("dummyCell"); - DcResponse res = requesttoAuthz(null, reqCell, Setup.TEST_CELL_SCHEMA1, null); + PersoniumResponse res = requesttoAuthz(null, reqCell, Setup.TEST_CELL_SCHEMA1, null); assertEquals(HttpStatus.SC_NOT_FOUND, res.getStatusCode()); } @@ -135,7 +135,7 @@ public ImplicitFlowTest() { @Test public final void 認証フォームへのPOSTで200が返ること() { - DcResponse res = requesttoAuthz(null); + PersoniumResponse res = requesttoAuthz(null); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); @@ -157,7 +157,7 @@ public ImplicitFlowTest() { // Box作成 BoxUtils.createWithSchema(Setup.TEST_CELL1, "authzBox", AbstractCase.MASTER_TOKEN_NAME, clientId); - DcResponse res = requesttoAuthz(null, Setup.TEST_CELL1, clientId, null); + PersoniumResponse res = requesttoAuthz(null, Setup.TEST_CELL1, clientId, null); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); } finally { @@ -172,7 +172,7 @@ public ImplicitFlowTest() { public final void 認証フォームへのPOSTでredirect_uriとclient_idが異なる場合400エラーとなること() { String redirectUri = UrlUtils.cellRoot(Setup.TEST_CELL2) + REDIRECT_HTML; - DcResponse res = requesttoAuthz(null, Setup.TEST_CELL1, UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1), + PersoniumResponse res = requesttoAuthz(null, Setup.TEST_CELL1, UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1), redirectUri); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); @@ -185,7 +185,7 @@ public ImplicitFlowTest() { public final void 認証フォームへのPOSTでclient_idで指定したCellをスキーマに持つBoxが存在しない場合認可エラーとなること() { String clientId = UrlUtils.cellRoot("dummyCell"); - DcResponse res = requesttoAuthz(null, Setup.TEST_CELL1, clientId, null); + PersoniumResponse res = requesttoAuthz(null, Setup.TEST_CELL1, clientId, null); assertEquals(HttpStatus.SC_MOVED_TEMPORARILY, res.getStatusCode()); assertEquals(UrlUtils.cellRoot(Setup.TEST_CELL1) + "__html/error?code=PS-ER-0003", @@ -205,7 +205,7 @@ public ImplicitFlowTest() { CellUtils.create(cellName, AbstractCase.MASTER_TOKEN_NAME, HttpStatus.SC_CREATED); // __authzリクエストを実行 - DcResponse res = requesttoAuthz(null, cellName, clientId, null); + PersoniumResponse res = requesttoAuthz(null, cellName, clientId, null); assertEquals(HttpStatus.SC_MOVED_TEMPORARILY, res.getStatusCode()); assertEquals(UrlUtils.cellRoot(cellName) + "__html/error?code=PS-ER-0003", @@ -226,7 +226,7 @@ public ImplicitFlowTest() { String addbody = "&username=account2&password=password2"; - DcResponse res = requesttoAuthz(addbody); + PersoniumResponse res = requesttoAuthz(addbody); assertEquals(HttpStatus.SC_MOVED_TEMPORARILY, res.getStatusCode()); @@ -262,7 +262,7 @@ public ImplicitFlowTest() { String addbody = "&username=account2&password=dummypassword"; - DcResponse res = requesttoAuthz(addbody); + PersoniumResponse res = requesttoAuthz(addbody); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); // アカウントの最終ログイン時刻が更新されていないことの確認 @@ -278,12 +278,12 @@ public ImplicitFlowTest() { /** * パスワード認証失敗後1秒以内に成功する認証をリクエストした場合200が返却されてエラーhtmlが返却されること. - * com.fujitsu.dc.core.lock.accountlock.timeを1秒に設定すると失敗するためIgnore + * io.personium.core.lock.accountlock.timeを1秒に設定すると失敗するためIgnore */ @Test @Ignore public final void パスワード認証失敗後1秒以内に成功する認証をリクエストした場合200が返却されてエラーhtmlが返却されること() { - String lockType = DcCoreConfig.getLockType(); + String lockType = PersoniumUnitConfig.getLockType(); if (lockType.equals("memcached")) { String addbody = "&username=account2&password=dummypassword"; @@ -291,7 +291,7 @@ public ImplicitFlowTest() { Long lastAuthenticatedTime = AuthTestCommon.getAccountLastAuthenticated(Setup.TEST_CELL1, "account2"); // パスワード認証(失敗) - DcResponse res = requesttoAuthz(addbody); + PersoniumResponse res = requesttoAuthz(addbody); // レスポンスヘッダのチェック assertEquals(MediaType.TEXT_HTML + ";charset=UTF-8", res.getFirstHeader(HttpHeaders.CONTENT_TYPE)); @@ -318,17 +318,17 @@ public ImplicitFlowTest() { /** * パスワード認証失敗後1秒以内に失敗する認証をリクエストした場合200が返却されてエラーhtmlが返却されること. - * com.fujitsu.dc.core.lock.accountlock.timeを1秒に設定すると失敗するためIgnore + * io.personium.core.lock.accountlock.timeを1秒に設定すると失敗するためIgnore */ @Test @Ignore public final void パスワード認証失敗後1秒以内に失敗する認証をリクエストした場合200が返却されてエラーhtmlが返却されること() { - String lockType = DcCoreConfig.getLockType(); + String lockType = PersoniumUnitConfig.getLockType(); if (lockType.equals("memcached")) { String addbody = "&username=account2&password=dummypassword"; // パスワード認証(失敗) - DcResponse res = requesttoAuthz(addbody); + PersoniumResponse res = requesttoAuthz(addbody); // レスポンスヘッダのチェック assertEquals(MediaType.TEXT_HTML + ";charset=UTF-8", res.getFirstHeader(HttpHeaders.CONTENT_TYPE)); @@ -356,12 +356,12 @@ public ImplicitFlowTest() { */ @Test public final void パスワード認証失敗後1秒後に成功する認証をリクエストした場合302が返却されること() { - String lockType = DcCoreConfig.getLockType(); + String lockType = PersoniumUnitConfig.getLockType(); if (lockType.equals("memcached")) { String addbody = "&username=account2&password=dummypassword"; // パスワード認証(失敗) - DcResponse res = requesttoAuthz(addbody); + PersoniumResponse res = requesttoAuthz(addbody); // レスポンスヘッダのチェック assertEquals(MediaType.TEXT_HTML + ";charset=UTF-8", res.getFirstHeader(HttpHeaders.CONTENT_TYPE)); @@ -398,12 +398,12 @@ public ImplicitFlowTest() { */ @Test public final void パスワード認証失敗後1秒後に失敗する認証をリクエストした場合200が返却されてエラーhtmlが返却されること() { - String lockType = DcCoreConfig.getLockType(); + String lockType = PersoniumUnitConfig.getLockType(); if (lockType.equals("memcached")) { String addbody = "&username=account2&password=dummypassword"; // パスワード認証(失敗) - DcResponse res = requesttoAuthz(addbody); + PersoniumResponse res = requesttoAuthz(addbody); // レスポンスヘッダのチェック assertEquals(MediaType.TEXT_HTML + ";charset=UTF-8", res.getFirstHeader(HttpHeaders.CONTENT_TYPE)); @@ -441,7 +441,7 @@ public ImplicitFlowTest() { // ユーザ名が空 String addbody = "&username=&password=password2"; - DcResponse res = requesttoAuthz(addbody); + PersoniumResponse res = requesttoAuthz(addbody); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); // アカウントの最終ログイン時刻が更新されていないことの確認 @@ -478,7 +478,7 @@ public ImplicitFlowTest() { String addbody = "&username=dummyaccount&password=dummypassword"; - DcResponse res = requesttoAuthz(addbody); + PersoniumResponse res = requesttoAuthz(addbody); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); @@ -499,9 +499,9 @@ public ImplicitFlowTest() { // 認証前のアカウントの最終ログイン時刻を取得しておく Long lastAuthenticatedTime = AuthTestCommon.getAccountLastAuthenticated(Setup.TEST_CELL2, "account4"); - String addbody = "&username=account4&password=password4&dc_target=" + UrlUtils.cellRoot(Setup.TEST_CELL1); + String addbody = "&username=account4&password=password4&p_target=" + UrlUtils.cellRoot(Setup.TEST_CELL1); - DcResponse res = requesttoAuthz(addbody, Setup.TEST_CELL2, UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1), null); + PersoniumResponse res = requesttoAuthz(addbody, Setup.TEST_CELL2, UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1), null); assertEquals(HttpStatus.SC_MOVED_TEMPORARILY, res.getStatusCode()); // アカウントの最終ログイン時刻が更新されたことの確認 @@ -541,13 +541,13 @@ public ImplicitFlowTest() { // 認証前のアカウントの最終ログイン時刻を取得しておく Long lastAuthenticatedTime = AuthTestCommon.getAccountLastAuthenticated(Setup.TEST_CELL1, "account2"); - String addbody = "&username=account2&password=password2&dc_owner=true"; + String addbody = "&username=account2&password=password2&p_owner=true"; // アカウントにユニット昇格権限付与 DavResourceUtils.setProppatch(Setup.TEST_CELL1, AbstractCase.MASTER_TOKEN_NAME, "cell/proppatch-uluut.txt", HttpStatus.SC_MULTI_STATUS); - DcResponse res = requesttoAuthz(addbody); + PersoniumResponse res = requesttoAuthz(addbody); // アカウントの最終ログイン時刻が更新されたことの確認 AuthTestCommon.accountLastAuthenticatedCheck(Setup.TEST_CELL1, "account2", lastAuthenticatedTime); @@ -574,19 +574,19 @@ public ImplicitFlowTest() { } /** - * パスワード認証でdc_targetとdc_ownerを指定した場合ULUUTを取得できること. + * パスワード認証でp_targetとp_ownerを指定した場合ULUUTを取得できること. */ @Test - public final void パスワード認証でdc_targetとdc_ownerを指定した場合ULUUTを取得できること() { + public final void パスワード認証でp_targetとp_ownerを指定した場合ULUUTを取得できること() { - String addbody = "&username=account2&password=password2&dc_owner=true&dc_target=" + String addbody = "&username=account2&password=password2&p_owner=true&p_target=" + UrlUtils.cellRoot(Setup.TEST_CELL1); // アカウントにユニット昇格権限付与 DavResourceUtils.setProppatch(Setup.TEST_CELL2, AbstractCase.MASTER_TOKEN_NAME, "cell/proppatch-uluut.txt", HttpStatus.SC_MULTI_STATUS); - DcResponse res = requesttoAuthz(addbody, Setup.TEST_CELL2, UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1), null); + PersoniumResponse res = requesttoAuthz(addbody, Setup.TEST_CELL2, UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1), null); assertEquals(HttpStatus.SC_MOVED_TEMPORARILY, res.getStatusCode()); @@ -621,7 +621,7 @@ public ImplicitFlowTest() { // 認証前のアカウントの最終ログイン時刻を取得しておく Long lastAuthenticatedTime = AuthTestCommon.getAccountLastAuthenticated(Setup.TEST_CELL1, "account2"); - DcResponse res = requesttoAuthz(addbody, Setup.TEST_CELL1, UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1), + PersoniumResponse res = requesttoAuthz(addbody, Setup.TEST_CELL1, UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1), redirectUri); assertEquals(HttpStatus.SC_MOVED_TEMPORARILY, res.getStatusCode()); @@ -640,7 +640,7 @@ public ImplicitFlowTest() { String addbody = "&username=account2&password=password2"; String redirectUri = UrlUtils.cellRoot(Setup.TEST_CELL2) + REDIRECT_HTML; - DcResponse res = requesttoAuthz(addbody, Setup.TEST_CELL1, UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1), + PersoniumResponse res = requesttoAuthz(addbody, Setup.TEST_CELL1, UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1), redirectUri); assertEquals(HttpStatus.SC_MOVED_TEMPORARILY, res.getStatusCode()); @@ -660,7 +660,7 @@ public ImplicitFlowTest() { + "&redirect_uri=" + UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1) + REDIRECT_HTML + "&state=" + DEFAULT_STATE + "&username=account2&password=password2"; - DcResponse res = requesttoAuthzWithBody(Setup.TEST_CELL1, body); + PersoniumResponse res = requesttoAuthzWithBody(Setup.TEST_CELL1, body); assertEquals(HttpStatus.SC_MOVED_TEMPORARILY, res.getStatusCode()); @@ -679,7 +679,7 @@ public ImplicitFlowTest() { String addbody = "&username=account2&password=password2&keeplogin=true"; - DcResponse res = requesttoAuthz(addbody); + PersoniumResponse res = requesttoAuthz(addbody); assertEquals(HttpStatus.SC_MOVED_TEMPORARILY, res.getStatusCode()); @@ -714,7 +714,7 @@ public ImplicitFlowTest() { // トークン認証 String addbody = "&assertion=" + transCellAccessToken; - DcResponse res = requesttoAuthz(addbody, Setup.TEST_CELL2, UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1), null); + PersoniumResponse res = requesttoAuthz(addbody, Setup.TEST_CELL2, UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1), null); assertEquals(HttpStatus.SC_MOVED_TEMPORARILY, res.getStatusCode()); // アカウントの最終ログイン時刻が更新されていないことの確認 @@ -753,8 +753,8 @@ public ImplicitFlowTest() { String transCellAccessToken = getTcToken(); // トークン認証 - String addbody = "&assertion=" + transCellAccessToken + "&dc_target=" + UrlUtils.cellRoot("authzcell"); - DcResponse res = requesttoAuthz(addbody, Setup.TEST_CELL2, + String addbody = "&assertion=" + transCellAccessToken + "&p_target=" + UrlUtils.cellRoot("authzcell"); + PersoniumResponse res = requesttoAuthz(addbody, Setup.TEST_CELL2, UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1), null); assertEquals(HttpStatus.SC_MOVED_TEMPORARILY, res.getStatusCode()); @@ -801,7 +801,7 @@ public ImplicitFlowTest() { String body = "client_id=" + clientId + "&redirect_uri=" + redirecturi + "&state=" + DEFAULT_STATE + addbody; - DcResponse res = requesttoAuthzWithBody(Setup.TEST_CELL2, body); + PersoniumResponse res = requesttoAuthzWithBody(Setup.TEST_CELL2, body); assertEquals(HttpStatus.SC_MOVED_TEMPORARILY, res.getStatusCode()); @@ -826,7 +826,7 @@ public ImplicitFlowTest() { String body = "response_type=token" + "&redirect_uri=" + redirecturi + "&state=" + DEFAULT_STATE + addbody; - DcResponse res = requesttoAuthzWithBody(Setup.TEST_CELL2, body); + PersoniumResponse res = requesttoAuthzWithBody(Setup.TEST_CELL2, body); assertEquals(HttpStatus.SC_MOVED_TEMPORARILY, res.getStatusCode()); @@ -847,7 +847,7 @@ public ImplicitFlowTest() { String clientId = UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1); String body = "response_type=token&client_id=" + clientId + "&state=" + DEFAULT_STATE + addbody; - DcResponse res = requesttoAuthzWithBody(Setup.TEST_CELL2, body); + PersoniumResponse res = requesttoAuthzWithBody(Setup.TEST_CELL2, body); assertEquals(HttpStatus.SC_MOVED_TEMPORARILY, res.getStatusCode()); @@ -868,7 +868,7 @@ public ImplicitFlowTest() { String body = "response_type=token&client_id=" + clientId + "&redirect_uri=" + redirecturi + "&state=" + DEFAULT_STATE + addbody; - DcResponse res = requesttoAuthzWithBody(Setup.TEST_CELL2, body); + PersoniumResponse res = requesttoAuthzWithBody(Setup.TEST_CELL2, body); assertEquals(HttpStatus.SC_MOVED_TEMPORARILY, res.getStatusCode()); @@ -894,7 +894,7 @@ public ImplicitFlowTest() { String body = "response_type=token&client_id=" + clientId + "&redirect_uri=" + redirecturi + "&state=" + DEFAULT_STATE + addbody; - DcResponse res = requesttoAuthzWithBody(Setup.TEST_CELL1, body); + PersoniumResponse res = requesttoAuthzWithBody(Setup.TEST_CELL1, body); assertEquals(HttpStatus.SC_MOVED_TEMPORARILY, res.getStatusCode()); @@ -913,7 +913,7 @@ public ImplicitFlowTest() { // パスワード認証で自分セルリフレッシュトークン取得 String addbody = "&username=account2&password=password2"; - DcResponse res = requesttoAuthz(addbody); + PersoniumResponse res = requesttoAuthz(addbody); assertEquals(HttpStatus.SC_MOVED_TEMPORARILY, res.getStatusCode()); // cookieの値と有効期限の確認 String sessionId = checkSessionId(false, Setup.TEST_CELL1); @@ -956,7 +956,7 @@ public ImplicitFlowTest() { // パスワード認証で自分セルリフレッシュトークン取得 String addbody = "&username=account2&password=password2"; - DcResponse res = requesttoAuthz(addbody); + PersoniumResponse res = requesttoAuthz(addbody); assertEquals(HttpStatus.SC_MOVED_TEMPORARILY, res.getStatusCode()); // cookieの値と有効期限の確認 String sessionId = checkSessionId(false, Setup.TEST_CELL1); @@ -965,7 +965,7 @@ public ImplicitFlowTest() { String body = "response_type=token&client_id=" + UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1) + "&redirect_uri=" + UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1) + REDIRECT_HTML + "&state=" + DEFAULT_STATE - + "&dc_target=" + UrlUtils.cellRoot(Setup.TEST_CELL2); + + "&p_target=" + UrlUtils.cellRoot(Setup.TEST_CELL2); HashMap headers = new HashMap(); headers.put("session-id", sessionId); res = requesttoAuthzWithBody(Setup.TEST_CELL1, body, headers); @@ -995,14 +995,14 @@ public ImplicitFlowTest() { } /** - * Cookie認証でdc_ownerを指定した場合ULUUTを取得できること. + * Cookie認証でp_ownerを指定した場合ULUUTを取得できること. */ @Test - public final void Cookie認証でdc_ownerを指定した場合ULUUTを取得できること() { + public final void Cookie認証でp_ownerを指定した場合ULUUTを取得できること() { // パスワード認証で自分セルリフレッシュトークン取得 String addbody = "&username=account2&password=password2"; - DcResponse res = requesttoAuthz(addbody); + PersoniumResponse res = requesttoAuthz(addbody); assertEquals(HttpStatus.SC_MOVED_TEMPORARILY, res.getStatusCode()); // cookieの値と有効期限の確認 String sessionId = checkSessionId(false, Setup.TEST_CELL1); @@ -1015,7 +1015,7 @@ public ImplicitFlowTest() { String body = "response_type=token&client_id=" + UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1) + "&redirect_uri=" + UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1) + REDIRECT_HTML + "&state=" + DEFAULT_STATE - + "&dc_owner=true"; + + "&p_owner=true"; HashMap headers = new HashMap(); headers.put("session-id", sessionId); res = requesttoAuthzWithBody(Setup.TEST_CELL1, body, headers); @@ -1041,14 +1041,14 @@ public ImplicitFlowTest() { } /** - * Cookie認証でdc_targetとdc_ownerを指定した場合ULUUTを取得できること. + * Cookie認証でp_targetとp_ownerを指定した場合ULUUTを取得できること. */ @Test - public final void Cookie認証でdc_targetとdc_ownerを指定した場合ULUUTを取得できること() { + public final void Cookie認証でp_targetとp_ownerを指定した場合ULUUTを取得できること() { // パスワード認証で自分セルリフレッシュトークン取得 String addbody = "&username=account2&password=password2"; - DcResponse res = requesttoAuthz(addbody); + PersoniumResponse res = requesttoAuthz(addbody); assertEquals(HttpStatus.SC_MOVED_TEMPORARILY, res.getStatusCode()); // cookieの値と有効期限の確認 String sessionId = checkSessionId(false, Setup.TEST_CELL1); @@ -1061,7 +1061,7 @@ public ImplicitFlowTest() { String body = "response_type=token&client_id=" + UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1) + "&redirect_uri=" + UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1) + REDIRECT_HTML + "&state=" + DEFAULT_STATE - + "&dc_owner=true&dc_target=" + UrlUtils.cellRoot(Setup.TEST_CELL2); + + "&p_owner=true&p_target=" + UrlUtils.cellRoot(Setup.TEST_CELL2); HashMap headers = new HashMap(); headers.put("session-id", sessionId); res = requesttoAuthzWithBody(Setup.TEST_CELL1, body, headers); @@ -1096,7 +1096,7 @@ public ImplicitFlowTest() { // パスワード認証で自分セルリフレッシュトークン取得 String addbody = "&username=account4&password=password4"; - DcResponse res = requesttoAuthz(addbody); + PersoniumResponse res = requesttoAuthz(addbody); assertEquals(HttpStatus.SC_MOVED_TEMPORARILY, res.getStatusCode()); // cookieの値と有効期限の確認 String sessionId = checkSessionId(false, Setup.TEST_CELL1); @@ -1109,7 +1109,7 @@ public ImplicitFlowTest() { String body = "response_type=token&client_id=" + UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1) + "&redirect_uri=" + UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1) + REDIRECT_HTML + "&state=" + DEFAULT_STATE - + "&dc_owner=true"; + + "&p_owner=true"; HashMap headers = new HashMap(); headers.put("session-id", sessionId); res = requesttoAuthzWithBody(Setup.TEST_CELL1, body, headers); @@ -1128,10 +1128,10 @@ public ImplicitFlowTest() { } /** - * Cookie認証でオーナー指定の無いセルに対しdc_ownerを指定した場合302が返ること. + * Cookie認証でオーナー指定の無いセルに対しp_ownerを指定した場合302が返ること. */ @Test - public final void Cookie認証でオーナー指定の無いセルに対しdc_ownerを指定した場合302が返ること() { + public final void Cookie認証でオーナー指定の無いセルに対しp_ownerを指定した場合302が返ること() { String cellName = "authzcell"; try { @@ -1148,7 +1148,7 @@ public ImplicitFlowTest() { // パスワード認証で自分セルリフレッシュトークン取得 String addbody = "&username=account1&password=password1"; - DcResponse res = requesttoAuthz(addbody, cellName, UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1), null); + PersoniumResponse res = requesttoAuthz(addbody, cellName, UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1), null); assertEquals(HttpStatus.SC_MOVED_TEMPORARILY, res.getStatusCode()); // cookieの値と有効期限の確認 String sessionId = checkSessionId(false, cellName); @@ -1161,7 +1161,7 @@ public ImplicitFlowTest() { String body = "response_type=token&client_id=" + UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1) + "&redirect_uri=" + UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1) + REDIRECT_HTML + "&state=" + DEFAULT_STATE - + "&dc_owner=true"; + + "&p_owner=true"; HashMap headers = new HashMap(); headers.put("session-id", sessionId); res = requesttoAuthzWithBody(cellName, body, headers); @@ -1197,7 +1197,7 @@ public ImplicitFlowTest() { // パスワード認証で自分セルリフレッシュトークン取得 String addbody = "&username=account2&password=password2"; - DcResponse res = requesttoAuthz(addbody); + PersoniumResponse res = requesttoAuthz(addbody); assertEquals(HttpStatus.SC_MOVED_TEMPORARILY, res.getStatusCode()); // cookieの値と有効期限の確認 String sessionId = checkSessionId(false, Setup.TEST_CELL1); @@ -1238,7 +1238,7 @@ public ImplicitFlowTest() { + "&state=" + DEFAULT_STATE; HashMap headers = new HashMap(); headers.put("session-id", sessionId); - DcResponse res = requesttoAuthzWithBody(Setup.TEST_CELL1, body, headers); + PersoniumResponse res = requesttoAuthzWithBody(Setup.TEST_CELL1, body, headers); // cookieが設定されていないことの確認 Map sessionMap = getSessionMap(); @@ -1268,7 +1268,7 @@ public ImplicitFlowTest() { + "&state=" + DEFAULT_STATE; HashMap headers = new HashMap(); headers.put("session-id", sessionId); - DcResponse res = requesttoAuthzWithBody(Setup.TEST_CELL1, body, headers); + PersoniumResponse res = requesttoAuthzWithBody(Setup.TEST_CELL1, body, headers); // cookieが設定されていないことの確認 Map sessionMap = getSessionMap(); @@ -1288,7 +1288,7 @@ public ImplicitFlowTest() { * @param addbody 追加のボディ * @return レスポンス */ - private DcResponse requesttoAuthz(String addbody) { + private PersoniumResponse requesttoAuthz(String addbody) { return requesttoAuthz(addbody, Setup.TEST_CELL1, UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1), null); } @@ -1300,7 +1300,7 @@ private DcResponse requesttoAuthz(String addbody) { * @param redirecturi redirect_uri * @return レスポンス */ - private DcResponse requesttoAuthz(String addbody, String requestCellName, String clientId, String redirecturi) { + private PersoniumResponse requesttoAuthz(String addbody, String requestCellName, String clientId, String redirecturi) { if (addbody == null) { addbody = ""; } @@ -1322,7 +1322,7 @@ private DcResponse requesttoAuthz(String addbody, String requestCellName, String * @param body ボディ * @return レスポンス */ - private DcResponse requesttoAuthzWithBody(String requestCellName, String body) { + private PersoniumResponse requesttoAuthzWithBody(String requestCellName, String body) { return requesttoAuthzWithBody(requestCellName, body, null); } @@ -1333,11 +1333,11 @@ private DcResponse requesttoAuthzWithBody(String requestCellName, String body) { * @param requestheaders 追加のリクエストヘッダ * @return レスポンス */ - private DcResponse requesttoAuthzWithBody(String requestCellName, + private PersoniumResponse requesttoAuthzWithBody(String requestCellName, String body, HashMap requestheaders) { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット if (requestheaders == null) { @@ -1352,14 +1352,14 @@ private DcResponse requesttoAuthzWithBody(String requestCellName, cookies = rest.getCookies(); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } return res; } - private Map parseResponse(DcResponse res) { + private Map parseResponse(PersoniumResponse res) { String location = res.getFirstHeader(HttpHeaders.LOCATION); System.out.println(location); String[] locations = location.split("#"); @@ -1410,11 +1410,11 @@ private Map getSessionMap() { return sessionMap; } - static void checkHtmlBody(DcResponse res, String messageId, String dataCellName) { + static void checkHtmlBody(PersoniumResponse res, String messageId, String dataCellName) { checkHtmlBody(res, messageId, dataCellName, ""); } - static void checkHtmlBody(DcResponse res, String messageId, String dataCellName, String dcOwner) { + static void checkHtmlBody(PersoniumResponse res, String messageId, String dataCellName, String dcOwner) { DOMParser parser = new DOMParser(); InputSource body = null; body = new InputSource(res.bodyAsStream()); @@ -1430,7 +1430,7 @@ static void checkHtmlBody(DcResponse res, String messageId, String dataCellName, assertEquals(AuthResourceUtils.getJavascript("ajax.js"), ((Element) nodeList.item(0)).getTextContent()); nodeList = document.getElementsByTagName("title"); - assertEquals(DcCoreMessageUtils.getMessage("PS-AU-0001"), ((Element) nodeList.item(0)).getTextContent()); + assertEquals(PersoniumCoreMessageUtils.getMessage("PS-AU-0001"), ((Element) nodeList.item(0)).getTextContent()); nodeList = document.getElementsByTagName("body"); String expectedAppUrl = UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1) + "__/profile.json"; @@ -1439,7 +1439,7 @@ static void checkHtmlBody(DcResponse res, String messageId, String dataCellName, ((Element) nodeList.item(0)).getAttribute("onload")); nodeList = document.getElementsByTagName("h1"); - assertEquals(DcCoreMessageUtils.getMessage("PS-AU-0001"), ((Element) nodeList.item(0)).getTextContent()); + assertEquals(PersoniumCoreMessageUtils.getMessage("PS-AU-0001"), ((Element) nodeList.item(0)).getTextContent()); nodeList = document.getElementsByTagName("form"); String expectedFormUrl = UrlUtils.cellRoot(dataCellName) + "__authz"; @@ -1450,7 +1450,7 @@ static void checkHtmlBody(DcResponse res, String messageId, String dataCellName, Element element = (Element) nodeList.item(i); String id = element.getAttribute("id"); if ("message".equals(id)) { - assertEquals(DcCoreMessageUtils.getMessage(messageId).replaceAll("
    ", ""), + assertEquals(PersoniumCoreMessageUtils.getMessage(messageId).replaceAll("
    ", ""), element.getTextContent()); } } @@ -1461,10 +1461,10 @@ static void checkHtmlBody(DcResponse res, String messageId, String dataCellName, String id = element.getAttribute("id"); if ("state".equals(id)) { assertEquals(DEFAULT_STATE, element.getAttribute("value")); - } else if ("dc_target".equals(id)) { + } else if ("p_target".equals(id)) { assertEquals("", element.getAttribute("value")); - } else if ("dc_owner".equals(id)) { + } else if ("p_owner".equals(id)) { assertEquals(dcOwner, element.getAttribute("value")); } else if ("client_id".equals(id)) { assertEquals(UrlUtils.cellRoot(Setup.TEST_CELL_SCHEMA1), element.getAttribute("value")); @@ -1482,7 +1482,7 @@ private String getTcToken() { .with("remoteCell", Setup.TEST_CELL1) .with("username", "account1") .with("password", "password1") - .with("dc_target", UrlUtils.cellRoot(Setup.TEST_CELL2)) + .with("p_target", UrlUtils.cellRoot(Setup.TEST_CELL2)) .returns() .statusCode(HttpStatus.SC_OK); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/MyPasswordTest.java b/src/test/java/io/personium/test/jersey/cell/auth/MyPasswordTest.java similarity index 85% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/auth/MyPasswordTest.java rename to src/test/java/io/personium/test/jersey/cell/auth/MyPasswordTest.java index 9fdd0df21..f25daac5f 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/MyPasswordTest.java +++ b/src/test/java/io/personium/test/jersey/cell/auth/MyPasswordTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.auth; +package io.personium.test.jersey.cell.auth; import static org.junit.Assert.assertEquals; @@ -28,31 +28,31 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token.TokenParseException; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.auth.OAuth2Helper; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcException; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRestAdapter; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.common.auth.token.AbstractOAuth2Token.TokenParseException; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.auth.OAuth2Helper; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumException; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumRestAdapter; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; /** * パスワード変更APIのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class MyPasswordTest extends JerseyTest { @@ -63,7 +63,7 @@ public class MyPasswordTest extends JerseyTest { * コンストラクタ. */ public MyPasswordTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -82,7 +82,7 @@ public MyPasswordTest() { String tokenStr = (String) resBody.get(OAuth2Helper.Key.ACCESS_TOKEN); Long lastAuthenticatedTime = AuthTestCommon.getAccountLastAuthenticated(Setup.TEST_CELL1, "PasswordTest"); - DcResponse res = requesttoMypassword(tokenStr, "newPassword", Setup.TEST_CELL1); + PersoniumResponse res = requesttoMypassword(tokenStr, "newPassword", Setup.TEST_CELL1); assertEquals(204, res.getStatusCode()); AuthTestCommon.accountLastAuthenticatedNotUpdatedCheck( Setup.TEST_CELL1, "PasswordTest", lastAuthenticatedTime); @@ -125,7 +125,7 @@ public MyPasswordTest() { // セルローカルトークンを取得する String tokenStr = (String) resBody.get(OAuth2Helper.Key.ACCESS_TOKEN); - DcResponse res = requesttoMypassword(tokenStr, "newPassword", Setup.TEST_CELL1); + PersoniumResponse res = requesttoMypassword(tokenStr, "newPassword", Setup.TEST_CELL1); assertEquals(204, res.getStatusCode()); // 確認 @@ -159,14 +159,14 @@ public MyPasswordTest() { .with("remoteCell", Setup.TEST_CELL1) .with("username", "account1") .with("password", "password1") - .with("dc_target", UrlUtils.cellRoot(Setup.TEST_CELL2)) + .with("p_target", UrlUtils.cellRoot(Setup.TEST_CELL2)) .returns() .statusCode(HttpStatus.SC_OK); JSONObject json = res.bodyAsJson(); String transCellAccessToken = (String) json.get(OAuth2Helper.Key.ACCESS_TOKEN); - DcResponse response = requesttoMypassword(transCellAccessToken, "newPassword", Setup.TEST_CELL1); + PersoniumResponse response = requesttoMypassword(transCellAccessToken, "newPassword", Setup.TEST_CELL1); assertEquals(403, response.getStatusCode()); } @@ -193,7 +193,7 @@ public MyPasswordTest() { String uluut = (String) json.get(OAuth2Helper.Key.ACCESS_TOKEN); // ユニットローカルユニットユーザトークンを取得する - DcResponse res = requesttoMypassword(uluut, "password3", Setup.TEST_CELL1); + PersoniumResponse res = requesttoMypassword(uluut, "password3", Setup.TEST_CELL1); assertEquals(403, res.getStatusCode()); } @@ -216,14 +216,14 @@ public MyPasswordTest() { .with("remoteCell", UNIT_USER_CELL) .with("username", "Account") .with("password", "AccountPass") - .with("dc_target", UrlUtils.unitRoot()) + .with("p_target", UrlUtils.unitRoot()) .returns() .statusCode(HttpStatus.SC_OK); JSONObject json = res.bodyAsJson(); String unitUserToken = (String) json.get(OAuth2Helper.Key.ACCESS_TOKEN); - DcResponse response = requesttoMypassword(unitUserToken, "newPassword", Setup.TEST_CELL1); + PersoniumResponse response = requesttoMypassword(unitUserToken, "newPassword", Setup.TEST_CELL1); assertEquals(403, response.getStatusCode()); } finally { // アカウント削除 @@ -240,7 +240,7 @@ public MyPasswordTest() { */ @Test public final void マスタトークン認証でパスワード変更を実行し403が返ること() throws TokenParseException { - DcResponse res = requesttoMypassword(MASTER_TOKEN, "password3", Setup.TEST_CELL1); + PersoniumResponse res = requesttoMypassword(MASTER_TOKEN, "password3", Setup.TEST_CELL1); assertEquals(403, res.getStatusCode()); } @@ -250,7 +250,7 @@ public MyPasswordTest() { */ @Test public final void 不正なトークンでパスワード変更を実行し401が返却されること() throws TokenParseException { - DcResponse res = requesttoMypassword("passwordhoge", "accountpass", Setup.TEST_CELL1); + PersoniumResponse res = requesttoMypassword("passwordhoge", "accountpass", Setup.TEST_CELL1); assertEquals(401, res.getStatusCode()); } @@ -266,7 +266,7 @@ public MyPasswordTest() { // セルローカルトークンを取得する String tokenStr = (String) resBody.get(OAuth2Helper.Key.ACCESS_TOKEN); - DcResponse res = requesttoMypassword(tokenStr, "hogea", Setup.TEST_CELL1); + PersoniumResponse res = requesttoMypassword(tokenStr, "hogea", Setup.TEST_CELL1); assertEquals(400, res.getStatusCode()); } @@ -285,7 +285,7 @@ public MyPasswordTest() { // セルローカルトークンを取得する String tokenStr = (String) resBody.get(OAuth2Helper.Key.ACCESS_TOKEN); - DcResponse res = requesttoMypassword(tokenStr, "hogeaa", Setup.TEST_CELL1); + PersoniumResponse res = requesttoMypassword(tokenStr, "hogeaa", Setup.TEST_CELL1); assertEquals(204, res.getStatusCode()); // 確認 // TODO 仕様の問題で変更前のトークンが有効となっているため確認未実施 @@ -321,7 +321,7 @@ public MyPasswordTest() { // セルローカルトークンを取得する String tokenStr = (String) resBody.get(OAuth2Helper.Key.ACCESS_TOKEN); - DcResponse res = requesttoMypassword(tokenStr, "12345678901234567890123456789012", Setup.TEST_CELL1); + PersoniumResponse res = requesttoMypassword(tokenStr, "12345678901234567890123456789012", Setup.TEST_CELL1); assertEquals(204, res.getStatusCode()); // 変更前のパスワードのセルローカルトークンを使用して403となること // 確認 @@ -355,7 +355,7 @@ public MyPasswordTest() { // セルローカルトークンを取得する String tokenStr = (String) resBody.get(OAuth2Helper.Key.ACCESS_TOKEN); - DcResponse res = requesttoMypassword(tokenStr, "123456789012345678901234567890123", Setup.TEST_CELL1); + PersoniumResponse res = requesttoMypassword(tokenStr, "123456789012345678901234567890123", Setup.TEST_CELL1); assertEquals(400, res.getStatusCode()); } @@ -380,7 +380,7 @@ public MyPasswordTest() { // セルローカルトークンを取得する String tokenStr = (String) resBody.get(OAuth2Helper.Key.ACCESS_TOKEN); - DcResponse res = requesttoMypassword(tokenStr, "password1", cellName1); + PersoniumResponse res = requesttoMypassword(tokenStr, "password1", cellName1); assertEquals(401, res.getStatusCode()); } finally { AccountUtils.delete(cellName1, MASTER_TOKEN, "PasswordTest", 204); @@ -402,7 +402,7 @@ public MyPasswordTest() { // セルローカルトークンを取得する String tokenStr = (String) resBody.get(OAuth2Helper.Key.ACCESS_TOKEN); - DcResponse res = requesttoMypassword(tokenStr, null, Setup.TEST_CELL1); + PersoniumResponse res = requesttoMypassword(tokenStr, null, Setup.TEST_CELL1); assertEquals(400, res.getStatusCode()); } @@ -418,8 +418,8 @@ public MyPasswordTest() { // セルローカルトークンを取得する String tokenStr = (String) resBody.get(OAuth2Helper.Key.ACCESS_TOKEN); - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + tokenStr); @@ -427,7 +427,7 @@ public MyPasswordTest() { try { res = rest.put(UrlUtils.cellRoot(Setup.TEST_CELL1) + "__mypassword", "", requestheaders); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } assertEquals(400, res.getStatusCode()); @@ -440,10 +440,10 @@ public MyPasswordTest() { * @param requestCellName cell名 * @return レスポンス */ - private DcResponse requesttoMypassword(String headerAuthorization, String headerCredential, + private PersoniumResponse requesttoMypassword(String headerAuthorization, String headerCredential, String requestCellName) { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; if (headerAuthorization == null) { headerAuthorization = ""; @@ -455,12 +455,12 @@ private DcResponse requesttoMypassword(String headerAuthorization, String header // リクエストヘッダをセット HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, "Bearer " + headerAuthorization); - requestheaders.put(DcCoreUtils.HttpHeaders.X_DC_CREDENTIAL, headerCredential); + requestheaders.put(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_CREDENTIAL, headerCredential); try { res = rest.put(UrlUtils.cellRoot(requestCellName) + "__mypassword", "", requestheaders); - } catch (DcException e) { + } catch (PersoniumException e) { e.printStackTrace(); } return res; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/SchemaAuthTest.java b/src/test/java/io/personium/test/jersey/cell/auth/SchemaAuthTest.java similarity index 96% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/auth/SchemaAuthTest.java rename to src/test/java/io/personium/test/jersey/cell/auth/SchemaAuthTest.java index 8ac3cf207..e07d34742 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/SchemaAuthTest.java +++ b/src/test/java/io/personium/test/jersey/cell/auth/SchemaAuthTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.auth; +package io.personium.test.jersey.cell.auth; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -25,36 +25,36 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token.TokenDsigException; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token.TokenParseException; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token.TokenRootCrtException; -import com.fujitsu.dc.common.auth.token.AccountAccessToken; -import com.fujitsu.dc.common.auth.token.CellLocalAccessToken; -import com.fujitsu.dc.common.auth.token.CellLocalRefreshToken; -import com.fujitsu.dc.common.auth.token.TransCellAccessToken; -import com.fujitsu.dc.core.auth.OAuth2Helper; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.UserDataUtils; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.common.auth.token.AbstractOAuth2Token.TokenDsigException; +import io.personium.common.auth.token.AbstractOAuth2Token.TokenParseException; +import io.personium.common.auth.token.AbstractOAuth2Token.TokenRootCrtException; +import io.personium.common.auth.token.AccountAccessToken; +import io.personium.common.auth.token.CellLocalAccessToken; +import io.personium.common.auth.token.CellLocalRefreshToken; +import io.personium.common.auth.token.TransCellAccessToken; +import io.personium.core.auth.OAuth2Helper; +import io.personium.core.model.Box; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.UserDataUtils; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; /** * スキーマ認証のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class SchemaAuthTest extends JerseyTest { @@ -74,7 +74,7 @@ public class SchemaAuthTest extends JerseyTest { * コンストラクタ. */ public SchemaAuthTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -699,7 +699,7 @@ private JSONObject getTransTokenByPassAuth(String account, String pass) { .with("remoteCell", TEST_CELL1) .with("username", account) .with("password", pass) - .with("dc_target", UrlUtils.cellRoot(TEST_CELL2)) + .with("p_target", UrlUtils.cellRoot(TEST_CELL2)) .returns() .statusCode(HttpStatus.SC_OK); JSONObject json = res.bodyAsJson(); @@ -721,7 +721,7 @@ private JSONObject getTransTokenByAppAuth(String cellName, String account, Strin .with("remoteCell", cellName) .with("username", account) .with("password", pass) - .with("dc_target", targetUrl) + .with("p_target", targetUrl) .returns() .statusCode(HttpStatus.SC_OK); @@ -768,7 +768,7 @@ private JSONObject getTransTokenByPassAuthWithSchema(String account, String pass .with("password", pass) .with("client_id", UrlUtils.cellRoot(TEST_APP_CELL1)) .with("client_secret", token) - .with("dc_target", UrlUtils.cellRoot(TEST_CELL2)) + .with("p_target", UrlUtils.cellRoot(TEST_CELL2)) .returns() .statusCode(HttpStatus.SC_OK); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/X509AuthTest.java b/src/test/java/io/personium/test/jersey/cell/auth/X509AuthTest.java similarity index 87% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/auth/X509AuthTest.java rename to src/test/java/io/personium/test/jersey/cell/auth/X509AuthTest.java index 2c18c58be..0f7deaca3 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/X509AuthTest.java +++ b/src/test/java/io/personium/test/jersey/cell/auth/X509AuthTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.auth; +package io.personium.test.jersey.cell.auth; import static org.junit.Assert.fail; @@ -28,20 +28,20 @@ import org.junit.Test; import org.junit.runner.RunWith; -import com.fujitsu.dc.common.auth.token.Role; -import com.fujitsu.dc.common.auth.token.TransCellAccessToken; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.Http; +import io.personium.common.auth.token.Role; +import io.personium.common.auth.token.TransCellAccessToken; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.Http; import com.sun.jersey.test.framework.JerseyTest; /** * トランスセルアクセストークンでのX509証明書検証テスト. IT/STのように、サーバとクライアントが分かれている場合は本テストは実施出来ないため、POMの設定で無効化 */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) public class X509AuthTest extends JerseyTest { private static String folderPath = "x509/"; @@ -50,7 +50,7 @@ public class X509AuthTest extends JerseyTest { * コンストラクタ. */ public X509AuthTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -99,8 +99,8 @@ public X509AuthTest() { // トランスセルアクセストークンでのデータアクセス BoxUtils.get(Setup.TEST_CELL1, token, Setup.TEST_BOX1, HttpStatus.SC_UNAUTHORIZED); } finally { - TransCellAccessToken.configureX509(DcCoreConfig.getX509PrivateKey(), DcCoreConfig.getX509Certificate(), - DcCoreConfig.getX509RootCertificate()); + TransCellAccessToken.configureX509(PersoniumUnitConfig.getX509PrivateKey(), PersoniumUnitConfig.getX509Certificate(), + PersoniumUnitConfig.getX509RootCertificate()); } } @@ -171,8 +171,8 @@ public X509AuthTest() { // トランスセルアクセストークンでのデータアクセス BoxUtils.get(Setup.TEST_CELL1, token, Setup.TEST_BOX1, HttpStatus.SC_UNAUTHORIZED); } finally { - TransCellAccessToken.configureX509(DcCoreConfig.getX509PrivateKey(), DcCoreConfig.getX509Certificate(), - DcCoreConfig.getX509RootCertificate()); + TransCellAccessToken.configureX509(PersoniumUnitConfig.getX509PrivateKey(), PersoniumUnitConfig.getX509Certificate(), + PersoniumUnitConfig.getX509RootCertificate()); } } @@ -217,8 +217,8 @@ public X509AuthTest() { // トランスセルアクセストークンでのデータアクセス BoxUtils.get(Setup.TEST_CELL1, token, Setup.TEST_BOX1, HttpStatus.SC_INTERNAL_SERVER_ERROR); } finally { - TransCellAccessToken.configureX509(DcCoreConfig.getX509PrivateKey(), DcCoreConfig.getX509Certificate(), - DcCoreConfig.getX509RootCertificate()); + TransCellAccessToken.configureX509(PersoniumUnitConfig.getX509PrivateKey(), PersoniumUnitConfig.getX509Certificate(), + PersoniumUnitConfig.getX509RootCertificate()); } } diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/auth/package-info.java b/src/test/java/io/personium/test/jersey/cell/auth/package-info.java similarity index 90% rename from src/test/java/com/fujitsu/dc/test/unit/core/auth/package-info.java rename to src/test/java/io/personium/test/jersey/cell/auth/package-info.java index 8a1ccff24..2074c34ad 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/auth/package-info.java +++ b/src/test/java/io/personium/test/jersey/cell/auth/package-info.java @@ -17,5 +17,5 @@ /** * JUnit test. */ -package com.fujitsu.dc.test.unit.core.auth; +package io.personium.test.jersey.cell.auth; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/token/AllTests.java b/src/test/java/io/personium/test/jersey/cell/auth/token/AllTests.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/auth/token/AllTests.java rename to src/test/java/io/personium/test/jersey/cell/auth/token/AllTests.java index 0f32224f1..e6618a044 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/token/AllTests.java +++ b/src/test/java/io/personium/test/jersey/cell/auth/token/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.auth.token; +package io.personium.test.jersey.cell.auth.token; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/token/TokenTest.java b/src/test/java/io/personium/test/jersey/cell/auth/token/TokenTest.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/auth/token/TokenTest.java rename to src/test/java/io/personium/test/jersey/cell/auth/token/TokenTest.java index d25a0eb9f..62dadb405 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/token/TokenTest.java +++ b/src/test/java/io/personium/test/jersey/cell/auth/token/TokenTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.auth.token; +package io.personium.test.jersey.cell.auth.token; import java.net.MalformedURLException; import java.net.URL; @@ -27,27 +27,27 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token; -import com.fujitsu.dc.common.auth.token.AccountAccessToken; -import com.fujitsu.dc.common.auth.token.CellLocalAccessToken; -import com.fujitsu.dc.common.auth.token.CellLocalRefreshToken; -import com.fujitsu.dc.common.auth.token.Role; -import com.fujitsu.dc.common.auth.token.TransCellAccessToken; -import com.fujitsu.dc.common.auth.token.TransCellRefreshToken; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.ResourceUtils; +import io.personium.common.auth.token.AbstractOAuth2Token; +import io.personium.common.auth.token.AccountAccessToken; +import io.personium.common.auth.token.CellLocalAccessToken; +import io.personium.common.auth.token.CellLocalRefreshToken; +import io.personium.common.auth.token.Role; +import io.personium.common.auth.token.TransCellAccessToken; +import io.personium.common.auth.token.TransCellRefreshToken; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.ResourceUtils; import com.sun.jersey.test.framework.JerseyTest; /** * トークンのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class TokenTest extends JerseyTest { static final String TEST_CELL1 = "testcell1"; @@ -63,7 +63,7 @@ public class TokenTest extends JerseyTest { * コンストラクタ. */ public TokenTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/io/personium/test/jersey/cell/auth/token/package-info.java b/src/test/java/io/personium/test/jersey/cell/auth/token/package-info.java new file mode 100644 index 000000000..e1571d9d5 --- /dev/null +++ b/src/test/java/io/personium/test/jersey/cell/auth/token/package-info.java @@ -0,0 +1,21 @@ +/** + * personium.io + * Copyright 2014 FUJITSU LIMITED + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * JUnit test. + */ +package io.personium.test.jersey.cell.auth.token; + diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/AccountCreateTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/AccountCreateTest.java similarity index 93% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/AccountCreateTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/AccountCreateTest.java index 0c11314c1..22074869f 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/AccountCreateTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/AccountCreateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -28,18 +28,18 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.utils.ODataUtils; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.Common; +import io.personium.core.utils.ODataUtils; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * Accountの作成のIT. @@ -53,7 +53,7 @@ public class AccountCreateTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public AccountCreateTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -434,8 +434,8 @@ public AccountCreateTest() { TResponse res = AccountUtils.create(MASTER_TOKEN_NAME, cellName, testAccountName, testAccountPass, "SYSUTCDATETIME", HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("LastAuthenticated").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("LastAuthenticated").getMessage()); AccountUtils.get(MASTER_TOKEN_NAME, HttpStatus.SC_NOT_FOUND, cellName, testAccountName); } finally { AccountUtils.delete(cellName, MASTER_TOKEN_NAME, testAccountName, -1); @@ -453,8 +453,8 @@ public AccountCreateTest() { try { TResponse res = AccountUtils.create(MASTER_TOKEN_NAME, cellName, testAccountName, testAccountPass, "", HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("LastAuthenticated").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("LastAuthenticated").getMessage()); AccountUtils.get(MASTER_TOKEN_NAME, HttpStatus.SC_NOT_FOUND, cellName, testAccountName); } finally { AccountUtils.delete(cellName, MASTER_TOKEN_NAME, testAccountName, -1); @@ -472,8 +472,8 @@ public AccountCreateTest() { try { TResponse res = AccountUtils.create(MASTER_TOKEN_NAME, cellName, testAccountName, testAccountPass, "/Date(1359340262406)", HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("LastAuthenticated").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("LastAuthenticated").getMessage()); AccountUtils.get(MASTER_TOKEN_NAME, HttpStatus.SC_NOT_FOUND, cellName, testAccountName); } finally { @@ -544,8 +544,8 @@ public AccountCreateTest() { try { TResponse res = AccountUtils.create(MASTER_TOKEN_NAME, cellName, testAccountName, testAccountPass, "/Date(" + (ODataUtils.DATETIME_MAX + 1) + ")/", HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("LastAuthenticated").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("LastAuthenticated").getMessage()); AccountUtils.get(MASTER_TOKEN_NAME, HttpStatus.SC_NOT_FOUND, cellName, testAccountName); } finally { @@ -564,8 +564,8 @@ public AccountCreateTest() { try { TResponse res = AccountUtils.create(MASTER_TOKEN_NAME, cellName, testAccountName, testAccountPass, "/Date(" + (ODataUtils.DATETIME_MIN - 1) + ")/", HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("LastAuthenticated").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("LastAuthenticated").getMessage()); AccountUtils.get(MASTER_TOKEN_NAME, HttpStatus.SC_NOT_FOUND, cellName, testAccountName); } finally { @@ -652,7 +652,7 @@ private String createNoPassAccount(String testAccountName, String testAccountTyp } private void deleteAccount(String accountUrl) { - DcRequest req = DcRequest.delete(accountUrl) + PersoniumRequest req = PersoniumRequest.delete(accountUrl) .header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN) .header(HttpHeaders.IF_MATCH, "*"); request(req); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/AccountListTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/AccountListTest.java similarity index 83% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/AccountListTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/AccountListTest.java index 8630f661b..e477282da 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/AccountListTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/AccountListTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import java.util.HashMap; import java.util.Map; @@ -25,24 +25,24 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.odatacol.UserDataListFilterTest; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.odatacol.UserDataListFilterTest; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; /** * Accountの一覧取得のIT. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class AccountListTest extends JerseyTest { // セル再帰的削除を使うための設定 @@ -50,11 +50,11 @@ public class AccountListTest extends JerseyTest { private static final Map INIT_PARAMS = new HashMap(); static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/AccountRoleLinkListTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/AccountRoleLinkListTest.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/AccountRoleLinkListTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/AccountRoleLinkListTest.java index 5081ae3e4..2c53ef94a 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/AccountRoleLinkListTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/AccountRoleLinkListTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import java.util.ArrayList; @@ -27,21 +27,21 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.setup.Setup; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * AccountとRoleのリンク一覧取得のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class AccountRoleLinkListTest extends AccountTest { @@ -264,14 +264,14 @@ private void createAccountRoleLink(String accountName, String roleUrl) { } private void deleteAccount(String accountUrl) { - DcRequest req = DcRequest.delete(accountUrl) + PersoniumRequest req = PersoniumRequest.delete(accountUrl) .header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN) .header(HttpHeaders.IF_MATCH, "*"); request(req); } private void deleteRole(String roleUrl) { - DcRequest req = DcRequest.delete(roleUrl) + PersoniumRequest req = PersoniumRequest.delete(roleUrl) .header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN) .header(HttpHeaders.IF_MATCH, "*"); request(req); @@ -347,7 +347,7 @@ protected TResponse deleteLinks(String accountname, String rolename, String boxN .with("accountKey", accountname) .with("roleKey", "Name='" + rolename + "',_Box.Name='" + boxName + "'") .with("contentType", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("ifMatch", "*") .returns(); } @@ -365,7 +365,7 @@ protected TResponse deleteLinks(String accountname, String rolename) { .with("accountKey", accountname) .with("roleKey", "Name='" + rolename + "',_Box.Name=null") .with("contentType", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("ifMatch", "*") .returns(); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/AccountRoleLinkTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/AccountRoleLinkTest.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/AccountRoleLinkTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/AccountRoleLinkTest.java index 9c5fa9164..4e43136b0 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/AccountRoleLinkTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/AccountRoleLinkTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import javax.ws.rs.core.MediaType; @@ -24,23 +24,23 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.setup.Setup; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.TResponse; /** * AccountとRoleのリンクテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class AccountRoleLinkTest extends AccountTest { @@ -390,14 +390,14 @@ public AccountRoleLinkTest() { } private void deleteAccount(String accountUrl) { - DcRequest req = DcRequest.delete(accountUrl) + PersoniumRequest req = PersoniumRequest.delete(accountUrl) .header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN) .header(HttpHeaders.IF_MATCH, "*"); request(req); } private void deleteRole(String roleUrl) { - DcRequest req = DcRequest.delete(roleUrl) + PersoniumRequest req = PersoniumRequest.delete(roleUrl) .header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN) .header(HttpHeaders.IF_MATCH, "*"); request(req); @@ -472,7 +472,7 @@ protected TResponse deleteLinks(String accountname, String rolename) { .with("accountKey", accountname) .with("roleKey", "Name='" + rolename + "',_Box.Name=null") .with("contentType", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("ifMatch", "*") .returns(); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/AccountTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/AccountTest.java similarity index 89% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/AccountTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/AccountTest.java index 6c3b5704b..b9cdfd9fe 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/AccountTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/AccountTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -37,24 +37,24 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token.TokenDsigException; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token.TokenParseException; -import com.fujitsu.dc.common.auth.token.AbstractOAuth2Token.TokenRootCrtException; -import com.fujitsu.dc.common.auth.token.TransCellAccessToken; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.common.auth.token.AbstractOAuth2Token.TokenDsigException; +import io.personium.common.auth.token.AbstractOAuth2Token.TokenParseException; +import io.personium.common.auth.token.AbstractOAuth2Token.TokenRootCrtException; +import io.personium.common.auth.token.TransCellAccessToken; +import io.personium.core.model.Box; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.TResponse; /** * Accountの作成のIT. @@ -72,7 +72,7 @@ public class AccountTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public AccountTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -139,9 +139,9 @@ public final void crud() throws TokenParseException, TokenDsigException, TokenRo // TODO 一件取得が無いのはバグ。 log.debug("koooooooo"); - DcRequest req = DcRequest.get(UrlUtils.accountLinks(cellName, testAccountName)) + PersoniumRequest req = PersoniumRequest.get(UrlUtils.accountLinks(cellName, testAccountName)) .header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).header(HttpHeaders.ACCEPT, "application/json"); - DcResponse res = request(req); + PersoniumResponse res = request(req); assertEquals(HttpStatus.SC_OK, res.getStatusCode()); JSONObject linkJson = res.bodyAsJson(); JSONArray linksResults = getResultsFromEntitysResponse(linkJson); @@ -158,7 +158,7 @@ public final void crud() throws TokenParseException, TokenDsigException, TokenRo // パスワード認証。セルトークン取得。 // grant_type=password&username={username}&password={password} - req = DcRequest.post(UrlUtils.auth(cellName)); + req = PersoniumRequest.post(UrlUtils.auth(cellName)); String authBody = String.format("grant_type=password&username=%s&password=%s", testAccountName, testAccountPass); req.header(HttpHeaders.CONTENT_TYPE, "application/x-www-form-urlencoded").addStringBody(authBody); @@ -168,8 +168,8 @@ public final void crud() throws TokenParseException, TokenDsigException, TokenRo assertNotNull(token); // パスワード認証。トランスセルトークン取得 - req = DcRequest.post(UrlUtils.auth(cellName)); - authBody = String.format("grant_type=password&username=%s&password=%s&dc_target=%s", + req = PersoniumRequest.post(UrlUtils.auth(cellName)); + authBody = String.format("grant_type=password&username=%s&password=%s&p_target=%s", testAccountName, testAccountPass, "https://example.com/testcell"); req.header(HttpHeaders.CONTENT_TYPE, "application/x-www-form-urlencoded").addStringBody(authBody); res = request(req); @@ -189,20 +189,20 @@ public final void crud() throws TokenParseException, TokenDsigException, TokenRo // アカウント・ロールの紐付けのD String roleId = roleUrl.substring(roleUrl.indexOf("'") + 1); roleId = roleId.substring(0, roleId.indexOf("'")); - req = DcRequest.delete(UrlUtils.accountLink(cellName, testAccountName, roleId)) + req = PersoniumRequest.delete(UrlUtils.accountLink(cellName, testAccountName, roleId)) .header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN); res = request(req); assertEquals(HttpStatus.SC_NO_CONTENT, res.getStatusCode()); // RoleのD - req = DcRequest.delete(roleUrl) + req = PersoniumRequest.delete(roleUrl) .header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN) .header(HttpHeaders.IF_MATCH, "*"); res = request(req); assertEquals(HttpStatus.SC_NO_CONTENT, res.getStatusCode()); // AccountのD - req = DcRequest.delete(accUrl) + req = PersoniumRequest.delete(accUrl) .header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN) .header(HttpHeaders.IF_MATCH, "*"); res = request(req); @@ -337,12 +337,12 @@ public void inspect(TResponse resp) { */ protected String createBox2(final String boxName, final String boxSchema) { // BOXのC - DcRequest req = DcRequest.post(UrlUtils.cellCtl(cellName, Box.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(cellName, Box.EDM_TYPE_NAME)); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody("Name", boxName); if (boxSchema != null) { req.addJsonBody("Schema", boxSchema); } - DcResponse res = request(req); + PersoniumResponse res = request(req); assertEquals(HttpStatus.SC_CREATED, res.getStatusCode()); String url = res.getFirstHeader(HttpHeaders.LOCATION); assertNotNull(url); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/AccountUpdateTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/AccountUpdateTest.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/AccountUpdateTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/AccountUpdateTest.java index a3d07267d..7a1740511 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/AccountUpdateTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/AccountUpdateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import org.apache.http.HttpStatus; import org.json.simple.JSONObject; @@ -25,16 +25,16 @@ import org.odata4j.core.ODataConstants; import org.odata4j.core.ODataVersion; -import com.fujitsu.dc.core.model.lock.LockManager; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.cell.auth.AuthTestCommon; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.model.lock.LockManager; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.cell.auth.AuthTestCommon; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; @@ -70,7 +70,7 @@ public void after() { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public AccountUpdateTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/AccountViaNPTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/AccountViaNPTest.java similarity index 89% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/AccountViaNPTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/AccountViaNPTest.java index 8c7891c83..7f0263c1b 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/AccountViaNPTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/AccountViaNPTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import static org.junit.Assert.assertTrue; @@ -28,20 +28,20 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.utils.ODataUtils; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.odatacol.UserDataListFilterTest; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.Common; +import io.personium.core.utils.ODataUtils; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.odatacol.UserDataListFilterTest; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.TResponse; /** * AccountのNP経由登録/一覧取得のテスト. @@ -55,7 +55,7 @@ public class AccountViaNPTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public AccountViaNPTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -182,8 +182,8 @@ public AccountViaNPTest() { String body = "{\"Name\":\"" + accountName + "\", \"LastAuthenticated\":\"SYSUTCDATE()\"}"; TResponse res = AccountUtils.createViaNPNonCredential(CELL_NAME, MASTER_TOKEN_NAME, "Role", roleName, body, HttpStatus.SC_BAD_REQUEST); - res.checkErrorResponse(DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), - DcCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("LastAuthenticated").getMessage()); + res.checkErrorResponse(PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.getCode(), + PersoniumCoreException.OData.REQUEST_FIELD_FORMAT_ERROR.params("LastAuthenticated").getMessage()); } finally { // $links削除 RoleUtils.deleteLink(CELL_NAME, MASTER_TOKEN_NAME, RoleUtils.keyString(roleName), diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/AllTests.java b/src/test/java/io/personium/test/jersey/cell/ctl/AllTests.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/AllTests.java rename to src/test/java/io/personium/test/jersey/cell/ctl/AllTests.java index d329bc548..0c660d35e 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/AllTests.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/BoxCrudTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/BoxCrudTest.java similarity index 84% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/BoxCrudTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/BoxCrudTest.java index 6c3a44b20..6eb58d312 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/BoxCrudTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/BoxCrudTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -31,26 +31,26 @@ import org.w3c.dom.Element; import org.w3c.dom.NodeList; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * BoxのCRUDのIT. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class BoxCrudTest extends ODataCommon { /** @@ -62,7 +62,7 @@ public class BoxCrudTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public BoxCrudTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } private static final String CELL_NAME = Setup.TEST_CELL1; @@ -92,11 +92,11 @@ public BoxCrudTest() { */ @Test public void BOX新規登録時にNameに空文字を指定して場合_400になることを確認() { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); String[] key = {"Name", "Schema" }; String[] value = {"", TEST_BOX_SCHEMA }; req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody(key, value); - DcResponse res = request(req); + PersoniumResponse res = request(req); // 400になることを確認 assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); @@ -107,11 +107,11 @@ public BoxCrudTest() { */ @Test public void BOX新規登録時にNameにアンダーバー始まり文字を指定して場合_400になることを確認() { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); String[] key = {"Name", "Schema" }; String[] value = {"_xxx", TEST_BOX_SCHEMA }; req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody(key, value); - DcResponse res = request(req); + PersoniumResponse res = request(req); // 400になることを確認 assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); @@ -122,11 +122,11 @@ public BoxCrudTest() { */ @Test public void BOX新規登録時にNameにハイフン始まり文字を指定して場合_400になることを確認() { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); String[] key = {"Name", "Schema" }; String[] value = {"-xxx", TEST_BOX_SCHEMA }; req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody(key, value); - DcResponse res = request(req); + PersoniumResponse res = request(req); // 400になることを確認 assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); @@ -137,11 +137,11 @@ public BoxCrudTest() { */ @Test public void BOX新規登録時にNameにスラッシュ文字を指定して場合_400になることを確認() { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); String[] key = {"Name", "Schema" }; String[] value = {"xx/xx", TEST_BOX_SCHEMA }; req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody(key, value); - DcResponse res = request(req); + PersoniumResponse res = request(req); // 400になることを確認 assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); @@ -152,11 +152,11 @@ public BoxCrudTest() { */ @Test public void BOX新規登録時に__ctlを指定して場合_400になることを確認() { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); String[] key = {"Name", "Schema" }; String[] value = {"__ctl", TEST_BOX_SCHEMA }; req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody(key, value); - DcResponse res = request(req); + PersoniumResponse res = request(req); // 400になることを確認 assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); @@ -167,13 +167,13 @@ public BoxCrudTest() { */ @Test public void BOX新規登録時にNameを1文字指定して場合_201になることを確認() { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); String boxName = "1"; String[] key = {"Name", "Schema" }; String[] value = {boxName, TEST_BOX_SCHEMA }; req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody(key, value); try { - DcResponse res = request(req); + PersoniumResponse res = request(req); // 201になることを確認 assertEquals(HttpStatus.SC_CREATED, res.getStatusCode()); @@ -187,7 +187,7 @@ public BoxCrudTest() { */ @Test public void BOX新規登録時にNameを128文字指定して場合_201になることを確認() { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); String boxName = "12345678901234567890123456789012345678901234567890" + "12345678901234567890123456789012345678901234567890" + "1234567890123456789012345678"; @@ -195,7 +195,7 @@ public BoxCrudTest() { String[] value = {boxName, TEST_BOX_SCHEMA }; req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody(key, value); try { - DcResponse res = request(req); + PersoniumResponse res = request(req); // 201になることを確認 assertEquals(HttpStatus.SC_CREATED, res.getStatusCode()); @@ -209,14 +209,14 @@ public BoxCrudTest() { */ @Test public void BOX新規登録時にNameを129文字指定して場合_400になることを確認() { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); String boxName = "12345678901234567890123456789012345678901234567890" + "12345678901234567890123456789012345678901234567890" + "1234567890123456789012345678a"; String[] key = {"Name", "Schema" }; String[] value = {boxName, TEST_BOX_SCHEMA }; req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody(key, value); - DcResponse res = request(req); + PersoniumResponse res = request(req); // 400になることを確認 assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); @@ -227,11 +227,11 @@ public BoxCrudTest() { */ @Test public void BOX新規登録時にSchamaに空文字を指定して場合_400になることを確認() { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); String[] key = {"Name", "Schema" }; String[] value = {"testBox", "" }; req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody(key, value); - DcResponse res = request(req); + PersoniumResponse res = request(req); // 400になることを確認 assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); @@ -242,11 +242,11 @@ public BoxCrudTest() { */ @Test public void BOX新規登録時にSchamaにtrailing_slashの無いURL形式文字_https_を指定した場合_400になることを確認() { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); String[] key = {"Name", "Schema" }; String[] value = {"testBox", "https://xxx.com/test" }; req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody(key, value); - DcResponse res = request(req); + PersoniumResponse res = request(req); // 400になることを確認 assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); @@ -257,11 +257,11 @@ public BoxCrudTest() { */ @Test public void BOX新規登録時にSchamaに正規化されていないパスを含むURL形式文字_https_を指定した場合_400になることを確認() { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); String[] key = {"Name", "Schema" }; String[] value = {"testBox", "https://xxx.com/test/1/2/../3/./../test/" }; req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody(key, value); - DcResponse res = request(req); + PersoniumResponse res = request(req); // 400になることを確認 assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); @@ -272,12 +272,12 @@ public BoxCrudTest() { */ @Test public void BOX新規登録時にSchemaをURL形式_https_文字を指定して場合_201になることを確認() { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); String[] key = {"Name", "Schema" }; String[] value = {"testBox", "https://xxx.com/test/" }; req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody(key, value); try { - DcResponse res = request(req); + PersoniumResponse res = request(req); // 201になることを確認 assertEquals(HttpStatus.SC_CREATED, res.getStatusCode()); @@ -291,11 +291,11 @@ public BoxCrudTest() { */ @Test public void BOX新規登録時にSchamaにtrailing_slashの無いURL形式文字_http_を指定した場合_400になることを確認() { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); String[] key = {"Name", "Schema" }; String[] value = {"testBox", "http://xxx.com/test" }; req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody(key, value); - DcResponse res = request(req); + PersoniumResponse res = request(req); // 400になることを確認 assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); @@ -306,11 +306,11 @@ public BoxCrudTest() { */ @Test public void BOX新規登録時にSchamaに正規化されていないパスを含むURL形式文字_http_を指定した場合_400になることを確認() { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); String[] key = {"Name", "Schema" }; String[] value = {"testBox", "http://xxx.com/test/0/../1/./2/test/" }; req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody(key, value); - DcResponse res = request(req); + PersoniumResponse res = request(req); // 400になることを確認 assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); @@ -321,12 +321,12 @@ public BoxCrudTest() { */ @Test public void BOX新規登録時にSchemaをURL形式_http_文字を指定して場合_201になることを確認() { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); String[] key = {"Name", "Schema" }; String[] value = {"testBox", "http://xxx.com/test/" }; req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody(key, value); try { - DcResponse res = request(req); + PersoniumResponse res = request(req); // 201になることを確認 assertEquals(HttpStatus.SC_CREATED, res.getStatusCode()); @@ -340,13 +340,13 @@ public BoxCrudTest() { */ @Test public void BOX新規登録時にSchemaをURL形式personium_localunit文字を指定して場合_201になることを確認() { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); String[] key = {"Name", "Schema" }; String[] value = {"testBox", "personium-localunit:/schema/" }; req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody(key, value); try { - DcResponse res = request(req); - + PersoniumResponse res = request(req); + // 201になることを確認 assertEquals(HttpStatus.SC_CREATED, res.getStatusCode()); } finally { @@ -359,12 +359,12 @@ public BoxCrudTest() { */ @Test public void BOX新規登録時にSchemaをURN形式文字を指定して場合_201になることを確認() { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); String[] key = {"Name", "Schema" }; String[] value = {"testBox", "urn:xxx:xxx" }; req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody(key, value); try { - DcResponse res = request(req); + PersoniumResponse res = request(req); // 201になることを確認 assertEquals(HttpStatus.SC_CREATED, res.getStatusCode()); @@ -378,11 +378,11 @@ public BoxCrudTest() { */ @Test public void BOX新規登録時にSchemaをFTP形式文字を指定して場合_400になることを確認() { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); String[] key = {"Name", "Schema" }; String[] value = {"testBox", "ftp://xxx.com" }; req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody(key, value); - DcResponse res = request(req); + PersoniumResponse res = request(req); // 400になることを確認 assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); @@ -393,13 +393,13 @@ public BoxCrudTest() { */ @Test public void BOX新規登録時にSchemaに1024文字を指定して場合_201になることを確認() { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); String schema = "http://" + StringUtils.repeat("x", 1012) + ".com/"; String[] key = {"Name", "Schema" }; String[] value = {"testBox", schema }; req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody(key, value); try { - DcResponse res = request(req); + PersoniumResponse res = request(req); // 400になることを確認 assertEquals(HttpStatus.SC_CREATED, res.getStatusCode()); @@ -413,12 +413,12 @@ public BoxCrudTest() { */ @Test public void BOX新規登録時にSchemaに1025文字を指定して場合_400になることを確認() { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); String schema = "http://" + StringUtils.repeat("x", 1013) + ".com/"; String[] key = {"Name", "Schema" }; String[] value = {"testBox", schema }; req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody(key, value); - DcResponse res = request(req); + PersoniumResponse res = request(req); // 400になることを確認 assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); @@ -429,11 +429,11 @@ public BoxCrudTest() { */ @Test public void BOX新規登録時にSchemaをURL形式でない文字を指定して場合_400になることを確認() { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); String[] key = {"Name", "Schema" }; String[] value = {"testBox", "xxx" }; req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody(key, value); - DcResponse res = request(req); + PersoniumResponse res = request(req); // 400になることを確認 assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); @@ -444,11 +444,11 @@ public BoxCrudTest() { */ @Test public void BOX新規登録時にリクエストボディに管理情報__publishedを指定した場合_レスポンスコード400になることを確認() { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); String[] key = {"Name", "Schema", PUBLISHED }; String[] value = {TEST_BOX_NAME, "http://xxx.com/test", "/Date(0)/" }; req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody(key, value); - DcResponse res = request(req); + PersoniumResponse res = request(req); // 400になることを確認 assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); @@ -459,11 +459,11 @@ public BoxCrudTest() { */ @Test public void BOX新規登録時にリクエストボディに管理情報__updatedを指定した場合_レスポンスコード400になることを確認() { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); String[] key = {"Name", "Schema", UPDATED }; String[] value = {TEST_BOX_NAME, "http://xxx.com/test", "/Date(0)/" }; req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody(key, value); - DcResponse res = request(req); + PersoniumResponse res = request(req); // 400になることを確認 assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); @@ -474,11 +474,11 @@ public BoxCrudTest() { */ @Test public void BOX新規登録時にリクエストボディに管理情報__metadataを指定した場合_レスポンスコード400になることを確認() { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); String[] key = {"Name", "Schema", METADATA }; String[] value = {TEST_BOX_NAME, "http://xxx.com/test", "test" }; req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody(key, value); - DcResponse res = request(req); + PersoniumResponse res = request(req); // 400になることを確認 assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); @@ -559,7 +559,7 @@ public BoxCrudTest() { @Test public void BOX更新時にリクエストボディに管理情報__publishedを指定した場合_レスポンスコード400になることを確認() { try { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); String[] key = {"Name", "Schema" }; String[] value = {TEST_BOX_NAME, "http://xxx.com/test" }; req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody(key, value); @@ -582,7 +582,7 @@ public BoxCrudTest() { @Test public void BOX更新時にリクエストボディに管理情報__updatedを指定した場合_レスポンスコード400になることを確認() { try { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); String[] key = {"Name", "Schema" }; String[] value = {TEST_BOX_NAME, "http://xxx.com/test" }; req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody(key, value); @@ -605,7 +605,7 @@ public BoxCrudTest() { @Test public void BOX更新時にリクエストボディに管理情報__metadataを指定した場合_レスポンスコード400になることを確認() { try { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(CELL_NAME, ENTITY_TYPE_BOX)); String[] key = {"Name", "Schema" }; String[] value = {TEST_BOX_NAME, "http://xxx.com/test" }; req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody(key, value); @@ -663,12 +663,12 @@ public BoxCrudTest() { // Acceptヘッダ なし String boxName = "123456"; String url = UrlUtils.cellCtlWithoutSingleQuote(CELL_NAME, "Box", boxName); - DcResponse res = this.restGet(url); + PersoniumResponse res = this.restGet(url); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); checkErrorResponse(res.bodyAsJson(), - DcCoreException.OData.ENTITY_KEY_PARSE_ERROR.getCode(), - DcCoreException.OData.ENTITY_KEY_PARSE_ERROR.getMessage()); + PersoniumCoreException.OData.ENTITY_KEY_PARSE_ERROR.getCode(), + PersoniumCoreException.OData.ENTITY_KEY_PARSE_ERROR.getMessage()); } /** @@ -680,12 +680,12 @@ public BoxCrudTest() { // Acceptヘッダ なし String boxName = "123456"; String url = UrlUtils.cellCtlWithoutSingleQuote(CELL_NAME, "Box", boxName); - DcResponse res = this.restPut(url, ""); + PersoniumResponse res = this.restPut(url, ""); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); checkErrorResponse(res.bodyAsJson(), - DcCoreException.OData.ENTITY_KEY_PARSE_ERROR.getCode(), - DcCoreException.OData.ENTITY_KEY_PARSE_ERROR.getMessage()); + PersoniumCoreException.OData.ENTITY_KEY_PARSE_ERROR.getCode(), + PersoniumCoreException.OData.ENTITY_KEY_PARSE_ERROR.getMessage()); } /** @@ -697,12 +697,12 @@ public BoxCrudTest() { // Acceptヘッダ なし String boxName = "123456"; String url = UrlUtils.cellCtlWithoutSingleQuote(CELL_NAME, "Box", boxName); - DcResponse res = this.restDelete(url); + PersoniumResponse res = this.restDelete(url); assertEquals(HttpStatus.SC_BAD_REQUEST, res.getStatusCode()); checkErrorResponse(res.bodyAsJson(), - DcCoreException.OData.ENTITY_KEY_PARSE_ERROR.getCode(), - DcCoreException.OData.ENTITY_KEY_PARSE_ERROR.getMessage()); + PersoniumCoreException.OData.ENTITY_KEY_PARSE_ERROR.getCode(), + PersoniumCoreException.OData.ENTITY_KEY_PARSE_ERROR.getMessage()); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/BoxRelationLinkTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/BoxRelationLinkTest.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/BoxRelationLinkTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/BoxRelationLinkTest.java index 661cf52dd..12731d378 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/BoxRelationLinkTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/BoxRelationLinkTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import java.util.ArrayList; @@ -24,23 +24,23 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.RelationUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.RelationUtils; +import io.personium.test.utils.TResponse; /** * BoxとRelationの$linksのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class BoxRelationLinkTest extends ODataCommon { @@ -55,7 +55,7 @@ public class BoxRelationLinkTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public BoxRelationLinkTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/BoxRoleLinkTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/BoxRoleLinkTest.java similarity index 95% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/BoxRoleLinkTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/BoxRoleLinkTest.java index 0049d2ebb..c4ae56bd6 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/BoxRoleLinkTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/BoxRoleLinkTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import static org.junit.Assert.assertEquals; @@ -28,26 +28,26 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.RelationUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.RelationUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; /** * BoxとRoleの$linksのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class BoxRoleLinkTest extends JerseyTest { @@ -66,7 +66,7 @@ public class BoxRoleLinkTest extends JerseyTest { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public BoxRoleLinkTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/BoxRoleViaNPTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/BoxRoleViaNPTest.java similarity index 87% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/BoxRoleViaNPTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/BoxRoleViaNPTest.java index b0ac543ab..a251ebd0d 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/BoxRoleViaNPTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/BoxRoleViaNPTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import org.apache.http.HttpStatus; import org.json.simple.JSONObject; @@ -24,22 +24,22 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; /** * BoxとRoleのNP経由登録/一覧のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class BoxRoleViaNPTest extends JerseyTest { @@ -50,7 +50,7 @@ public class BoxRoleViaNPTest extends JerseyTest { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public BoxRoleViaNPTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/CellCtlUtils.java b/src/test/java/io/personium/test/jersey/cell/ctl/CellCtlUtils.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/CellCtlUtils.java rename to src/test/java/io/personium/test/jersey/cell/ctl/CellCtlUtils.java index 1c6b4f7de..b26347804 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/CellCtlUtils.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/CellCtlUtils.java @@ -14,17 +14,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import org.apache.http.HttpHeaders; import org.apache.http.HttpStatus; import org.json.simple.JSONObject; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * Cell管理のユーティリティークラス. @@ -42,7 +42,7 @@ private CellCtlUtils() { * @param url URL */ static void deleteOdataResource(String url) { - DcRequest req = DcRequest.delete(url) + PersoniumRequest req = PersoniumRequest.delete(url) .header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN) .header(HttpHeaders.IF_MATCH, "*"); AbstractCase.request(req); @@ -268,7 +268,7 @@ public static void deleteExtRole(String cellName, Http.request("cell/extRole/extRole-delete.txt") .with("token", AbstractCase.MASTER_TOKEN_NAME) .with("cellPath", cellName) - .with("extRoleName", DcCoreUtils.encodeUrlComp(testExtRoleName)) + .with("extRoleName", PersoniumCoreUtils.encodeUrlComp(testExtRoleName)) .with("relationName", relName) .with("relationBoxName", relBoxName) .returns() @@ -287,7 +287,7 @@ public static void deleteExtRole(String cellName, Http.request("cell/extRole/extRole-delete.txt") .with("token", AbstractCase.MASTER_TOKEN_NAME) .with("cellPath", cellName) - .with("extRoleName", DcCoreUtils.encodeUrlComp(testExtRoleName)) + .with("extRoleName", PersoniumCoreUtils.encodeUrlComp(testExtRoleName)) .with("relationName", "'" + relationName + "'") .with("relationBoxName", "null") .returns() @@ -303,7 +303,7 @@ public static void deleteExtRole(String cellName, String testExtRoleName) { Http.request("cell/extRole/extRole-delete.txt") .with("token", AbstractCase.MASTER_TOKEN_NAME) .with("cellPath", cellName) - .with("extRoleName", DcCoreUtils.encodeUrlComp(testExtRoleName)) + .with("extRoleName", PersoniumCoreUtils.encodeUrlComp(testExtRoleName)) .with("relationName", "null") .with("relationBoxName", "null") .returns() diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/EventTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/EventTest.java similarity index 83% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/EventTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/EventTest.java index b4607bde9..63f80fc64 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/EventTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/EventTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import org.apache.http.HttpStatus; import org.junit.After; @@ -24,19 +24,19 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.utils.Http; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.utils.Http; import com.sun.jersey.test.framework.JerseyTest; /** * RoleResourceのテスト. * setupパッケージでのRoleの準備があることが前提 */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class EventTest extends JerseyTest { @@ -46,7 +46,7 @@ public class EventTest extends JerseyTest { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public EventTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtCellCreateTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/ExtCellCreateTest.java similarity index 83% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtCellCreateTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/ExtCellCreateTest.java index b116ba42d..459e796ea 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtCellCreateTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/ExtCellCreateTest.java @@ -14,20 +14,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import org.apache.commons.lang.StringUtils; import org.apache.http.HttpStatus; import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.ExtCellUtils; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.ExtCellUtils; /** * ExtCell作成のテスト. @@ -43,7 +43,7 @@ public class ExtCellCreateTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public ExtCellCreateTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -83,7 +83,7 @@ public ExtCellCreateTest() { */ @Test public final void 正規化されていないパスを含むURLを指定した場合400エラーを返却すること() { - String extCellUrl = "http://localhost:8080/dc1-core/testcell1/../test/./box/../"; + String extCellUrl = "http://localhost:8080/personium-core/testcell1/../test/./box/../"; ExtCellUtils.create(token, cellName, extCellUrl, HttpStatus.SC_BAD_REQUEST); } @@ -92,7 +92,7 @@ public ExtCellCreateTest() { */ @Test public final void Urlが1024文字の場合正常に作成されること() { - String extCellUrl = "http://localhost:8080/dc1-core/testcell1" + StringUtils.repeat("a", 983) + TRAILING_SLASH; + String extCellUrl = "http://localhost:8080/personium-core/testcell1" + StringUtils.repeat("a", 977) + TRAILING_SLASH; try { ExtCellUtils.create(token, cellName, extCellUrl, HttpStatus.SC_CREATED); @@ -106,7 +106,7 @@ public ExtCellCreateTest() { */ @Test public final void Urlが1025文字以上の場合400エラーを返却すること() { - String extCellUrl = "http://localhost:8080/dc1-core/testcell1" + StringUtils.repeat("a", 984) + TRAILING_SLASH; + String extCellUrl = "http://localhost:8080/personium-core/testcell1" + StringUtils.repeat("a", 978) + TRAILING_SLASH; ExtCellUtils.create(token, cellName, extCellUrl, HttpStatus.SC_BAD_REQUEST); } @@ -115,7 +115,7 @@ public ExtCellCreateTest() { */ @Test public final void UrlのschemeがFTPの場合400エラーを返却すること() { - String extCellUrl = "ftp://localhost:21/dc1-core/testcell1/"; + String extCellUrl = "ftp://localhost:21/personium-core/testcell1/"; ExtCellUtils.create(token, cellName, extCellUrl, HttpStatus.SC_BAD_REQUEST); } @@ -124,7 +124,7 @@ public ExtCellCreateTest() { */ @Test public final void UrlのschemeがURNの場合400エラーを返却すること() { - String extCellUrl = "urn:x-dc1:test"; + String extCellUrl = "urn:x-personium:test"; ExtCellUtils.create(token, cellName, extCellUrl, HttpStatus.SC_BAD_REQUEST); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtCellDeleteTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/ExtCellDeleteTest.java similarity index 78% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtCellDeleteTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/ExtCellDeleteTest.java index 9a530cb19..6193bdbbb 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtCellDeleteTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/ExtCellDeleteTest.java @@ -14,26 +14,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import org.apache.http.HttpStatus; import org.json.simple.JSONObject; import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.model.ctl.ExtCell; -import com.fujitsu.dc.core.model.ctl.Relation; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.ExtCellUtils; -import com.fujitsu.dc.test.utils.RelationUtils; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.RoleUtils; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.model.ctl.ExtCell; +import io.personium.core.model.ctl.Relation; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.ExtCellUtils; +import io.personium.test.utils.RelationUtils; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.RoleUtils; /** * ExtRoleの削除のテスト. @@ -47,7 +47,7 @@ public class ExtCellDeleteTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public ExtCellDeleteTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -65,19 +65,19 @@ public ExtCellDeleteTest() { // 準備。ExtCell、ロール作ってリンクさせる。 ExtCellUtils.create(token, cellName, extCellUrl, HttpStatus.SC_CREATED); RoleUtils.create(cellName, token, boxName, roleName, HttpStatus.SC_CREATED); - ResourceUtils.linkExtCelltoRole(DcCoreUtils.encodeUrlComp(extCellUrl), cellName, + ResourceUtils.linkExtCelltoRole(PersoniumCoreUtils.encodeUrlComp(extCellUrl), cellName, roleUrl, token, HttpStatus.SC_NO_CONTENT); // 削除できないことの確認 ExtCellUtils.delete(token, cellName, extCellUrl, HttpStatus.SC_CONFLICT); // リンクを解除し、削除できるようになることの確認 - ResourceUtils.linkExtCellRoleDelete(cellName, token, DcCoreUtils.encodeUrlComp(extCellUrl), + ResourceUtils.linkExtCellRoleDelete(cellName, token, PersoniumCoreUtils.encodeUrlComp(extCellUrl), boxName, roleName); ExtCellUtils.delete(token, cellName, extCellUrl, HttpStatus.SC_NO_CONTENT); } finally { ResourceUtils.linkExtCellRoleDelete(cellName, token, - DcCoreUtils.encodeUrlComp(extCellUrl), boxName, roleName); + PersoniumCoreUtils.encodeUrlComp(extCellUrl), boxName, roleName); RoleUtils.delete(cellName, token, boxName, roleName, -1); ExtCellUtils.delete(token, cellName, extCellUrl, -1); } @@ -111,12 +111,12 @@ public ExtCellDeleteTest() { // リンクを解除し、削除できるようになることの確認 ResourceUtils.linksDelete(cellName, Relation.EDM_TYPE_NAME, relationName, "null", ExtCell.EDM_TYPE_NAME, - "'" + DcCoreUtils.encodeUrlComp(extCellUrl + "'"), token); + "'" + PersoniumCoreUtils.encodeUrlComp(extCellUrl + "'"), token); ExtCellUtils.delete(token, cellName, extCellUrl, HttpStatus.SC_NO_CONTENT); } finally { ResourceUtils.linksDelete(cellName, Relation.EDM_TYPE_NAME, relationName, "null", ExtCell.EDM_TYPE_NAME, - "'" + DcCoreUtils.encodeUrlComp(extCellUrl + "'"), token); + "'" + PersoniumCoreUtils.encodeUrlComp(extCellUrl + "'"), token); RelationUtils.delete(cellName, token, relationName, boxName, -1); ExtCellUtils.delete(token, cellName, extCellUrl, -1); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtCellLinkTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/ExtCellLinkTest.java similarity index 90% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtCellLinkTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/ExtCellLinkTest.java index 26cd27b6c..450ad8db4 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtCellLinkTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/ExtCellLinkTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; @@ -27,21 +27,21 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.ExtCellUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.ExtCellUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * BoxとRelationの$linksのテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class ExtCellLinkTest extends ODataCommon { @@ -59,7 +59,7 @@ public class ExtCellLinkTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public ExtCellLinkTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtCellReadTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/ExtCellReadTest.java similarity index 87% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtCellReadTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/ExtCellReadTest.java index f9720b00a..1235e60ba 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtCellReadTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/ExtCellReadTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import javax.ws.rs.HttpMethod; @@ -22,13 +22,13 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.ExtCellUtils; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.ExtCellUtils; /** * ExtCell取得のテスト. @@ -44,7 +44,7 @@ public class ExtCellReadTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public ExtCellReadTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtCellUpdateTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/ExtCellUpdateTest.java similarity index 86% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtCellUpdateTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/ExtCellUpdateTest.java index c5b9f7e8f..79331f35a 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtCellUpdateTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/ExtCellUpdateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import javax.ws.rs.HttpMethod; @@ -24,13 +24,13 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.ExtCellUtils; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.ExtCellUtils; /** * ExtCell更新のテスト. @@ -46,7 +46,7 @@ public class ExtCellUpdateTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public ExtCellUpdateTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -84,7 +84,7 @@ public ExtCellUpdateTest() { */ @Test public final void Urlが1024文字の場合正常に作成されること() { - String newCellUrl = "http://localhost:8080/dc1-core/testcell1" + StringUtils.repeat("a", 983) + "/"; + String newCellUrl = "http://localhost:8080/personium-core/testcell1" + StringUtils.repeat("a", 977) + "/"; try { ExtCellUtils.create(token, cellName, extCellUrl, HttpStatus.SC_CREATED); @@ -99,7 +99,7 @@ public ExtCellUpdateTest() { */ @Test public final void Urlが1025文字以上の場合400エラーを返却すること() { - String newCellUrl = "http://localhost:8080/dc1-core/testcell1" + StringUtils.repeat("a", 984) + "/"; + String newCellUrl = "http://localhost:8080/personium-core/testcell1" + StringUtils.repeat("a", 978) + "/"; try { ExtCellUtils.create(token, cellName, extCellUrl, HttpStatus.SC_CREATED); @@ -114,7 +114,7 @@ public ExtCellUpdateTest() { */ @Test public final void UrlのschemeがFTPの場合400エラーを返却すること() { - String newCellUrl = "ftp://localhost:21/dc1-core/testcell1/"; + String newCellUrl = "ftp://localhost:21/personium-core/testcell1/"; try { ExtCellUtils.create(token, cellName, extCellUrl, HttpStatus.SC_CREATED); @@ -153,7 +153,7 @@ public ExtCellUpdateTest() { */ @Test public final void Urlが正規化されていない場合400エラーを返却すること() { - String newCellUrl = "https://localhost:8080/dc1-core/test/../cell/./box/../"; + String newCellUrl = "https://localhost:8080/personium-core/test/../cell/./box/../"; try { ExtCellUtils.create(token, cellName, extCellUrl, HttpStatus.SC_CREATED); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtRoleCreateTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/ExtRoleCreateTest.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtRoleCreateTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/ExtRoleCreateTest.java index b753c7f76..43cdc8eb9 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtRoleCreateTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/ExtRoleCreateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import java.util.HashMap; import java.util.Map; @@ -24,16 +24,16 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.ExtRoleUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.ExtRoleUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * ExtRoleの登録のテスト. @@ -49,7 +49,7 @@ public class ExtRoleCreateTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public ExtRoleCreateTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -198,7 +198,7 @@ public ExtRoleCreateTest() { */ @Test public final void ExtRoleが1024文字の場合正常に作成されること() { - String extRolePath = "http://localhost:8080/dc1-core/testextRole" + String extRolePath = "http://localhost:8080/personium-core/testextRole" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" @@ -208,7 +208,7 @@ public ExtRoleCreateTest() { + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaax"; + + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaax"; String relationName = "testrelation"; try { CellCtlUtils.createRelation(cellName, relationName); @@ -224,8 +224,8 @@ public ExtRoleCreateTest() { * ExtRoleが1025文字の場合正常に作成されること. */ @Test - public final void ExtRoleが1025文字の場合正常に作成されること() { - String extRolePath = "http://localhost:8080/dc1-core/testextRole" + public final void ExtRoleが1025文字の場合作成されないこと() { + String extRolePath = "http://localhost:8080/personium-core/testextRole" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" @@ -235,7 +235,7 @@ public ExtRoleCreateTest() { + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaax"; + + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaax"; String relationName = "testrelation"; try { CellCtlUtils.createRelation(cellName, relationName); @@ -251,7 +251,7 @@ public ExtRoleCreateTest() { */ @Test public final void ExtRoleのschemeが不正の場合400エラーを返却すること() { - String extRolePath = "ftp://localhost:21/dc1-core/testextRole"; + String extRolePath = "ftp://localhost:21/personium-core/testextRole"; String relationName = "testrelation"; try { CellCtlUtils.createRelation(cellName, relationName); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtRoleDeleteTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/ExtRoleDeleteTest.java similarity index 81% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtRoleDeleteTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/ExtRoleDeleteTest.java index 63f160ada..75e17ac32 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtRoleDeleteTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/ExtRoleDeleteTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import javax.ws.rs.HttpMethod; @@ -25,21 +25,21 @@ import org.odata4j.core.ODataConstants; import org.odata4j.core.ODataVersion; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.ExtCellUtils; -import com.fujitsu.dc.test.utils.ExtRoleUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.RelationUtils; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.ExtCellUtils; +import io.personium.test.utils.ExtRoleUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.RelationUtils; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.TResponse; /** * ExtRoleの削除のテスト. @@ -49,13 +49,13 @@ public class ExtRoleDeleteTest extends ODataCommon { private static String cellName = "testcell1"; private static String testExtRoleName = UrlUtils.roleResource(cellName, "__", "testrole"); - private final String token = DcCoreConfig.getMasterToken(); + private final String token = PersoniumUnitConfig.getMasterToken(); /** * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public ExtRoleDeleteTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -124,7 +124,7 @@ private void deleteExtRole( TResponse res = Http.request("cell/extRole/extRole-delete.txt") .with("token", AbstractCase.MASTER_TOKEN_NAME) .with("cellPath", cellName) - .with("extRoleName", DcCoreUtils.encodeUrlComp(testExtRoleName)) + .with("extRoleName", PersoniumCoreUtils.encodeUrlComp(testExtRoleName)) .with("relationName", relationName) .with("relationBoxName", relationBoxName) .returns() @@ -144,7 +144,7 @@ private void deleteExtRole() { Http.request("cell/extRole/extRole-delete-norelation.txt") .with("token", AbstractCase.MASTER_TOKEN_NAME) .with("cellPath", cellName) - .with("extRoleName", DcCoreUtils.encodeUrlComp(testExtRoleName)) + .with("extRoleName", PersoniumCoreUtils.encodeUrlComp(testExtRoleName)) .returns() .statusCode(HttpStatus.SC_NOT_FOUND); } @@ -172,18 +172,18 @@ private void deleteExtRole() { RelationUtils.create(cellName, token, relationBody, -1); ExtRoleUtils.create(token, cellName, extRoleBody, HttpStatus.SC_CREATED); RoleUtils.create(cellName, token, boxName, roleName, HttpStatus.SC_CREATED); - ResourceUtils.linksExtRoleToRole(cellName, DcCoreUtils.encodeUrlComp(extRoleName), + ResourceUtils.linksExtRoleToRole(cellName, PersoniumCoreUtils.encodeUrlComp(extRoleName), "'relation'", "null", UrlUtils.roleUrl(cellName, null, roleName), token); // 削除できないことの確認 ExtRoleUtils.delete(token, cellName, extRoleName, "'relation'", "null", HttpStatus.SC_CONFLICT); // リンクを解除し、削除できるようになることの確認 - ResourceUtils.linksDeleteExtRoleToRole(cellName, DcCoreUtils.encodeUrlComp(extRoleName), + ResourceUtils.linksDeleteExtRoleToRole(cellName, PersoniumCoreUtils.encodeUrlComp(extRoleName), "relation", "null", roleName, token); ExtRoleUtils.delete(token, cellName, extRoleName, "'relation'", "null", HttpStatus.SC_NO_CONTENT); } finally { - ResourceUtils.linksDeleteExtRoleToRole(cellName, DcCoreUtils.encodeUrlComp(extRoleName), + ResourceUtils.linksDeleteExtRoleToRole(cellName, PersoniumCoreUtils.encodeUrlComp(extRoleName), "relation", "null", roleName, token); RoleUtils.delete(cellName, token, boxName, roleName, -1); ExtRoleUtils.delete(token, cellName, extRoleName, "'relation'", "null", -1); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtRoleLinkTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/ExtRoleLinkTest.java similarity index 90% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtRoleLinkTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/ExtRoleLinkTest.java index 54e43e526..ff2bef0db 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtRoleLinkTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/ExtRoleLinkTest.java @@ -14,21 +14,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import org.apache.http.HttpStatus; import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * ExtRoleとRelationの$linksのテスト. @@ -43,7 +43,7 @@ public class ExtRoleLinkTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public ExtRoleLinkTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -59,7 +59,7 @@ public ExtRoleLinkTest() { CellCtlUtils.createExtRole(testCellName, testExtRoleName, relationName, relationBoxName); String testExtRoleUrl = extRoleUrl(testCellName, - relationBoxName, relationName, DcCoreUtils.encodeUrlComp(testExtRoleName)); + relationBoxName, relationName, PersoniumCoreUtils.encodeUrlComp(testExtRoleName)); // $links作成 Http.request("cell/link.txt") @@ -89,7 +89,7 @@ public ExtRoleLinkTest() { CellCtlUtils.createExtRole(testCellName, testExtRoleName, relationName, relationBoxName); String testExtRoleUrl = extRoleUrl(testCellName, - relationBoxName, relationName, DcCoreUtils.encodeUrlComp(testExtRoleName)); + relationBoxName, relationName, PersoniumCoreUtils.encodeUrlComp(testExtRoleName)); // $links作成 Http.request("cell/link.txt") @@ -118,7 +118,7 @@ public ExtRoleLinkTest() { CellCtlUtils.createExtRole(testCellName, testExtRoleName, relationName, relationBoxName); String testExtRoleUrl = extRoleUrl(testCellName, - relationBoxName, relationName, DcCoreUtils.encodeUrlComp(testExtRoleName)); + relationBoxName, relationName, PersoniumCoreUtils.encodeUrlComp(testExtRoleName)); // $links作成 Http.request("cell/link.txt") diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtRoleListTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/ExtRoleListTest.java similarity index 87% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtRoleListTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/ExtRoleListTest.java index 22f50f570..efabb8de8 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtRoleListTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/ExtRoleListTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import java.util.HashMap; import java.util.Map; @@ -24,16 +24,16 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.ExtRoleUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.ExtRoleUtils; +import io.personium.test.utils.TResponse; /** * ExtCell一覧取得のテスト. @@ -51,7 +51,7 @@ public class ExtRoleListTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public ExtRoleListTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtRoleReadTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/ExtRoleReadTest.java similarity index 85% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtRoleReadTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/ExtRoleReadTest.java index 7e7e7bab6..4278d5461 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtRoleReadTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/ExtRoleReadTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import java.util.HashMap; import java.util.Map; @@ -24,15 +24,15 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.core.model.ctl.ExtRole; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.ExtRoleUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.model.ctl.ExtRole; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.ExtRoleUtils; +import io.personium.test.utils.TResponse; /** * ExtCell取得のテスト. @@ -50,7 +50,7 @@ public class ExtRoleReadTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public ExtRoleReadTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtRoleUpdateTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/ExtRoleUpdateTest.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtRoleUpdateTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/ExtRoleUpdateTest.java index 534ff3ad6..8259863be 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/ExtRoleUpdateTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/ExtRoleUpdateTest.java @@ -14,20 +14,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import org.apache.http.HttpStatus; import org.json.simple.JSONObject; import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.ExtRoleUtils; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.ExtRoleUtils; /** * ExtCell更新のテスト. @@ -44,7 +44,7 @@ public class ExtRoleUpdateTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public ExtRoleUpdateTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/Link.java b/src/test/java/io/personium/test/jersey/cell/ctl/Link.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/Link.java rename to src/test/java/io/personium/test/jersey/cell/ctl/Link.java index ef4ebe028..f00e52381 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/Link.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/Link.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import java.util.List; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RelationCreateTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/RelationCreateTest.java similarity index 93% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RelationCreateTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/RelationCreateTest.java index 020663e7d..cd85c000b 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RelationCreateTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/RelationCreateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import java.util.HashMap; import java.util.Map; @@ -25,20 +25,20 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.RelationUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.Box; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.RelationUtils; +import io.personium.test.utils.TResponse; /** * Relationの登録のテスト. @@ -54,7 +54,7 @@ public class RelationCreateTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public RelationCreateTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -553,7 +553,7 @@ public RelationCreateTest() { try { // Box作成 - DcResponse resBox = createBox(boxname); + PersoniumResponse resBox = createBox(boxname); locationHeaderBox = resBox.getFirstHeader(HttpHeaders.LOCATION); TResponse res = createRelation(relationName, boxname); @@ -582,7 +582,7 @@ public RelationCreateTest() { try { // Box作成 - DcResponse resBox = createBox(boxname); + PersoniumResponse resBox = createBox(boxname); locationHeaderBox = resBox.getFirstHeader(HttpHeaders.LOCATION); TResponse res = createRelation(relationName, boxname); @@ -611,7 +611,7 @@ public RelationCreateTest() { try { // Box作成 - DcResponse resBox = createBox(boxname); + PersoniumResponse resBox = createBox(boxname); locationHeaderBox = resBox.getFirstHeader(HttpHeaders.LOCATION); TResponse res = createRelation(relationName, boxname); @@ -663,8 +663,8 @@ public RelationCreateTest() { // メッセージ確認 ODataCommon.checkErrorResponseBody(res, - DcCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.getCode(), - DcCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.params(boxname).getMessage()); + PersoniumCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.getCode(), + PersoniumCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.params(boxname).getMessage()); } finally { if (locationHeader != null) { CellCtlUtils.deleteOdataResource(locationHeader); @@ -780,8 +780,8 @@ private void createRelationAndCheckResponse(boolean boxNameEmpty) { } - private DcResponse createBox(String boxname) { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(cellName, Box.EDM_TYPE_NAME)); + private PersoniumResponse createBox(String boxname) { + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(cellName, Box.EDM_TYPE_NAME)); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody("Name", boxname); return request(req); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RelationDeleteTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/RelationDeleteTest.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RelationDeleteTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/RelationDeleteTest.java index 56497d561..1fd028457 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RelationDeleteTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/RelationDeleteTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import org.apache.http.HttpStatus; import org.json.simple.JSONObject; @@ -23,22 +23,22 @@ import org.odata4j.core.ODataConstants; import org.odata4j.core.ODataVersion; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.ctl.Relation; -import com.fujitsu.dc.core.model.ctl.Role; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.ExtRoleUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.RelationUtils; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.model.Box; +import io.personium.core.model.ctl.Relation; +import io.personium.core.model.ctl.Role; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.ExtRoleUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.RelationUtils; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.TResponse; /** * Relationの削除のテスト. @@ -53,7 +53,7 @@ public class RelationDeleteTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public RelationDeleteTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RelationReadTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/RelationReadTest.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RelationReadTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/RelationReadTest.java index 460115b13..81310a73d 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RelationReadTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/RelationReadTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import java.util.HashMap; import java.util.Map; @@ -23,15 +23,15 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.core.model.ctl.Relation; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.model.ctl.Relation; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * Relationの一件取得のテスト. @@ -47,7 +47,7 @@ public class RelationReadTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public RelationReadTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RelationUpdateTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/RelationUpdateTest.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RelationUpdateTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/RelationUpdateTest.java index ddb3bf7c5..3497560a3 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RelationUpdateTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/RelationUpdateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import java.util.HashMap; import java.util.Map; @@ -24,17 +24,17 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.Relation; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.RelationUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.Relation; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.RelationUtils; +import io.personium.test.utils.TResponse; /** * Relationの更新のテスト. @@ -50,7 +50,7 @@ public class RelationUpdateTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public RelationUpdateTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -286,8 +286,8 @@ public RelationUpdateTest() { // メッセージ確認 ODataCommon.checkErrorResponseBody(res, - DcCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.getCode(), - DcCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.params(boxname).getMessage()); + PersoniumCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.getCode(), + PersoniumCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.params(boxname).getMessage()); } finally { CellCtlUtils.deleteRelation(cellName, testRelationName); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RoleCreateTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/RoleCreateTest.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RoleCreateTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/RoleCreateTest.java index 1aa8cf852..9fcc0dd7e 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RoleCreateTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/RoleCreateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import java.util.HashMap; import java.util.Map; @@ -25,20 +25,20 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.Box; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.TResponse; /** * ROLEの登録のテスト. @@ -54,7 +54,7 @@ public class RoleCreateTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public RoleCreateTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -414,7 +414,7 @@ public RoleCreateTest() { try { // Box作成 - DcResponse resBox = createBox(boxname); + PersoniumResponse resBox = createBox(boxname); locationHeaderBox = resBox.getFirstHeader(HttpHeaders.LOCATION); TResponse res = createRole(roleName, boxname); @@ -444,7 +444,7 @@ public RoleCreateTest() { try { // Box作成 - DcResponse resBox = createBox(boxname); + PersoniumResponse resBox = createBox(boxname); locationHeaderBox = resBox.getFirstHeader(HttpHeaders.LOCATION); TResponse res = createRole(roleName, boxname); @@ -473,7 +473,7 @@ public RoleCreateTest() { try { // Box作成 - DcResponse resBox = createBox(boxname); + PersoniumResponse resBox = createBox(boxname); locationHeaderBox = resBox.getFirstHeader(HttpHeaders.LOCATION); TResponse res = createRole(roleName, boxname); @@ -525,8 +525,8 @@ public RoleCreateTest() { // メッセージ確認 ODataCommon.checkErrorResponseBody(res, - DcCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.getCode(), - DcCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.params(boxname).getMessage()); + PersoniumCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.getCode(), + PersoniumCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.params(boxname).getMessage()); } finally { if (locationHeader != null) { CellCtlUtils.deleteOdataResource(locationHeader); @@ -653,8 +653,8 @@ private void createRoleAndCheckResponse(boolean boxNameEmpty) { } - private DcResponse createBox(String boxname) { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(cellName, Box.EDM_TYPE_NAME)); + private PersoniumResponse createBox(String boxname) { + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(cellName, Box.EDM_TYPE_NAME)); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody("Name", boxname); return request(req); } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RoleDeleteTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/RoleDeleteTest.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RoleDeleteTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/RoleDeleteTest.java index 85857fae0..73616152b 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RoleDeleteTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/RoleDeleteTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import org.apache.http.HttpStatus; import org.junit.Test; @@ -22,13 +22,13 @@ import org.odata4j.core.ODataConstants; import org.odata4j.core.ODataVersion; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * ROLEの削除のテスト. @@ -43,7 +43,7 @@ public class RoleDeleteTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public RoleDeleteTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RoleListTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/RoleListTest.java similarity index 88% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RoleListTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/RoleListTest.java index ddb491ca4..615b10d65 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RoleListTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/RoleListTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import java.util.HashMap; import java.util.Map; @@ -23,15 +23,15 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.common.auth.token.Role; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.common.auth.token.Role; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * ROLEの一覧取得のテスト. @@ -47,7 +47,7 @@ public class RoleListTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public RoleListTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RoleReadTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/RoleReadTest.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RoleReadTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/RoleReadTest.java index 7c46e1604..9e09fb16d 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RoleReadTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/RoleReadTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import java.util.HashMap; import java.util.Map; @@ -23,15 +23,15 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.common.auth.token.Role; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.common.auth.token.Role; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * ROLEの一件取得のテスト. @@ -47,7 +47,7 @@ public class RoleReadTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public RoleReadTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RoleResourceTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/RoleResourceTest.java similarity index 83% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RoleResourceTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/RoleResourceTest.java index 42a80d2ed..411e3dfcd 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RoleResourceTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/RoleResourceTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import org.apache.http.HttpStatus; import org.junit.After; @@ -24,19 +24,19 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.utils.Http; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.utils.Http; import com.sun.jersey.test.framework.JerseyTest; /** * RoleResourceのテスト. * setupパッケージでのRoleの準備があることが前提 */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class RoleResourceTest extends JerseyTest { @@ -46,7 +46,7 @@ public class RoleResourceTest extends JerseyTest { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public RoleResourceTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RoleUpdateTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/RoleUpdateTest.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RoleUpdateTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/RoleUpdateTest.java index fde73efba..812c1d79e 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RoleUpdateTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/RoleUpdateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import java.util.HashMap; import java.util.Map; @@ -24,16 +24,16 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.common.auth.token.Role; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.common.auth.token.Role; +import io.personium.core.PersoniumCoreException; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * ROLEの更新のテスト. @@ -49,7 +49,7 @@ public class RoleUpdateTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public RoleUpdateTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -287,8 +287,8 @@ public RoleUpdateTest() { // メッセージ確認 ODataCommon.checkErrorResponseBody(res, - DcCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.getCode(), - DcCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.params(boxname).getMessage()); + PersoniumCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.getCode(), + PersoniumCoreException.OData.BODY_NTKP_NOT_FOUND_ERROR.params(boxname).getMessage()); } finally { CellCtlUtils.deleteRole(cellName, testRoleName); diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RoleViaNPTest.java b/src/test/java/io/personium/test/jersey/cell/ctl/RoleViaNPTest.java similarity index 87% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RoleViaNPTest.java rename to src/test/java/io/personium/test/jersey/cell/ctl/RoleViaNPTest.java index 09f314ee0..33a5467f8 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/RoleViaNPTest.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/RoleViaNPTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; import java.util.HashMap; import java.util.Map; @@ -26,16 +26,16 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.common.auth.token.Role; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.RelationUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.common.auth.token.Role; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.RelationUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.TResponse; /** * RoleのNP経由登録/一覧取得のテスト. @@ -50,7 +50,7 @@ public class RoleViaNPTest extends ODataCommon { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public RoleViaNPTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/package-info.java b/src/test/java/io/personium/test/jersey/cell/ctl/package-info.java similarity index 90% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/package-info.java rename to src/test/java/io/personium/test/jersey/cell/ctl/package-info.java index 3f59dbf74..79d8b8853 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/ctl/package-info.java +++ b/src/test/java/io/personium/test/jersey/cell/ctl/package-info.java @@ -17,5 +17,5 @@ /** * JUnit test. */ -package com.fujitsu.dc.test.jersey.cell.ctl; +package io.personium.test.jersey.cell.ctl; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/package-info.java b/src/test/java/io/personium/test/jersey/cell/package-info.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/package-info.java rename to src/test/java/io/personium/test/jersey/cell/package-info.java index 1ee74cfb7..93f86706a 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/package-info.java +++ b/src/test/java/io/personium/test/jersey/cell/package-info.java @@ -17,5 +17,5 @@ /** * Cell CRUD test. */ -package com.fujitsu.dc.test.jersey.cell; +package io.personium.test.jersey.cell; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/concurrent/AllTests.java b/src/test/java/io/personium/test/jersey/concurrent/AllTests.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/jersey/concurrent/AllTests.java rename to src/test/java/io/personium/test/jersey/concurrent/AllTests.java index e20008f9c..52531027b 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/concurrent/AllTests.java +++ b/src/test/java/io/personium/test/jersey/concurrent/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.concurrent; +package io.personium.test.jersey.concurrent; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/jersey/concurrent/ConcurrentDavRequestTest.java b/src/test/java/io/personium/test/jersey/concurrent/ConcurrentDavRequestTest.java similarity index 98% rename from src/test/java/com/fujitsu/dc/test/jersey/concurrent/ConcurrentDavRequestTest.java rename to src/test/java/io/personium/test/jersey/concurrent/ConcurrentDavRequestTest.java index 7e8c7672a..69d8bb454 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/concurrent/ConcurrentDavRequestTest.java +++ b/src/test/java/io/personium/test/jersey/concurrent/ConcurrentDavRequestTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.concurrent; +package io.personium.test.jersey.concurrent; import static org.junit.Assert.fail; import static org.junit.Assert.assertEquals; @@ -36,25 +36,25 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; import com.sun.jersey.test.framework.WebAppDescriptor; /** * Dav系APIへの同時リクエストテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class ConcurrentDavRequestTest extends JerseyTest { private static final String CELL_NAME = "testcell1"; @@ -70,11 +70,11 @@ public class ConcurrentDavRequestTest extends JerseyTest { static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } /** diff --git a/src/test/java/com/fujitsu/dc/test/jersey/concurrent/ConcurrentODataRequestTest.java b/src/test/java/io/personium/test/jersey/concurrent/ConcurrentODataRequestTest.java similarity index 96% rename from src/test/java/com/fujitsu/dc/test/jersey/concurrent/ConcurrentODataRequestTest.java rename to src/test/java/io/personium/test/jersey/concurrent/ConcurrentODataRequestTest.java index 96a551ce6..5de6526f4 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/concurrent/ConcurrentODataRequestTest.java +++ b/src/test/java/io/personium/test/jersey/concurrent/ConcurrentODataRequestTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.jersey.concurrent; +package io.personium.test.jersey.concurrent; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -34,25 +34,25 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.common.es.response.DcSearchResponse; -import com.fujitsu.dc.core.model.impl.es.EsModel; -import com.fujitsu.dc.core.model.impl.es.accessor.EntitySetAccessor; -import com.fujitsu.dc.core.model.lock.Lock; -import com.fujitsu.dc.core.model.lock.LockManager; -import com.fujitsu.dc.test.categories.Integration; -import com.fujitsu.dc.test.categories.Regression; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.common.es.response.PersoniumSearchResponse; +import io.personium.core.model.impl.es.EsModel; +import io.personium.core.model.impl.es.accessor.EntitySetAccessor; +import io.personium.core.model.lock.Lock; +import io.personium.core.model.lock.LockManager; +import io.personium.test.categories.Integration; +import io.personium.test.categories.Regression; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; import com.sun.jersey.test.framework.JerseyTest; /** * OData系APIへの同時リクエストテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class, Integration.class, Regression.class }) public class ConcurrentODataRequestTest extends JerseyTest { private static final String CELL_NAME = "testcell1"; @@ -73,7 +73,7 @@ public class ConcurrentODataRequestTest extends JerseyTest { * コンストラクタ. */ public ConcurrentODataRequestTest() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); } /** @@ -521,14 +521,14 @@ private Map buildFilterMap(Map subQuery) { private String retrieveCellId(Map query) { EntitySetAccessor ecCells = EsModel.cell(); - DcSearchResponse response = ecCells.search(query); + PersoniumSearchResponse response = ecCells.search(query); if (isRetriveFailed(response)) { return null; } return response.getHits().getAt(0).getId(); } - private boolean isRetriveFailed(DcSearchResponse response) { + private boolean isRetriveFailed(PersoniumSearchResponse response) { return response == null || response.getHits().getCount() == 0; } diff --git a/src/test/java/com/fujitsu/dc/test/jersey/package-info.java b/src/test/java/io/personium/test/jersey/package-info.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/jersey/package-info.java rename to src/test/java/io/personium/test/jersey/package-info.java index 53f090d13..076ea9d50 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/package-info.java +++ b/src/test/java/io/personium/test/jersey/package-info.java @@ -17,5 +17,5 @@ /** * JerseyTest test. */ -package com.fujitsu.dc.test.jersey; +package io.personium.test.jersey; diff --git a/src/test/java/com/fujitsu/dc/test/performance/box/odatacol/AllTests.java b/src/test/java/io/personium/test/performance/box/odatacol/AllTests.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/performance/box/odatacol/AllTests.java rename to src/test/java/io/personium/test/performance/box/odatacol/AllTests.java index ed3c90136..800fa0675 100644 --- a/src/test/java/com/fujitsu/dc/test/performance/box/odatacol/AllTests.java +++ b/src/test/java/io/personium/test/performance/box/odatacol/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.performance.box.odatacol; +package io.personium.test.performance.box.odatacol; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/performance/box/odatacol/UserDataListPerformanceTest.java b/src/test/java/io/personium/test/performance/box/odatacol/UserDataListPerformanceTest.java similarity index 85% rename from src/test/java/com/fujitsu/dc/test/performance/box/odatacol/UserDataListPerformanceTest.java rename to src/test/java/io/personium/test/performance/box/odatacol/UserDataListPerformanceTest.java index 3409d8091..1fb6c20b4 100644 --- a/src/test/java/com/fujitsu/dc/test/performance/box/odatacol/UserDataListPerformanceTest.java +++ b/src/test/java/io/personium/test/performance/box/odatacol/UserDataListPerformanceTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.performance.box.odatacol; +package io.personium.test.performance.box.odatacol; import java.util.HashMap; import java.util.Map; @@ -28,19 +28,19 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.categories.Performance; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.odatacol.AbstractUserDataTest; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.TResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.categories.Performance; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.odatacol.AbstractUserDataTest; +import io.personium.test.setup.Setup; +import io.personium.test.utils.Http; +import io.personium.test.utils.TResponse; /** * UserData一覧のテスト. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Performance.class }) public class UserDataListPerformanceTest extends AbstractUserDataTest { @@ -112,7 +112,7 @@ public void deleteData(int index) { .with("entityType", "Category") .with("query", "") .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(HttpStatus.SC_OK) .debug(); diff --git a/src/test/java/com/fujitsu/dc/test/setup/Setup.java b/src/test/java/io/personium/test/setup/Setup.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/setup/Setup.java rename to src/test/java/io/personium/test/setup/Setup.java index 40191993a..b530de28d 100644 --- a/src/test/java/com/fujitsu/dc/test/setup/Setup.java +++ b/src/test/java/io/personium/test/setup/Setup.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.setup; +package io.personium.test.setup; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -39,36 +39,36 @@ import org.junit.Test; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.common.auth.token.Role; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.auth.OAuth2Helper; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.ctl.Account; -import com.fujitsu.dc.core.model.ctl.ExtCell; -import com.fujitsu.dc.core.model.ctl.Relation; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRestAdapter; -import com.fujitsu.dc.test.jersey.ODataCommon; -import com.fujitsu.dc.test.jersey.box.odatacol.UserDataListWithNPTest; -import com.fujitsu.dc.test.jersey.box.odatacol.schema.property.PropertyUtils; -import com.fujitsu.dc.test.unit.core.UrlUtils; -import com.fujitsu.dc.test.utils.AccountUtils; -import com.fujitsu.dc.test.utils.AssociationEndUtils; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.ExtRoleUtils; -import com.fujitsu.dc.test.utils.Http; -import com.fujitsu.dc.test.utils.RelationUtils; -import com.fujitsu.dc.test.utils.ResourceUtils; -import com.fujitsu.dc.test.utils.RoleUtils; -import com.fujitsu.dc.test.utils.TResponse; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.common.auth.token.Role; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.auth.OAuth2Helper; +import io.personium.core.model.Box; +import io.personium.core.model.Cell; +import io.personium.core.model.ctl.Account; +import io.personium.core.model.ctl.ExtCell; +import io.personium.core.model.ctl.Relation; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumRestAdapter; +import io.personium.test.jersey.ODataCommon; +import io.personium.test.jersey.box.odatacol.UserDataListWithNPTest; +import io.personium.test.jersey.box.odatacol.schema.property.PropertyUtils; +import io.personium.test.unit.core.UrlUtils; +import io.personium.test.utils.AccountUtils; +import io.personium.test.utils.AssociationEndUtils; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.ExtRoleUtils; +import io.personium.test.utils.Http; +import io.personium.test.utils.RelationUtils; +import io.personium.test.utils.ResourceUtils; +import io.personium.test.utils.RoleUtils; +import io.personium.test.utils.TResponse; +import io.personium.test.utils.UserDataUtils; /** * テスト環境の構築. @@ -144,7 +144,7 @@ public class Setup extends AbstractCase { * コンストラクタ. テスト対象のパッケージをsuperに渡す必要がある */ public Setup() { - super("com.fujitsu.dc.core.rs"); + super("io.personium.core.rs"); // アカウント生成 List accounts = new ArrayList(); for (int i = 0; i < NUM_ACCOUNTS; i++) { @@ -392,7 +392,7 @@ private void create(Config conf) { // ExtRoleとRoleの紐付け if (role.linkExtRole != null) { for (ExtRoleConfig extRole : role.linkExtRole) { - ResourceUtils.linksExtRoleToRole(conf.cellName, DcCoreUtils.encodeUrlComp(extRole.extRole), + ResourceUtils.linksExtRoleToRole(conf.cellName, PersoniumCoreUtils.encodeUrlComp(extRole.extRole), "'" + extRole.relationName + "'", extRole.relationBoxName, roleUrl, AbstractCase.MASTER_TOKEN_NAME); } @@ -400,7 +400,7 @@ private void create(Config conf) { if ("testcell2".equals(conf.cellName)) { // ExtCellとロールの結びつけ // testcell2のtestxell1向けのExtCellにrole2(readができるロール)を結びつけてやる - this.linkExtCelltoRole(DcCoreUtils.encodeUrlComp(UrlUtils.cellRoot("testcell1")), conf.cellName, + this.linkExtCelltoRole(PersoniumCoreUtils.encodeUrlComp(UrlUtils.cellRoot("testcell1")), conf.cellName, roleUrl); } } @@ -798,7 +798,7 @@ public static void createUserDatas(String cellName) { body = new JSONObject(); userDataId = "userdata001"; body.put("__id", userDataId); - int maxPropNum = DcCoreConfig.getMaxPropertyCountInEntityType(); + int maxPropNum = PersoniumUnitConfig.getMaxPropertyCountInEntityType(); for (int i = 0; i < maxPropNum; i++) { body.put("dynamicProperty" + i, "dynamicPropertyValue" + i); } @@ -971,10 +971,10 @@ public static void createUserDatasToSearchOdata(String cellName) { * リクエストボディ * @return ユーザーデータ作成時のレスポンスオブジェクト */ - private static DcResponse createUserDataWithDcClient(String cellName, String boxName, String colName, + private static PersoniumResponse createUserDataWithDcClient(String cellName, String boxName, String colName, String entityTypeName, JSONObject body) { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -1009,7 +1009,7 @@ private static void createUserData(String cellName, String boxName, String colNa Http.request("box/odatacol/create.txt").with("cell", cellName).with("box", boxName).with("collection", colName) .with("entityType", entityTypeName).with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) - .with("token", "Bearer " + DcCoreConfig.getMasterToken()).with("body", body.toJSONString()).returns() + .with("token", "Bearer " + PersoniumUnitConfig.getMasterToken()).with("body", body.toJSONString()).returns() .debug(); } @@ -1056,7 +1056,7 @@ private static void deleteUserData(String cellName, String boxName, String colNa String userDataId) { // リクエスト実行 Http.request("box/odatacol/delete.txt").with("cell", cellName).with("box", boxName).with("collection", colName) - .with("entityType", entityTypeName).with("id", userDataId).with("token", DcCoreConfig.getMasterToken()) + .with("entityType", entityTypeName).with("id", userDataId).with("token", PersoniumUnitConfig.getMasterToken()) .with("ifMatch", "*").returns(); } @@ -1240,9 +1240,9 @@ public static TResponse deleteAssociationEndLink(final String path, final String * @return Cell作成時のレスポンスオブジェクト */ @SuppressWarnings("unchecked") - final DcResponse createCell(final Config config) { - DcRestAdapter rest = new DcRestAdapter(); - DcResponse res = null; + final PersoniumResponse createCell(final Config config) { + PersoniumRestAdapter rest = new PersoniumRestAdapter(); + PersoniumResponse res = null; // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -1250,7 +1250,7 @@ final DcResponse createCell(final Config config) { // Owner指定があればセット String owner = config.owner; if (owner != null) { - requestheaders.put(DcCoreUtils.HttpHeaders.X_DC_UNIT_USER, owner); + requestheaders.put(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_UNIT_USER, owner); } // リクエストボディを生成 @@ -1299,8 +1299,8 @@ private void delete(Config conf) { */ public static void cellBulkDeletion(String cellName) { // セルの一括削除APIを実行する - DcRequest request = DcRequest.delete(UrlUtils.cellRoot(cellName)); - request.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).header("X-Dc-Recursive", "true"); + PersoniumRequest request = PersoniumRequest.delete(UrlUtils.cellRoot(cellName)); + request.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).header("X-Personium-Recursive", "true"); request(request); } @@ -1559,10 +1559,10 @@ public static void deleteCol(final String path, final String cellPath) { * @return 作成されたAccountのURL */ private String createAccount(final String cellName, final String name, final String pass) { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(cellName, Account.EDM_TYPE_NAME)); - req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).header(DcCoreUtils.HttpHeaders.X_DC_CREDENTIAL, pass) + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(cellName, Account.EDM_TYPE_NAME)); + req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).header(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_CREDENTIAL, pass) .addJsonBody("Name", name); - DcResponse res = request(req); + PersoniumResponse res = request(req); assertEquals(HttpStatus.SC_CREATED, res.getStatusCode()); String accLocHeader = res.getFirstHeader(HttpHeaders.LOCATION); assertNotNull(accLocHeader); @@ -1617,10 +1617,10 @@ private void createAccountforList(String cellName) { * @return 作成されたRoleのURL */ private String createRole(final String cellName, final String testRoleName) { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(cellName, Role.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(cellName, Role.EDM_TYPE_NAME)); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody("Name", testRoleName) .addJsonBody("_Box.Name", null); - DcResponse res = request(req); + PersoniumResponse res = request(req); assertEquals(HttpStatus.SC_CREATED, res.getStatusCode()); String roleLocHeader = res.getFirstHeader(HttpHeaders.LOCATION); assertNotNull(roleLocHeader); @@ -1635,9 +1635,9 @@ private String createRole(final String cellName, final String testRoleName) { * @return 作成されたRoleのURL */ private void matchRole(final String cellName, final String accountName, final String roleUrl) { - DcRequest req = DcRequest.post(UrlUtils.accountLinks(cellName, accountName)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.accountLinks(cellName, accountName)); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody("uri", roleUrl); - DcResponse res = request(req); + PersoniumResponse res = request(req); assertEquals(HttpStatus.SC_NO_CONTENT, res.getStatusCode()); } @@ -1652,12 +1652,12 @@ private void matchRole(final String cellName, final String accountName, final St * @return boxURL */ private String createBox2(final String cellName, final String boxName, final String boxSchema) { - DcRequest req = DcRequest.post(UrlUtils.cellCtl(cellName, Box.EDM_TYPE_NAME)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.cellCtl(cellName, Box.EDM_TYPE_NAME)); req.header(HttpHeaders.AUTHORIZATION, BEARER_MASTER_TOKEN).addJsonBody("Name", boxName); if (boxSchema != null) { req.addJsonBody("Schema", boxSchema); } - DcResponse res = request(req); + PersoniumResponse res = request(req); assertEquals(HttpStatus.SC_CREATED, res.getStatusCode()); String url = res.getFirstHeader(HttpHeaders.LOCATION); assertNotNull(url); diff --git a/src/test/java/com/fujitsu/dc/test/setup/package-info.java b/src/test/java/io/personium/test/setup/package-info.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/setup/package-info.java rename to src/test/java/io/personium/test/setup/package-info.java index 3cf8d29c9..98bae098c 100644 --- a/src/test/java/com/fujitsu/dc/test/setup/package-info.java +++ b/src/test/java/io/personium/test/setup/package-info.java @@ -17,5 +17,5 @@ /** * JUnit test. */ -package com.fujitsu.dc.test.setup; +package io.personium.test.setup; diff --git a/src/test/java/com/fujitsu/dc/test/unit/cell/AllTests.java b/src/test/java/io/personium/test/unit/cell/AllTests.java similarity index 93% rename from src/test/java/com/fujitsu/dc/test/unit/cell/AllTests.java rename to src/test/java/io/personium/test/unit/cell/AllTests.java index f8fdab7e3..87232d214 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/cell/AllTests.java +++ b/src/test/java/io/personium/test/unit/cell/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.cell; +package io.personium.test.unit.cell; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/unit/cell/EventResourceTest.java b/src/test/java/io/personium/test/unit/cell/EventResourceTest.java similarity index 93% rename from src/test/java/com/fujitsu/dc/test/unit/cell/EventResourceTest.java rename to src/test/java/io/personium/test/unit/cell/EventResourceTest.java index fbe99dac8..47bb36ca5 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/cell/EventResourceTest.java +++ b/src/test/java/io/personium/test/unit/cell/EventResourceTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.cell; +package io.personium.test.unit.cell; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -27,11 +27,11 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.eventbus.JSONEvent; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.rs.cell.EventResource; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.core.PersoniumCoreException; +import io.personium.core.eventbus.JSONEvent; +import io.personium.core.model.ctl.Common; +import io.personium.core.rs.cell.EventResource; +import io.personium.test.categories.Unit; /** * LogResourceユニットテストクラス. @@ -71,7 +71,7 @@ protected void validateEventProperties(final JSONEvent event) { */ @Test public void ヘッダの指定が無い場合デフォルト値が入ること() { - String result = EventResource.validateXDcRequestKey(null); + String result = EventResource.validateXPersoniumRequestKey(null); assertTrue(result.startsWith("PCS-")); String timeStr = result.substring(4); Long.parseLong(timeStr); @@ -82,7 +82,7 @@ protected void validateEventProperties(final JSONEvent event) { */ @Test public void ヘッダに空文字を指定した場合空文字が入ること() { - String result = EventResource.validateXDcRequestKey(""); + String result = EventResource.validateXPersoniumRequestKey(""); assertNotNull(result); assertEquals(0, result.length()); } @@ -92,7 +92,7 @@ protected void validateEventProperties(final JSONEvent event) { */ @Test public void ヘッダに1文字の文字列を指定した場合正しく扱われること() { - String result = EventResource.validateXDcRequestKey("a"); + String result = EventResource.validateXPersoniumRequestKey("a"); assertEquals("a", result); } @@ -106,29 +106,29 @@ protected void validateEventProperties(final JSONEvent event) { "abcdefghij" + "ABCDEFGHIJ" + "1234567890" + "-_-_-_-_-_" + // 120char "12345678"; - String result = EventResource.validateXDcRequestKey(maxHeaderStr128); + String result = EventResource.validateXPersoniumRequestKey(maxHeaderStr128); assertEquals(maxHeaderStr128, result); } /** * ヘッダに最大長を超えた文字列を指定した場合エラーとなること. */ - @Test(expected = DcCoreException.class) + @Test(expected = PersoniumCoreException.class) public void ヘッダに最大長を超えた文字列を指定した場合エラーとなること() { String maxHeaderStr128 = "abcdefghij" + "ABCDEFGHIJ" + "1234567890" + "-_-_-_-_-_" + // 40char "abcdefghij" + "ABCDEFGHIJ" + "1234567890" + "-_-_-_-_-_" + // 80char "abcdefghij" + "ABCDEFGHIJ" + "1234567890" + "-_-_-_-_-_" + // 120char "12345678"; - EventResource.validateXDcRequestKey(maxHeaderStr128 + "X"); + EventResource.validateXPersoniumRequestKey(maxHeaderStr128 + "X"); } /** * ヘッダに不正な文字種を指定した場合エラーとなること. */ - @Test(expected = DcCoreException.class) + @Test(expected = PersoniumCoreException.class) public void ヘッダに不正な文字種を指定した場合エラーとなること() { - EventResource.validateXDcRequestKey("abc-012#"); + EventResource.validateXPersoniumRequestKey("abc-012#"); } @SuppressWarnings("unchecked") @@ -160,7 +160,7 @@ private JSONObject createEventBody() { /** * リクエストボディに空データを指定した場合にエラーとなること. */ - @Test(expected = DcCoreException.class) + @Test(expected = PersoniumCoreException.class) public void リクエストボディに空データを指定した場合にエラーとなること() { TestEventResource resource = new TestEventResource(); StringReader reader = new StringReader(""); @@ -170,7 +170,7 @@ private JSONObject createEventBody() { /** * リクエストボディに空JSONを指定した場合にエラーとなること. */ - @Test(expected = DcCoreException.class) + @Test(expected = PersoniumCoreException.class) public void リクエストボディに空JSONを指定した場合にエラーとなること() { TestEventResource resource = new TestEventResource(); JSONObject body = new JSONObject(); @@ -182,7 +182,7 @@ private JSONObject createEventBody() { /** * リクエストボディのlevelがない場合に場合にエラーとなること. */ - @Test(expected = DcCoreException.class) + @Test(expected = PersoniumCoreException.class) public void リクエストボディのlevelがない場合にエラーとなること() { TestEventResource resource = new TestEventResource(); JSONObject body = createEventBody(); @@ -241,7 +241,7 @@ private JSONObject createEventBody() { /** * リクエストボディのlevelが空文字の場合にエラーとなること. */ - @Test(expected = DcCoreException.class) + @Test(expected = PersoniumCoreException.class) @SuppressWarnings("unchecked") public void リクエストボディのlevelが空文字の場合にエラーとなること() { TestEventResource resource = new TestEventResource(); @@ -254,7 +254,7 @@ private JSONObject createEventBody() { /** * リクエストボディのlevelにFATALを指定した場合にエラーとなること. */ - @Test(expected = DcCoreException.class) + @Test(expected = PersoniumCoreException.class) @SuppressWarnings("unchecked") public void リクエストボディのlevelにFATALを指定した場合にエラーとなること() { TestEventResource resource = new TestEventResource(); @@ -267,7 +267,7 @@ private JSONObject createEventBody() { /** * リクエストボディのactionがない場合にエラーとなること. */ - @Test(expected = DcCoreException.class) + @Test(expected = PersoniumCoreException.class) public void リクエストボディのactionがない場合にエラーとなること() { TestEventResource resource = new TestEventResource(); JSONObject body = createEventBody(); @@ -302,7 +302,7 @@ private JSONObject createEventBody() { /** * リクエストボディのactionが文字列型上限値超えの場合に正常終了すること. */ - @Test(expected = DcCoreException.class) + @Test(expected = PersoniumCoreException.class) @SuppressWarnings("unchecked") public void リクエストボディのactionが文字列型上限値超えの場合に正常終了すること() { TestEventResource resource = new TestEventResource(); @@ -393,7 +393,7 @@ private JSONObject createEventBody() { /** * リクエストボディのobjectがない場合にエラーとなること. */ - @Test(expected = DcCoreException.class) + @Test(expected = PersoniumCoreException.class) public void リクエストボディのobjectがない場合にエラーとなること() { TestEventResource resource = new TestEventResource(); JSONObject body = createEventBody(); @@ -428,7 +428,7 @@ private JSONObject createEventBody() { /** * リクエストボディのobjectが文字列型上限値超えの場合に正常終了すること. */ - @Test(expected = DcCoreException.class) + @Test(expected = PersoniumCoreException.class) @SuppressWarnings("unchecked") public void リクエストボディのobjectが文字列型上限値超えの場合に正常終了すること() { TestEventResource resource = new TestEventResource(); @@ -465,7 +465,7 @@ private JSONObject createEventBody() { /** * リクエストボディのresultがない場合にエラーとなること. */ - @Test(expected = DcCoreException.class) + @Test(expected = PersoniumCoreException.class) public void リクエストボディのresultがない場合にエラーとなること() { TestEventResource resource = new TestEventResource(); JSONObject body = createEventBody(); @@ -500,7 +500,7 @@ private JSONObject createEventBody() { /** * リクエストボディのresultが文字列型上限値超えの場合に正常終了すること. */ - @Test(expected = DcCoreException.class) + @Test(expected = PersoniumCoreException.class) @SuppressWarnings("unchecked") public void リクエストボディのresultが文字列型上限値超えの場合に正常終了すること() { TestEventResource resource = new TestEventResource(); diff --git a/src/test/java/com/fujitsu/dc/test/unit/cell/LogTest.java b/src/test/java/io/personium/test/unit/cell/LogTest.java similarity index 98% rename from src/test/java/com/fujitsu/dc/test/unit/cell/LogTest.java rename to src/test/java/io/personium/test/unit/cell/LogTest.java index 490bb8863..7ec3f5a84 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/cell/LogTest.java +++ b/src/test/java/io/personium/test/unit/cell/LogTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.cell; +package io.personium.test.unit.cell; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -41,9 +41,9 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.rs.cell.LogResource; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.core.PersoniumCoreException; +import io.personium.core.rs.cell.LogResource; +import io.personium.test.categories.Unit; /** * LogResourceユニットテストクラス. @@ -376,7 +376,7 @@ protected boolean isValidLogFile(String collection, String fileName) { fail(); } catch (Exception e) { Throwable t = e.getCause(); - assertEquals(DcCoreException.Event.ARCHIVE_FILE_CANNOT_OPEN.getMessage(), t.getMessage()); + assertEquals(PersoniumCoreException.Event.ARCHIVE_FILE_CANNOT_OPEN.getMessage(), t.getMessage()); } } diff --git a/src/test/java/com/fujitsu/dc/core/rs/AllTests.java b/src/test/java/io/personium/test/unit/core/AllTests.java similarity index 89% rename from src/test/java/com/fujitsu/dc/core/rs/AllTests.java rename to src/test/java/io/personium/test/unit/core/AllTests.java index 171135a68..331943444 100644 --- a/src/test/java/com/fujitsu/dc/core/rs/AllTests.java +++ b/src/test/java/io/personium/test/unit/core/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core.rs; +package io.personium.test.unit.core; import org.junit.runner.RunWith; import org.junit.runners.Suite; @@ -25,7 +25,7 @@ */ @RunWith(Suite.class) @SuiteClasses({ - DcCoreExceptionMapperTest.class + PersoniumUnitConfigTest.class }) public class AllTests { } diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/DcCoreConfigTest.java b/src/test/java/io/personium/test/unit/core/PersoniumUnitConfigTest.java similarity index 77% rename from src/test/java/com/fujitsu/dc/test/unit/core/DcCoreConfigTest.java rename to src/test/java/io/personium/test/unit/core/PersoniumUnitConfigTest.java index a850261a5..176d96bc6 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/DcCoreConfigTest.java +++ b/src/test/java/io/personium/test/unit/core/PersoniumUnitConfigTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core; +package io.personium.test.unit.core; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -27,23 +27,23 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.categories.Unit; /** * AccessContext ユニットテストクラス. */ @Category({ Unit.class }) -public class DcCoreConfigTest { +public class PersoniumUnitConfigTest { /** * ユニットテスト用クラス. */ - public class UnitDcCoreConfig extends DcCoreConfig { + public class UnitTestPersoniumUnitConfig extends PersoniumUnitConfig { /** * コンストラクタ. */ - public UnitDcCoreConfig() { + public UnitTestPersoniumUnitConfig() { super(); } @@ -62,11 +62,11 @@ public InputStream unitGetConfigFileInputStream(String configFilePath) { */ @Test public void 存在するプロパティファイルのパスを指定した場合_指定したパスのプロパティファイルを読み込むこと() { - UnitDcCoreConfig dcCoreConfig = new UnitDcCoreConfig(); + UnitTestPersoniumUnitConfig pUnitConfig = new UnitTestPersoniumUnitConfig(); Properties properties = new Properties(); - String configFilePath = ClassLoader.getSystemResource("dc-config.properties.unit").getPath(); + String configFilePath = ClassLoader.getSystemResource("personium-unit-config.properties.unit").getPath(); try { - properties.load(dcCoreConfig.unitGetConfigFileInputStream(configFilePath)); + properties.load(pUnitConfig.unitGetConfigFileInputStream(configFilePath)); } catch (IOException e) { fail("properties load failuer"); } @@ -78,10 +78,10 @@ public InputStream unitGetConfigFileInputStream(String configFilePath) { */ @Test public void 存在しないプロパティファイルのパスを指定した場合_クラスパス上のプロパティを読み込むこと() { - UnitDcCoreConfig dcCoreConfig = new UnitDcCoreConfig(); + UnitTestPersoniumUnitConfig pUnitConfig = new UnitTestPersoniumUnitConfig(); Properties properties = new Properties(); try { - properties.load(dcCoreConfig.unitGetConfigFileInputStream("dc-config.properties.unitx")); + properties.load(pUnitConfig.unitGetConfigFileInputStream("personium-unit-config.properties.unitx")); } catch (IOException e) { fail("properties load failuer"); } diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/UrlUtils.java b/src/test/java/io/personium/test/unit/core/UrlUtils.java similarity index 99% rename from src/test/java/com/fujitsu/dc/test/unit/core/UrlUtils.java rename to src/test/java/io/personium/test/unit/core/UrlUtils.java index 0d670d514..ee4ead886 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/UrlUtils.java +++ b/src/test/java/io/personium/test/unit/core/UrlUtils.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core; +package io.personium.test.unit.core; import java.net.MalformedURLException; import java.net.URL; @@ -22,9 +22,9 @@ import org.apache.commons.lang.StringUtils; import org.apache.wink.common.internal.uri.UriEncoder; -import com.fujitsu.dc.core.model.Box; -import com.fujitsu.dc.core.model.ctl.ReceivedMessage; -import com.fujitsu.dc.core.model.ctl.SentMessage; +import io.personium.core.model.Box; +import io.personium.core.model.ctl.ReceivedMessage; +import io.personium.core.model.ctl.SentMessage; /** * URLの作成の組立を行う関数群. diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/auth/AccessContextTest.java b/src/test/java/io/personium/test/unit/core/auth/AccessContextTest.java similarity index 90% rename from src/test/java/com/fujitsu/dc/test/unit/core/auth/AccessContextTest.java rename to src/test/java/io/personium/test/unit/core/auth/AccessContextTest.java index 35a30c4e4..67381b652 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/auth/AccessContextTest.java +++ b/src/test/java/io/personium/test/unit/core/auth/AccessContextTest.java @@ -14,9 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.auth; +package io.personium.test.unit.core.auth; -import static com.fujitsu.dc.common.auth.token.AbstractOAuth2Token.MILLISECS_IN_AN_HOUR; +import static io.personium.common.auth.token.AbstractOAuth2Token.MILLISECS_IN_AN_HOUR; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; import static org.powermock.api.mockito.PowerMockito.mock; @@ -39,29 +39,29 @@ import org.junit.runner.RunWith; import org.mockito.Matchers; -import com.fujitsu.dc.common.auth.token.CellLocalAccessToken; -import com.fujitsu.dc.common.auth.token.LocalToken; -import com.fujitsu.dc.common.auth.token.UnitLocalUnitUserToken; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.auth.AccessContext; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.odata.OEntityWrapper; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.common.auth.token.CellLocalAccessToken; +import io.personium.common.auth.token.LocalToken; +import io.personium.common.auth.token.UnitLocalUnitUserToken; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.auth.AccessContext; +import io.personium.core.model.Cell; +import io.personium.core.odata.OEntityWrapper; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.unit.core.UrlUtils; /** * AccessContext ユニットテストクラス. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({ Unit.class }) public class AccessContextTest { /** * マスタートークン. */ - public static final String MASTER_TOKEN = DcCoreConfig.getMasterToken(); + public static final String MASTER_TOKEN = PersoniumUnitConfig.getMasterToken(); /** * baseUrl. @@ -156,7 +156,7 @@ public void testCreate() { @Ignore public void testCreateBasic() { String auth = "Basic " - + DcCoreUtils.encodeBase64Url("user:pass".getBytes()); + + PersoniumCoreUtils.encodeBase64Url("user:pass".getBytes()); Cell cell = (Cell) mock(Cell.class); when(cell.authenticateAccount((OEntityWrapper) Matchers.any(), Matchers.anyString())).thenReturn(true); // 第1引数は AuthHeader, 第2引数は UriInfo, 第3引数は cookie_peer, 第4引数は cookie内の暗号化されたトークン情報 @@ -172,7 +172,7 @@ public void testCreateBasic() { @Test public void testCreateBasicINVALID() { String auth = "Basic " - + DcCoreUtils.encodeBase64Url("user:pass".getBytes()); + + PersoniumCoreUtils.encodeBase64Url("user:pass".getBytes()); Cell cell = (Cell) mock(Cell.class); when(cell.authenticateAccount((OEntityWrapper) Matchers.any(), Matchers.anyString())).thenReturn(false); // 第1引数は AuthHeader, 第2引数は UriInfo, 第3引数は cookie_peer, 第4引数は cookie内の暗号化されたトークン情報 @@ -252,7 +252,7 @@ public void testCreateBearerAuthzCellNullParamBearerSpace() { cell.getOwner(), uriInfo.getBaseUri().getHost() + ":" + uriInfo.getBaseUri().getPort()); String tokenString = uluut.toTokenString(); - // dc_cookie_peerとして、ランダムなUUIDを設定する + // p_cookie_peerとして、ランダムなUUIDを設定する String dcCookiePeer = UUID.randomUUID().toString(); String cookieValue = dcCookiePeer + "\t" + tokenString; // ヘッダに返却するdc-cookie値は、暗号化する @@ -283,7 +283,7 @@ public void testCreateBearerAuthzCellNullParamBearerSpace() { uriInfo.getBaseUri().getHost() + ":" + uriInfo.getBaseUri().getPort()); String tokenString = token.toTokenString(); - // dc_cookie_peerとして、ランダムなUUIDを設定する + // p_cookie_peerとして、ランダムなUUIDを設定する String dcCookiePeer = UUID.randomUUID().toString(); String cookieValue = dcCookiePeer + "\t" + tokenString; // ヘッダに返却するdc-cookie値は、暗号化する @@ -313,7 +313,7 @@ public void testCreateBearerAuthzCellNullParamBearerSpace() { cell.getOwner(), uriInfo.getBaseUri().getHost() + ":" + uriInfo.getBaseUri().getPort()); String tokenString = uluut.toTokenString(); - // dc_cookie_peerとして、ランダムなUUIDを設定する + // p_cookie_peerとして、ランダムなUUIDを設定する String dcCookiePeer = UUID.randomUUID().toString(); String cookieValue = dcCookiePeer + "\t" + tokenString; // ヘッダに返却するdc-cookie値は、暗号化する @@ -321,7 +321,7 @@ public void testCreateBearerAuthzCellNullParamBearerSpace() { UnitLocalUnitUserToken.getIvBytes(AccessContext.getCookieCryptKey(uriInfo.getBaseUri()))); String basicAuth = "Basic " - + DcCoreUtils.encodeBase64Url("user:pass".getBytes()); + + PersoniumCoreUtils.encodeBase64Url("user:pass".getBytes()); // 第1引数は AuthHeader, 第2引数は UriInfo, 第3引数は cookie_peer, 第4引数は cookie内の暗号化されたトークン情報 AccessContext accessContext = AccessContext.create(basicAuth, uriInfo, dcCookiePeer, encodedCookieValue, @@ -347,7 +347,7 @@ public void testCreateBearerAuthzCellNullParamBearerSpace() { cell.getOwner(), uriInfo.getBaseUri().getHost() + ":" + uriInfo.getBaseUri().getPort()); String tokenString = uluut.toTokenString(); - // dc_cookie_peerとして、ランダムなUUIDを設定する + // p_cookie_peerとして、ランダムなUUIDを設定する String dcCookiePeer = UUID.randomUUID().toString(); String cookieValue = dcCookiePeer + "\t" + tokenString; // ヘッダに返却するdc-cookie値は、暗号化する diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/auth/AllTests.java b/src/test/java/io/personium/test/unit/core/auth/AllTests.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/unit/core/auth/AllTests.java rename to src/test/java/io/personium/test/unit/core/auth/AllTests.java index 128e95278..ed2c88aa0 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/auth/AllTests.java +++ b/src/test/java/io/personium/test/unit/core/auth/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.auth; +package io.personium.test.unit.core.auth; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/auth/AuthzTest.java b/src/test/java/io/personium/test/unit/core/auth/AuthzTest.java similarity index 96% rename from src/test/java/com/fujitsu/dc/test/unit/core/auth/AuthzTest.java rename to src/test/java/io/personium/test/unit/core/auth/AuthzTest.java index 68b0b4ce8..e83860046 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/auth/AuthzTest.java +++ b/src/test/java/io/personium/test/unit/core/auth/AuthzTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.auth; +package io.personium.test.unit.core.auth; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -31,19 +31,19 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.auth.OAuth2Helper; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.DavRsCmp; -import com.fujitsu.dc.core.rs.cell.AuthzEndPointResource; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.core.auth.OAuth2Helper; +import io.personium.core.model.Cell; +import io.personium.core.model.DavRsCmp; +import io.personium.core.rs.cell.AuthzEndPointResource; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.unit.core.UrlUtils; import com.sun.jersey.api.client.ClientResponse.Status; /** * AccessContext ユニットテストクラス. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({ Unit.class }) public class AuthzTest { diff --git a/src/test/java/io/personium/test/unit/core/auth/package-info.java b/src/test/java/io/personium/test/unit/core/auth/package-info.java new file mode 100644 index 000000000..b16c79527 --- /dev/null +++ b/src/test/java/io/personium/test/unit/core/auth/package-info.java @@ -0,0 +1,21 @@ +/** + * personium.io + * Copyright 2014 FUJITSU LIMITED + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * JUnit test. + */ +package io.personium.test.unit.core.auth; + diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/bar/AllTests.java b/src/test/java/io/personium/test/unit/core/bar/AllTests.java similarity index 93% rename from src/test/java/com/fujitsu/dc/test/unit/core/bar/AllTests.java rename to src/test/java/io/personium/test/unit/core/bar/AllTests.java index 16549640a..579dc6220 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/bar/AllTests.java +++ b/src/test/java/io/personium/test/unit/core/bar/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.bar; +package io.personium.test.unit.core.bar; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/bar/BarFileContentsTest.java b/src/test/java/io/personium/test/unit/core/bar/BarFileContentsTest.java similarity index 98% rename from src/test/java/com/fujitsu/dc/test/unit/core/bar/BarFileContentsTest.java rename to src/test/java/io/personium/test/unit/core/bar/BarFileContentsTest.java index f542a1fcf..9b2873c62 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/bar/BarFileContentsTest.java +++ b/src/test/java/io/personium/test/unit/core/bar/BarFileContentsTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.bar; +package io.personium.test.unit.core.bar; import static org.junit.Assert.assertEquals; @@ -26,11 +26,11 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.core.bar.BarFileReadRunner; -import com.fujitsu.dc.core.model.DavCmp; -import com.fujitsu.dc.core.model.impl.es.DavCmpEsImpl; -import com.fujitsu.dc.core.model.impl.fs.DavCmpFsImpl; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.core.bar.BarFileReadRunner; +import io.personium.core.model.DavCmp; +import io.personium.core.model.impl.es.DavCmpEsImpl; +import io.personium.core.model.impl.fs.DavCmpFsImpl; +import io.personium.test.categories.Unit; /** * BarFileのバリデートのユニットテストクラス. diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/bar/BarFileUtilsTest.java b/src/test/java/io/personium/test/unit/core/bar/BarFileUtilsTest.java similarity index 85% rename from src/test/java/com/fujitsu/dc/test/unit/core/bar/BarFileUtilsTest.java rename to src/test/java/io/personium/test/unit/core/bar/BarFileUtilsTest.java index f285f3e4e..740882aef 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/bar/BarFileUtilsTest.java +++ b/src/test/java/io/personium/test/unit/core/bar/BarFileUtilsTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.bar; +package io.personium.test.unit.core.bar; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -30,9 +30,9 @@ import org.w3c.dom.Document; import org.w3c.dom.Element; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.bar.BarFileUtils; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.core.PersoniumCoreException; +import io.personium.core.bar.BarFileUtils; +import io.personium.test.categories.Unit; /** * BarFileUtilsクラス用のユニットテストクラス. @@ -69,12 +69,12 @@ public class BarFileUtilsTest { return; } catch (ParserConfigurationException e) { fail("DOM Parsing Error: " + e.getMessage()); - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -98,14 +98,14 @@ public class BarFileUtilsTest { fail("Unexpected exception"); } catch (ParserConfigurationException e) { fail("DOM Parsing Error: " + e.getMessage()); - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { String code = dce.getCode(); - assertEquals(DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.getCode(), code); + assertEquals(PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.getCode(), code); return; } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -129,14 +129,14 @@ public class BarFileUtilsTest { fail("Unexpected exception"); } catch (ParserConfigurationException e) { fail("DOM Parsing Error: " + e.getMessage()); - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { String code = dce.getCode(); - assertEquals(DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.getCode(), code); + assertEquals(PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.getCode(), code); return; } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -160,14 +160,14 @@ public class BarFileUtilsTest { return; } catch (ParserConfigurationException e) { fail("DOM Parsing Error: " + e.getMessage()); - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { String code = dce.getCode(); - assertEquals(DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.getCode(), code); + assertEquals(PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.getCode(), code); return; } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -191,14 +191,14 @@ public class BarFileUtilsTest { return; } catch (ParserConfigurationException e) { fail("DOM Parsing Error: " + e.getMessage()); - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { String code = dce.getCode(); - assertEquals(DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.getCode(), code); + assertEquals(PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.getCode(), code); return; } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -222,14 +222,14 @@ public class BarFileUtilsTest { return; } catch (ParserConfigurationException e) { fail("DOM Parsing Error: " + e.getMessage()); - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { String code = dce.getCode(); - assertEquals(DcCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.getCode(), code); + assertEquals(PersoniumCoreException.BarInstall.JSON_FILE_FORMAT_ERROR.getCode(), code); return; } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } } diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/bar/BarFileValidateTest.java b/src/test/java/io/personium/test/unit/core/bar/BarFileValidateTest.java similarity index 90% rename from src/test/java/com/fujitsu/dc/test/unit/core/bar/BarFileValidateTest.java rename to src/test/java/io/personium/test/unit/core/bar/BarFileValidateTest.java index dffb3698b..bee133d29 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/bar/BarFileValidateTest.java +++ b/src/test/java/io/personium/test/unit/core/bar/BarFileValidateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.bar; +package io.personium.test.unit.core.bar; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -46,16 +46,16 @@ import org.junit.experimental.categories.Category; import org.mockito.Mockito; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreConfig.BinaryData; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.bar.BarFileInstaller; -import com.fujitsu.dc.core.bar.BarFileReadRunner; -import com.fujitsu.dc.core.bar.jackson.JSONManifest; -import com.fujitsu.dc.core.bar.jackson.JSONMappedObject; -import com.fujitsu.dc.core.model.DavCmp; -import com.fujitsu.dc.core.model.impl.es.CellEsImpl; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumUnitConfig.BinaryData; +import io.personium.core.PersoniumCoreException; +import io.personium.core.bar.BarFileInstaller; +import io.personium.core.bar.BarFileReadRunner; +import io.personium.core.bar.jackson.JSONManifest; +import io.personium.core.bar.jackson.JSONMappedObject; +import io.personium.core.model.DavCmp; +import io.personium.core.model.impl.es.CellEsImpl; +import io.personium.test.categories.Unit; /** * BarFileのバリデートのユニットテストクラス. @@ -256,7 +256,7 @@ public List registJsonLinksUserdata(String entryName, InputStr jp.nextToken(); TestBarRunner testBarRunner = new TestBarRunner(); testBarRunner.barFileJsonValidate(jp, mapper, jsonName); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { return; } catch (Exception e) { fail(e.getMessage()); @@ -265,11 +265,11 @@ public List registJsonLinksUserdata(String entryName, InputStr } /** - * 30_extroles.jsonに_relation.Nameがない場合_DcCoreExceptionが返却されること. + * 30_extroles.jsonに_relation.Nameがない場合_PersoniumCoreExceptionが返却されること. */ @Test @SuppressWarnings("unchecked") - public void バリデートテスト_30_extRole_jsonに_relation_Nameがない場合_DcCoreExceptionが返却されること() { + public void バリデートテスト_30_extRole_jsonに_relation_Nameがない場合_PersoniumCoreExceptionが返却されること() { JSONObject json = new JSONObject(); json.put("ExtRole", "https://fqdn/cellName/__role/__/role2"); @@ -282,19 +282,19 @@ public List registJsonLinksUserdata(String entryName, InputStr TestBarRunner testBarRunner = new TestBarRunner(); testBarRunner.barFileJsonValidate(jp, mapper, jsonName); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { return; } catch (Exception e) { fail(e.getMessage()); } - fail("DcCoreException not throw"); + fail("PersoniumCoreException not throw"); } /** - * 10_relations.jsonが配列形式でない場合_DcCoreExceptionが返却されること. + * 10_relations.jsonが配列形式でない場合_PersoniumCoreExceptionが返却されること. */ @Test - public void バリデートテスト_10_relations_jsonが配列形式でない場合_DcCoreExceptionが返却されること() { + public void バリデートテスト_10_relations_jsonが配列形式でない場合_PersoniumCoreExceptionが返却されること() { URL fileUrl = ClassLoader.getSystemResource(RESOURCE_PATH + "/10_relations_not_array.json"); File file = new File(fileUrl.getPath()); @@ -308,19 +308,19 @@ public List registJsonLinksUserdata(String entryName, InputStr jp.nextToken(); TestBarRunner testBarRunner = new TestBarRunner(); testBarRunner.parseJsonEntityData(jp, mapper, jsonName); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { return; } catch (IOException e) { fail(e.getMessage()); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** - * 10_relations.jsonの内容が異なるファイルである場合_DcCoreExceptionが返却されること. + * 10_relations.jsonの内容が異なるファイルである場合_PersoniumCoreExceptionが返却されること. */ @Test - public void バリデートテスト_10_relations_jsonの内容が異なるファイルである場合_DcCoreExceptionが返却されること() { + public void バリデートテスト_10_relations_jsonの内容が異なるファイルである場合_PersoniumCoreExceptionが返却されること() { URL fileUrl = ClassLoader.getSystemResource(RESOURCE_PATH + "/10_relations_different_json.json"); File file = new File(fileUrl.getPath()); JsonFactory f = new JsonFactory(); @@ -333,19 +333,19 @@ public List registJsonLinksUserdata(String entryName, InputStr jp.nextToken(); TestBarRunner testBarRunner = new TestBarRunner(); testBarRunner.parseJsonEntityData(jp, mapper, jsonName); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { return; } catch (IOException e) { fail(e.getMessage()); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** - * 10_relations.jsonの配列内がオブジェクトでない場合_DcCoreExceptionが返却されること. + * 10_relations.jsonの配列内がオブジェクトでない場合_PersoniumCoreExceptionが返却されること. */ @Test - public void バリデートテスト_10_relations_jsonの配列内がオブジェクトでない場合_DcCoreExceptionが返却されること() { + public void バリデートテスト_10_relations_jsonの配列内がオブジェクトでない場合_PersoniumCoreExceptionが返却されること() { URL fileUrl = ClassLoader.getSystemResource(RESOURCE_PATH + "/10_relations_not_object.json"); File file = new File(fileUrl.getPath()); JsonFactory f = new JsonFactory(); @@ -358,12 +358,12 @@ public List registJsonLinksUserdata(String entryName, InputStr jp.nextToken(); TestBarRunner testBarRunner = new TestBarRunner(); testBarRunner.parseJsonEntityData(jp, mapper, jsonName); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { return; } catch (IOException e) { fail(e.getMessage()); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -396,10 +396,10 @@ public List registJsonLinksUserdata(String entryName, InputStr } /** - * バリデートテスト_70_link_jsonに必須項目がない場合_DcCoreExceptionが返却されること. + * バリデートテスト_70_link_jsonに必須項目がない場合_PersoniumCoreExceptionが返却されること. */ @Test - public void バリデートテスト_70_link_jsonに必須項目がない場合_DcCoreExceptionが返却されること() { + public void バリデートテスト_70_link_jsonに必須項目がない場合_PersoniumCoreExceptionが返却されること() { String[] files = {"/70_$links_no_fromtype.json", "/70_$links_no_fromname.json", @@ -421,7 +421,7 @@ public List registJsonLinksUserdata(String entryName, InputStr jp.nextToken(); TestBarRunner testBarRunner = new TestBarRunner(); testBarRunner.barFileJsonValidate(jp, mapper, jsonName); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { continue; } catch (IOException e) { fail(e.getMessage()); @@ -431,10 +431,10 @@ public List registJsonLinksUserdata(String entryName, InputStr } /** - * バリデートテスト_70_link_jsonのToTypeにAccount_ExtCell_Boxを指定した場合_DcCoreExceptionが返却されること. + * バリデートテスト_70_link_jsonのToTypeにAccount_ExtCell_Boxを指定した場合_PersoniumCoreExceptionが返却されること. */ @Test - public void バリデートテスト_70_link_jsonのToTypeにAccount_ExtCell_Boxを指定した場合_DcCoreExceptionが返却されること() { + public void バリデートテスト_70_link_jsonのToTypeにAccount_ExtCell_Boxを指定した場合_PersoniumCoreExceptionが返却されること() { String[] files = {"/70_$links_totype_Account.json", "/70_$links_totype_ExtCell.json", @@ -455,7 +455,7 @@ public List registJsonLinksUserdata(String entryName, InputStr jp.nextToken(); TestBarRunner testBarRunner = new TestBarRunner(); testBarRunner.barFileJsonValidate(jp, mapper, jsonName); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { continue; } catch (IOException e) { fail(e.getMessage()); @@ -500,7 +500,7 @@ public List registJsonLinksUserdata(String entryName, InputStr assertTrue(result.getJson().get("ToName") instanceof JSONObject); JSONObject toResult = (JSONObject) result.getJson().get("ToName"); assertEquals("role1", toResult.get("Name")); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { fail(e.getMessage()); } catch (IOException e) { fail(e.getMessage()); @@ -546,7 +546,7 @@ public List registJsonLinksUserdata(String entryName, InputStr assertTrue(result.getJson().get("ToId") instanceof JSONObject); JSONObject toResult = (JSONObject) result.getJson().get("ToId"); assertEquals("id_role1", toResult.get("__id")); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { fail(e.getMessage()); } catch (IOException e) { fail(e.getMessage()); @@ -603,14 +603,14 @@ public List registJsonLinksUserdata(String entryName, InputStr TestBarRunner testBarRunner = new TestBarRunner(); testBarRunner.manifestJsonValidate(jp, mapper); - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { assertEquals(400, dce.getStatus()); assertEquals("PR400-BI-0006", dce.getCode()); return; } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -632,14 +632,14 @@ public List registJsonLinksUserdata(String entryName, InputStr TestBarRunner testBarRunner = new TestBarRunner(); testBarRunner.manifestJsonValidate(jp, mapper); - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { assertEquals(400, dce.getStatus()); assertEquals("PR400-BI-0006", dce.getCode()); return; } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -661,14 +661,14 @@ public List registJsonLinksUserdata(String entryName, InputStr TestBarRunner testBarRunner = new TestBarRunner(); testBarRunner.manifestJsonValidate(jp, mapper); - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { assertEquals(400, dce.getStatus()); assertEquals("PR400-BI-0006", dce.getCode()); return; } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -691,14 +691,14 @@ public List registJsonLinksUserdata(String entryName, InputStr TestBarRunner testBarRunner = new TestBarRunner(); testBarRunner.manifestJsonValidate(jp, mapper); - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { assertEquals(400, dce.getStatus()); assertEquals("PR400-BI-0006", dce.getCode()); return; } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -752,14 +752,14 @@ public List registJsonLinksUserdata(String entryName, InputStr TestBarRunner testBarRunner = new TestBarRunner(); testBarRunner.manifestJsonValidate(jp, mapper); - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { assertEquals(400, dce.getStatus()); assertEquals("PR400-BI-0006", dce.getCode()); return; } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -780,7 +780,7 @@ public List registJsonLinksUserdata(String entryName, InputStr buf.append(""); buf.append(""); buf.append(""); + + " xmlns:p=\"urn:x-personium:xmlns\"/>"); buf.append(""); buf.append("HTTP/1.1 200 OK"); buf.append(""); @@ -793,10 +793,10 @@ public List registJsonLinksUserdata(String entryName, InputStr buf.append("Sun, 20 Jan 2013 23:41:54 GMT"); buf.append(""); buf.append(""); - buf.append(""); + buf.append(""); buf.append(""); buf.append(""); + + " xmlns:p=\"urn:x-personium:xmlns\">"); buf.append(""); buf.append(""); buf.append("../__/role"); @@ -823,10 +823,10 @@ public List registJsonLinksUserdata(String entryName, InputStr buf.append("Sun, 20 Jan 2013 23:42:04 GMT"); buf.append(""); buf.append(""); - buf.append(""); + buf.append(""); buf.append(""); buf.append(""); + + " xmlns:p=\"urn:x-personium:xmlns\"/>"); buf.append(""); buf.append("HTTP/1.1 200 OK"); buf.append(""); @@ -871,7 +871,7 @@ public List registJsonLinksUserdata(String entryName, InputStr buf.append(""); buf.append(""); buf.append(""); + + " xmlns:p=\"urn:x-personium:xmlns\"/>"); buf.append(""); buf.append("HTTP/1.1 200 OK"); buf.append(""); @@ -908,7 +908,7 @@ public List registJsonLinksUserdata(String entryName, InputStr buf.append(""); buf.append(""); buf.append(""); + + " xmlns:p=\"urn:x-personium:xmlns\"/>"); buf.append(""); buf.append("HTTP/1.1 200 OK"); buf.append(""); @@ -942,10 +942,10 @@ public List registJsonLinksUserdata(String entryName, InputStr buf.append(""); buf.append(""); // - buf.append(""); + buf.append(""); buf.append(""); buf.append(""); + + " xmlns:p=\"urn:x-personium:xmlns\"/>"); buf.append(""); buf.append("HTTP/1.1 200 OK"); buf.append(""); @@ -978,12 +978,12 @@ public List registJsonLinksUserdata(String entryName, InputStr boolean res = testBarRunner.registUserSchema(entryName, fis, null); assertTrue(res); // EntityTypeが1件もないとみなされるため return; - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -1002,12 +1002,12 @@ public List registJsonLinksUserdata(String entryName, InputStr boolean res = testBarRunner.registUserSchema(entryName, fis, null); assertFalse(res); return; - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -1026,12 +1026,12 @@ public List registJsonLinksUserdata(String entryName, InputStr boolean res = testBarRunner.registUserSchema(entryName, fis, null); assertFalse(res); return; - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -1050,12 +1050,12 @@ public List registJsonLinksUserdata(String entryName, InputStr boolean res = testBarRunner.registUserSchema(entryName, fis, null); assertTrue(res); return; - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -1074,12 +1074,12 @@ public List registJsonLinksUserdata(String entryName, InputStr boolean res = testBarRunner.registUserSchema(entryName, fis, null); assertFalse(res); return; - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -1098,12 +1098,12 @@ public List registJsonLinksUserdata(String entryName, InputStr boolean res = testBarRunner.registUserSchema(entryName, fis, null); assertFalse(res); return; - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -1122,12 +1122,12 @@ public List registJsonLinksUserdata(String entryName, InputStr boolean res = testBarRunner.registUserSchema(entryName, fis, null); assertFalse(res); return; - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -1146,12 +1146,12 @@ public List registJsonLinksUserdata(String entryName, InputStr boolean res = testBarRunner.registUserSchema(entryName, fis, null); assertFalse(res); return; - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -1170,12 +1170,12 @@ public List registJsonLinksUserdata(String entryName, InputStr boolean res = testBarRunner.registUserSchema(entryName, fis, null); assertFalse(res); return; - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -1194,12 +1194,12 @@ public List registJsonLinksUserdata(String entryName, InputStr boolean res = testBarRunner.registUserSchema(entryName, fis, null); assertFalse(res); return; - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -1218,12 +1218,12 @@ public List registJsonLinksUserdata(String entryName, InputStr boolean res = testBarRunner.registUserSchema(entryName, fis, null); assertFalse(res); return; - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -1242,12 +1242,12 @@ public List registJsonLinksUserdata(String entryName, InputStr boolean res = testBarRunner.registUserSchema(entryName, fis, null); assertFalse(res); return; - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -1266,12 +1266,12 @@ public List registJsonLinksUserdata(String entryName, InputStr boolean res = testBarRunner.registUserSchema(entryName, fis, null); assertFalse(res); return; - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -1290,12 +1290,12 @@ public List registJsonLinksUserdata(String entryName, InputStr boolean res = testBarRunner.registUserSchema(entryName, fis, null); assertFalse(res); return; - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -1314,12 +1314,12 @@ public List registJsonLinksUserdata(String entryName, InputStr boolean res = testBarRunner.registUserSchema(entryName, fis, null); assertFalse(res); return; - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -1338,12 +1338,12 @@ public List registJsonLinksUserdata(String entryName, InputStr boolean res = testBarRunner.registUserSchema(entryName, fis, null); assertFalse(res); return; - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -1362,12 +1362,12 @@ public List registJsonLinksUserdata(String entryName, InputStr boolean res = testBarRunner.registUserSchema(entryName, fis, null); assertFalse(res); return; - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -1386,12 +1386,12 @@ public List registJsonLinksUserdata(String entryName, InputStr boolean res = testBarRunner.registUserSchema(entryName, fis, null); assertFalse(res); return; - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -1410,12 +1410,12 @@ public List registJsonLinksUserdata(String entryName, InputStr boolean res = testBarRunner.registUserSchema(entryName, fis, null); assertFalse(res); return; - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -1434,12 +1434,12 @@ public List registJsonLinksUserdata(String entryName, InputStr boolean res = testBarRunner.registUserSchema(entryName, fis, null); assertFalse(res); return; - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -1458,12 +1458,12 @@ public List registJsonLinksUserdata(String entryName, InputStr boolean res = testBarRunner.registUserSchema(entryName, fis, null); assertFalse(res); return; - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -1482,12 +1482,12 @@ public List registJsonLinksUserdata(String entryName, InputStr boolean res = testBarRunner.registUserSchema(entryName, fis, null); assertFalse(res); return; - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -1506,12 +1506,12 @@ public List registJsonLinksUserdata(String entryName, InputStr boolean res = testBarRunner.registUserSchema(entryName, fis, null); assertFalse(res); return; - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -1530,12 +1530,12 @@ public List registJsonLinksUserdata(String entryName, InputStr boolean res = testBarRunner.registUserSchema(entryName, fis, null); assertFalse(res); return; - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -1554,12 +1554,12 @@ public List registJsonLinksUserdata(String entryName, InputStr boolean res = testBarRunner.registUserSchema(entryName, fis, null); assertFalse(res); return; - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -1578,12 +1578,12 @@ public List registJsonLinksUserdata(String entryName, InputStr boolean res = testBarRunner.registUserSchema(entryName, fis, null); assertFalse(res); return; - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -1602,12 +1602,12 @@ public List registJsonLinksUserdata(String entryName, InputStr List res = testBarRunner.registJsonLinksUserdata(entryName, fis); assertNull(res); return; - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -1626,12 +1626,12 @@ public List registJsonLinksUserdata(String entryName, InputStr List res = testBarRunner.registJsonLinksUserdata(entryName, fis); assertNull(res); return; - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } /** @@ -1650,12 +1650,12 @@ public List registJsonLinksUserdata(String entryName, InputStr List res = testBarRunner.registJsonLinksUserdata(entryName, fis); assertNull(res); return; - } catch (DcCoreException dce) { + } catch (PersoniumCoreException dce) { fail("Unexpected exception"); } catch (Exception ex) { fail("Unexpected exception"); } - fail("DcCoreExceptionが返却されない"); + fail("PersoniumCoreExceptionが返却されない"); } @@ -1692,8 +1692,8 @@ protected void checkBarFileEntrySize(ZipArchiveEntry zae, String entryName, try { testBarInstaller.checkBarFileSize(file); fail("Unexpected exception"); - } catch (DcCoreException dce) { - String code = DcCoreException.BarInstall.BAR_FILE_SIZE_TOO_LARGE.getCode(); + } catch (PersoniumCoreException dce) { + String code = PersoniumCoreException.BarInstall.BAR_FILE_SIZE_TOO_LARGE.getCode(); assertEquals(code, dce.getCode()); } catch (Exception ex) { fail("Unexpected exception"); @@ -1721,8 +1721,8 @@ protected void checkBarFileEntrySize(ZipArchiveEntry zae, String entryName, testBarInstaller.checkBarFileEntrySize(zae, zae.getName(), maxBarEntryFileSize); } fail("Unexpected exception"); - } catch (DcCoreException dce) { - String code = DcCoreException.BarInstall.BAR_FILE_ENTRY_SIZE_TOO_LARGE.getCode(); + } catch (PersoniumCoreException dce) { + String code = PersoniumCoreException.BarInstall.BAR_FILE_ENTRY_SIZE_TOO_LARGE.getCode(); assertEquals(code, dce.getCode()); } catch (Exception ex) { fail("Unexpected exception"); @@ -1736,8 +1736,8 @@ protected void checkBarFileEntrySize(ZipArchiveEntry zae, String entryName, */ @Test public void testStoreTemporaryBarFile() throws Exception { - boolean fsyncEnabled = DcCoreConfig.getFsyncEnabled(); - DcCoreConfig.set(BinaryData.FSYNC_ENABLED, "true"); + boolean fsyncEnabled = PersoniumUnitConfig.getFsyncEnabled(); + PersoniumUnitConfig.set(BinaryData.FSYNC_ENABLED, "true"); try { CellEsImpl cell = new CellEsImpl(); cell.setId("hogeCell"); @@ -1749,7 +1749,7 @@ public void testStoreTemporaryBarFile() throws Exception { method.invoke(bfi, new FileInputStream("pom.xml")); Mockito.verify(bfi, Mockito.atLeast(1)).sync((FileDescriptor) Mockito.anyObject()); } finally { - DcCoreConfig.set(BinaryData.FSYNC_ENABLED, String.valueOf(fsyncEnabled)); + PersoniumUnitConfig.set(BinaryData.FSYNC_ENABLED, String.valueOf(fsyncEnabled)); } } @@ -1760,8 +1760,8 @@ public void testStoreTemporaryBarFile() throws Exception { */ @Test public void testStoreTemporaryBarFile2() throws Exception { - boolean fsyncEnabled = DcCoreConfig.getFsyncEnabled(); - DcCoreConfig.set(BinaryData.FSYNC_ENABLED, "false"); + boolean fsyncEnabled = PersoniumUnitConfig.getFsyncEnabled(); + PersoniumUnitConfig.set(BinaryData.FSYNC_ENABLED, "false"); try { CellEsImpl cell = new CellEsImpl(); cell.setId("hogeCell"); @@ -1773,7 +1773,7 @@ public void testStoreTemporaryBarFile2() throws Exception { method.invoke(bfi, new FileInputStream("pom.xml")); Mockito.verify(bfi, Mockito.never()).sync((FileDescriptor) Mockito.anyObject()); } finally { - DcCoreConfig.set(BinaryData.FSYNC_ENABLED, String.valueOf(fsyncEnabled)); + PersoniumUnitConfig.set(BinaryData.FSYNC_ENABLED, String.valueOf(fsyncEnabled)); } } } diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/bar/RootpropsValidateTest.java b/src/test/java/io/personium/test/unit/core/bar/RootpropsValidateTest.java similarity index 95% rename from src/test/java/com/fujitsu/dc/test/unit/core/bar/RootpropsValidateTest.java rename to src/test/java/io/personium/test/unit/core/bar/RootpropsValidateTest.java index 37e40ffec..a727ce634 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/bar/RootpropsValidateTest.java +++ b/src/test/java/io/personium/test/unit/core/bar/RootpropsValidateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.bar; +package io.personium.test.unit.core.bar; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -27,8 +27,8 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.core.bar.BarFileReadRunner; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.core.bar.BarFileReadRunner; +import io.personium.test.categories.Unit; /** * BarFileのバリデートのユニットテストクラス. @@ -72,7 +72,7 @@ protected boolean validateCollectionDefinitions(String multiStatusInputStr) thro + " " + " " + " " + + " xmlns:p=\"urn:x-personium:xmlns\" />" + " " + " " + " " @@ -100,7 +100,7 @@ protected boolean validateCollectionDefinitions(String multiStatusInputStr) thro + " " + " " + " " + + " xmlns:p=\"urn:x-personium:xmlns\" />" + " " + " " + " " @@ -128,7 +128,7 @@ protected boolean validateCollectionDefinitions(String multiStatusInputStr) thro + " " + " " + " " + + " xmlns:p=\"urn:x-personium:xmlns\" />" + " " + " " + " " @@ -162,7 +162,7 @@ protected boolean validateCollectionDefinitions(String multiStatusInputStr) thro + " " + " " + " " + + " xmlns:p=\"urn:x-personium:xmlns\" />" + " " + " " + " " @@ -190,7 +190,7 @@ protected boolean validateCollectionDefinitions(String multiStatusInputStr) thro + " " + " " + " " + + " xmlns:p=\"urn:x-personium:xmlns\" />" + " " + " " + " " @@ -230,7 +230,7 @@ protected boolean validateCollectionDefinitions(String multiStatusInputStr) thro + " " + " " + " " + + " xmlns:p=\"urn:x-personium:xmlns\" />" + " " + " " + " " @@ -268,7 +268,7 @@ protected boolean validateCollectionDefinitions(String multiStatusInputStr) thro + " " + " " + " " + + " xmlns:p=\"urn:x-personium:xmlns\" />" + " " + " " + " " @@ -306,7 +306,7 @@ protected boolean validateCollectionDefinitions(String multiStatusInputStr) thro + " " + " " + " " + + " xmlns:p=\"urn:x-personium:xmlns\" />" + " " + " " + " " @@ -376,7 +376,7 @@ protected boolean validateCollectionDefinitions(String multiStatusInputStr) thro + " " + " " + " " - + " " + + " " + " " + " " + " " @@ -421,7 +421,7 @@ protected boolean validateCollectionDefinitions(String multiStatusInputStr) thro + " " + " " + " " - + " " + + " " + " " + " " + " " @@ -466,7 +466,7 @@ protected boolean validateCollectionDefinitions(String multiStatusInputStr) thro + " " + " " + " " - + " " + + " " + " " + " " + " " @@ -477,7 +477,7 @@ protected boolean validateCollectionDefinitions(String multiStatusInputStr) thro + " " + " " + " " - + " " + + " " + " " + " " + " " @@ -486,7 +486,7 @@ protected boolean validateCollectionDefinitions(String multiStatusInputStr) thro TestBarRunner runner = new TestBarRunner(); try { assertFalse(runner.validateCollectionDefinitions(multiStatusInputStr)); - String input2 = multiStatusInputStr.replace("dc:odata", "dc:service"); + String input2 = multiStatusInputStr.replace("p:odata", "p:service"); assertFalse(runner.validateCollectionDefinitions(input2)); } catch (IOException e) { fail(e.getMessage()); @@ -516,7 +516,7 @@ protected boolean validateCollectionDefinitions(String multiStatusInputStr) thro + " " + " " + " " - + " " + + " " + " " + " " + " " @@ -563,7 +563,7 @@ protected boolean validateCollectionDefinitions(String multiStatusInputStr) thro + " " + " " + " " - + " " + + " " + " " + " " + " " @@ -608,7 +608,7 @@ protected boolean validateCollectionDefinitions(String multiStatusInputStr) thro + " " + " " + " " - + " " + + " " + " " + " " + " " @@ -735,7 +735,7 @@ protected boolean validateCollectionDefinitions(String multiStatusInputStr) thro + " " + " " + " " - + " " + + " " + " " + " " + " " @@ -744,9 +744,9 @@ protected boolean validateCollectionDefinitions(String multiStatusInputStr) thro TestBarRunner runner = new TestBarRunner(); try { assertFalse(runner.validateCollectionDefinitions(multiStatusInputStr)); - String input2 = multiStatusInputStr.replace("dc:service", "dc:odata"); + String input2 = multiStatusInputStr.replace("p:service", "p:odata"); assertFalse(runner.validateCollectionDefinitions(input2)); - String input3 = multiStatusInputStr.replace("", ""); + String input3 = multiStatusInputStr.replace("", ""); assertFalse(runner.validateCollectionDefinitions(input3)); } catch (IOException e) { fail(e.getMessage()); diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/bar/jackson/AllTests.java b/src/test/java/io/personium/test/unit/core/bar/jackson/AllTests.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/unit/core/bar/jackson/AllTests.java rename to src/test/java/io/personium/test/unit/core/bar/jackson/AllTests.java index c353ba895..e3274e8bd 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/bar/jackson/AllTests.java +++ b/src/test/java/io/personium/test/unit/core/bar/jackson/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.bar.jackson; +package io.personium.test.unit.core.bar.jackson; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/bar/jackson/JSONManifestTest.java b/src/test/java/io/personium/test/unit/core/bar/jackson/JSONManifestTest.java similarity index 96% rename from src/test/java/com/fujitsu/dc/test/unit/core/bar/jackson/JSONManifestTest.java rename to src/test/java/io/personium/test/unit/core/bar/jackson/JSONManifestTest.java index 1e2d9a237..fc6927421 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/bar/jackson/JSONManifestTest.java +++ b/src/test/java/io/personium/test/unit/core/bar/jackson/JSONManifestTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.bar.jackson; +package io.personium.test.unit.core.bar.jackson; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -28,8 +28,8 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.core.bar.jackson.JSONManifest; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.core.bar.jackson.JSONManifest; +import io.personium.test.categories.Unit; /** * BarFileのバリデートのユニットテストクラス. diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/event/AllTests.java b/src/test/java/io/personium/test/unit/core/event/AllTests.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/unit/core/event/AllTests.java rename to src/test/java/io/personium/test/unit/core/event/AllTests.java index d0a66694c..7d929f2a9 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/event/AllTests.java +++ b/src/test/java/io/personium/test/unit/core/event/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.event; +package io.personium.test.unit.core.event; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/event/EventLoggerTest.java b/src/test/java/io/personium/test/unit/core/event/EventLoggerTest.java similarity index 82% rename from src/test/java/com/fujitsu/dc/test/unit/core/event/EventLoggerTest.java rename to src/test/java/io/personium/test/unit/core/event/EventLoggerTest.java index 253ea957a..fb63f46f8 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/event/EventLoggerTest.java +++ b/src/test/java/io/personium/test/unit/core/event/EventLoggerTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.event; +package io.personium.test.unit.core.event; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -26,10 +26,10 @@ import org.slf4j.Logger; import org.slf4j.Marker; -import com.fujitsu.dc.core.event.DcEvent; -import com.fujitsu.dc.core.event.EventLogger; -import com.fujitsu.dc.core.model.impl.es.CellEsImpl; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.core.event.PersoniumEvent; +import io.personium.core.event.EventLogger; +import io.personium.core.model.impl.es.CellEsImpl; +import io.personium.test.categories.Unit; /** * EventLogger ユニットテストクラス. @@ -129,7 +129,7 @@ public boolean isInfoEnabled() { } @Override public void info(String msg) { - this.loggedLevel = DcEvent.Level.INFO; + this.loggedLevel = PersoniumEvent.Level.INFO; } @Override public void info(String format, Object arg) { @@ -168,7 +168,7 @@ public boolean isWarnEnabled() { } @Override public void warn(String msg) { - this.loggedLevel = DcEvent.Level.WARN; + this.loggedLevel = PersoniumEvent.Level.WARN; } @Override public void warn(String format, Object arg) { @@ -207,7 +207,7 @@ public boolean isErrorEnabled() { } @Override public void error(String msg) { - this.loggedLevel = DcEvent.Level.ERROR; + this.loggedLevel = PersoniumEvent.Level.ERROR; } @Override public void error(String format, Object arg) { @@ -259,16 +259,16 @@ public int getLoggedLevel() { defaultLogger = (Logger) baseDir.get(null); LoggerForEvent testLogger = new LoggerForEvent(); baseDir.set(null, testLogger); - EventLogger evLogger = new EventLogger(new CellEsImpl(), DcEvent.Level.INFO); - assertEquals(DcEvent.Level.INFO, evLogger.getLogLevel()); - evLogger.log(new DcEvent("", "", DcEvent.Level.ERROR, "", "", "", "")); - assertEquals(DcEvent.Level.ERROR, testLogger.getLoggedLevel()); - evLogger.log(new DcEvent("", "", DcEvent.Level.WARN, "", "", "", "")); - assertEquals(DcEvent.Level.WARN, testLogger.getLoggedLevel()); - evLogger.log(new DcEvent("", "", DcEvent.Level.INFO, "", "", "", "")); - assertEquals(DcEvent.Level.INFO, testLogger.getLoggedLevel()); - evLogger.setLogLevel(DcEvent.Level.ERROR); - assertEquals(DcEvent.Level.ERROR, evLogger.getLogLevel()); + EventLogger evLogger = new EventLogger(new CellEsImpl(), PersoniumEvent.Level.INFO); + assertEquals(PersoniumEvent.Level.INFO, evLogger.getLogLevel()); + evLogger.log(new PersoniumEvent("", "", PersoniumEvent.Level.ERROR, "", "", "", "")); + assertEquals(PersoniumEvent.Level.ERROR, testLogger.getLoggedLevel()); + evLogger.log(new PersoniumEvent("", "", PersoniumEvent.Level.WARN, "", "", "", "")); + assertEquals(PersoniumEvent.Level.WARN, testLogger.getLoggedLevel()); + evLogger.log(new PersoniumEvent("", "", PersoniumEvent.Level.INFO, "", "", "", "")); + assertEquals(PersoniumEvent.Level.INFO, testLogger.getLoggedLevel()); + evLogger.setLogLevel(PersoniumEvent.Level.ERROR); + assertEquals(PersoniumEvent.Level.ERROR, evLogger.getLogLevel()); } catch (Exception e) { e.printStackTrace(); fail(e.getMessage()); @@ -291,9 +291,9 @@ public int getLoggedLevel() { */ @Test public void イベントロガーのログ出力可能レベルが変更できること() { - EventLogger evLogger = new EventLogger(new CellEsImpl(), DcEvent.Level.INFO); - assertEquals(DcEvent.Level.INFO, evLogger.getLogLevel()); - evLogger.setLogLevel(DcEvent.Level.ERROR); - assertEquals(DcEvent.Level.ERROR, evLogger.getLogLevel()); + EventLogger evLogger = new EventLogger(new CellEsImpl(), PersoniumEvent.Level.INFO); + assertEquals(PersoniumEvent.Level.INFO, evLogger.getLogLevel()); + evLogger.setLogLevel(PersoniumEvent.Level.ERROR); + assertEquals(PersoniumEvent.Level.ERROR, evLogger.getLogLevel()); } } diff --git a/src/test/java/io/personium/test/unit/core/event/package-info.java b/src/test/java/io/personium/test/unit/core/event/package-info.java new file mode 100644 index 000000000..e417d6694 --- /dev/null +++ b/src/test/java/io/personium/test/unit/core/event/package-info.java @@ -0,0 +1,21 @@ +/** + * personium.io + * Copyright 2014 FUJITSU LIMITED + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * JUnit test. + */ +package io.personium.test.unit.core.event; + diff --git a/src/test/java/io/personium/test/unit/core/exceptions/package-info.java b/src/test/java/io/personium/test/unit/core/exceptions/package-info.java new file mode 100644 index 000000000..ee0c6f33e --- /dev/null +++ b/src/test/java/io/personium/test/unit/core/exceptions/package-info.java @@ -0,0 +1,21 @@ +/** + * personium.io + * Copyright 2014 FUJITSU LIMITED + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * JUnit test. + */ +package io.personium.test.unit.core.exceptions; + diff --git a/src/test/java/com/fujitsu/dc/core/AllTests.java b/src/test/java/io/personium/test/unit/core/jersey/filter/AllTests.java similarity index 87% rename from src/test/java/com/fujitsu/dc/core/AllTests.java rename to src/test/java/io/personium/test/unit/core/jersey/filter/AllTests.java index c3986f810..5b49751b5 100644 --- a/src/test/java/com/fujitsu/dc/core/AllTests.java +++ b/src/test/java/io/personium/test/unit/core/jersey/filter/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.core; +package io.personium.test.unit.core.jersey.filter; import org.junit.runner.RunWith; import org.junit.runners.Suite; @@ -25,8 +25,7 @@ */ @RunWith(Suite.class) @SuiteClasses({ - DcCoreExceptionTest.class, - DcCoreLogTest.class + PersoniumCoreContainerFilterTest.class }) public class AllTests { } diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/jersey/filter/DcCoreContainerFilterTest.java b/src/test/java/io/personium/test/unit/core/jersey/filter/PersoniumCoreContainerFilterTest.java similarity index 82% rename from src/test/java/com/fujitsu/dc/test/unit/core/jersey/filter/DcCoreContainerFilterTest.java rename to src/test/java/io/personium/test/unit/core/jersey/filter/PersoniumCoreContainerFilterTest.java index a536f0ca3..f0521d558 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/jersey/filter/DcCoreContainerFilterTest.java +++ b/src/test/java/io/personium/test/unit/core/jersey/filter/PersoniumCoreContainerFilterTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.jersey.filter; +package io.personium.test.unit.core.jersey.filter; import static org.junit.Assert.assertNotNull; import static org.mockito.Mockito.mock; @@ -34,9 +34,9 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.jersey.filter.PersoniumCoreContainerFilter; +import io.personium.test.categories.Unit; import com.sun.jersey.core.header.InBoundHeaders; import com.sun.jersey.spi.container.ContainerRequest; import com.sun.jersey.spi.container.ContainerResponse; @@ -44,10 +44,10 @@ /** - * DcCoreContainerFilterユニットテストクラス. + * PersoniumCoreContainerFilterユニットテストクラス. */ @Category({ Unit.class }) -public class DcCoreContainerFilterTest { +public class PersoniumCoreContainerFilterTest { /** * リクエストフィルタとしてメソッド/ヘッダオーバライドを実施していることを確認. * X-FORWARDED-PROTO、X-FORWARDED-HOSTヘッダでリクエストUri, Base UriのPROTO, HOST部が書き換わることを確認。 @@ -56,26 +56,26 @@ public class DcCoreContainerFilterTest { @Test public void testFilterContainerRequest() throws URISyntaxException { // 被テストオブジェクトを準備 - DcCoreContainerFilter containerFilter = new DcCoreContainerFilter(); + PersoniumCoreContainerFilter containerFilter = new PersoniumCoreContainerFilter(); // ContainerRequiestを準備 WebApplication wa = mock(WebApplication.class); InBoundHeaders headers = new InBoundHeaders(); // メソッドオーバーライド - headers.add(DcCoreUtils.HttpHeaders.X_HTTP_METHOD_OVERRIDE, HttpMethod.OPTIONS); + headers.add(PersoniumCoreUtils.HttpHeaders.X_HTTP_METHOD_OVERRIDE, HttpMethod.OPTIONS); // ヘッダオーバーライド String authzValue = "Bearer tokenstring"; String acceptValue = "text/html"; String contentTypeValue = "application/xml"; - headers.add(DcCoreUtils.HttpHeaders.X_OVERRIDE, HttpHeaders.AUTHORIZATION + ": " + authzValue); + headers.add(PersoniumCoreUtils.HttpHeaders.X_OVERRIDE, HttpHeaders.AUTHORIZATION + ": " + authzValue); headers.add(HttpHeaders.ACCEPT, contentTypeValue); - headers.add(DcCoreUtils.HttpHeaders.X_OVERRIDE, HttpHeaders.ACCEPT + ": " + acceptValue); + headers.add(PersoniumCoreUtils.HttpHeaders.X_OVERRIDE, HttpHeaders.ACCEPT + ": " + acceptValue); headers.add(HttpHeaders.CONTENT_TYPE, contentTypeValue); // X-FORWARDED-* 系のヘッダ設定 String scheme = "https"; String host = "example.org"; - headers.add(DcCoreUtils.HttpHeaders.X_FORWARDED_PROTO, scheme); - headers.add(DcCoreUtils.HttpHeaders.X_FORWARDED_HOST, host); + headers.add(PersoniumCoreUtils.HttpHeaders.X_FORWARDED_PROTO, scheme); + headers.add(PersoniumCoreUtils.HttpHeaders.X_FORWARDED_HOST, host); ContainerRequest request = new ContainerRequest(wa, HttpMethod.POST, new URI("http://dc1.example.com/hoge"), @@ -112,7 +112,7 @@ public void testFilterContainerRequest() throws URISyntaxException { @Test public void testFilterContainerRequestContainerResponse() { // 被テストオブジェクトを準備 - DcCoreContainerFilter containerFilter = new DcCoreContainerFilter(); + PersoniumCoreContainerFilter containerFilter = new PersoniumCoreContainerFilter(); // ContainerRequiestモックを準備 ContainerRequest mockRequest = mock(ContainerRequest.class); HttpServletRequest mockServletRequest = mock(HttpServletRequest.class); diff --git a/src/test/java/io/personium/test/unit/core/jersey/filter/package-info.java b/src/test/java/io/personium/test/unit/core/jersey/filter/package-info.java new file mode 100644 index 000000000..3408fdfed --- /dev/null +++ b/src/test/java/io/personium/test/unit/core/jersey/filter/package-info.java @@ -0,0 +1,21 @@ +/** + * personium.io + * Copyright 2014 FUJITSU LIMITED + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * JUnit test. + */ +package io.personium.test.unit.core.jersey.filter; + diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/AllTests.java b/src/test/java/io/personium/test/unit/core/model/AllTests.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/unit/core/model/AllTests.java rename to src/test/java/io/personium/test/unit/core/model/AllTests.java index d77ea965e..79886fae7 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/AllTests.java +++ b/src/test/java/io/personium/test/unit/core/model/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.model; +package io.personium.test.unit.core.model; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/ModelFactoryTest.java b/src/test/java/io/personium/test/unit/core/model/ModelFactoryTest.java similarity index 85% rename from src/test/java/com/fujitsu/dc/test/unit/core/model/ModelFactoryTest.java rename to src/test/java/io/personium/test/unit/core/model/ModelFactoryTest.java index b16874222..10bb4dcb7 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/ModelFactoryTest.java +++ b/src/test/java/io/personium/test/unit/core/model/ModelFactoryTest.java @@ -14,15 +14,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.model; +package io.personium.test.unit.core.model; import static org.junit.Assert.assertNotNull; import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.core.model.ModelFactory; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.core.model.ModelFactory; +import io.personium.test.categories.Unit; /** * ModelFactory ユニットテストクラス. diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/AllTests.java b/src/test/java/io/personium/test/unit/core/model/impl/es/AllTests.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/AllTests.java rename to src/test/java/io/personium/test/unit/core/model/impl/es/AllTests.java index bd16d4150..c239499f6 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/AllTests.java +++ b/src/test/java/io/personium/test/unit/core/model/impl/es/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.model.impl.es; +package io.personium.test.unit.core.model.impl.es; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/CellEsImplTest.java b/src/test/java/io/personium/test/unit/core/model/impl/es/CellEsImplTest.java similarity index 95% rename from src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/CellEsImplTest.java rename to src/test/java/io/personium/test/unit/core/model/impl/es/CellEsImplTest.java index 33fdbfb88..2e28a07fe 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/CellEsImplTest.java +++ b/src/test/java/io/personium/test/unit/core/model/impl/es/CellEsImplTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.model.impl.es; +package io.personium.test.unit.core.model.impl.es; import static org.junit.Assert.assertNull; @@ -23,8 +23,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.core.model.impl.es.CellEsImpl; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.core.model.impl.es.CellEsImpl; +import io.personium.test.categories.Unit; /** * Unit Test class for CellEsImpl. diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/EsModelTest.java b/src/test/java/io/personium/test/unit/core/model/impl/es/EsModelTest.java similarity index 80% rename from src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/EsModelTest.java rename to src/test/java/io/personium/test/unit/core/model/impl/es/EsModelTest.java index 9d1968252..bfdf0b3ee 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/EsModelTest.java +++ b/src/test/java/io/personium/test/unit/core/model/impl/es/EsModelTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.model.impl.es; +package io.personium.test.unit.core.model.impl.es; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -32,14 +32,14 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.core.model.impl.es.EsModel; -import com.fujitsu.dc.common.es.EsIndex; -import com.fujitsu.dc.common.es.EsType; -import com.fujitsu.dc.common.es.response.DcDeleteResponse; -import com.fujitsu.dc.common.es.response.DcGetResponse; -import com.fujitsu.dc.common.es.response.DcIndexResponse; -import com.fujitsu.dc.common.es.response.DcSearchResponse; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.core.model.impl.es.EsModel; +import io.personium.common.es.EsIndex; +import io.personium.common.es.EsType; +import io.personium.common.es.response.PersoniumDeleteResponse; +import io.personium.common.es.response.PersoniumGetResponse; +import io.personium.common.es.response.PersoniumIndexResponse; +import io.personium.common.es.response.PersoniumSearchResponse; +import io.personium.test.categories.Unit; /** * EsModelユニットテストクラス. @@ -63,7 +63,7 @@ public class EsModelTest { EsType typ = EsModel.type(idx.getName(), "tType2", null, 0, 0); // いきなりドキュメントを取得しようとするとFALSEになるテスト - DcGetResponse getResp1 = typ.get("doc4"); + PersoniumGetResponse getResp1 = typ.get("doc4"); assertNull(getResp1); // いきなりドキュメントを検索しようとすると0件になるテスト @@ -73,7 +73,7 @@ public class EsModelTest { query3.put("key1", "value1"); query2.put("term", query3); query.put("query", query2); - DcSearchResponse searchResp = typ.search(query); + PersoniumSearchResponse searchResp = typ.search(query); log.debug("search performed.. "); assertNull(searchResp); @@ -81,7 +81,7 @@ public class EsModelTest { JSONObject json = new JSONObject(); json.put("key1", "value1"); json.put("key2", "value2"); - DcIndexResponse res = typ.create("doc5", json); + PersoniumIndexResponse res = typ.create("doc5", json); // String id = typ.post(json); String id = res.getId(); @@ -91,7 +91,7 @@ public class EsModelTest { // ドキュメント登録したものを // 一件取得 - DcGetResponse getResp = typ.get(id); + PersoniumGetResponse getResp = typ.get(id); log.debug("doc [" + id + "] retrieved.. "); log.debug(getResp.sourceAsString()); assertTrue(getResp.exists()); @@ -111,7 +111,7 @@ public class EsModelTest { // 消す - DcDeleteResponse delResp = typ.delete(id); + PersoniumDeleteResponse delResp = typ.delete(id); assertFalse(delResp.isNotFound()); if (delResp.isNotFound()) { log.debug(" doc [" + id + "] not found.. "); diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/doc/AllTests.java b/src/test/java/io/personium/test/unit/core/model/impl/es/doc/AllTests.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/doc/AllTests.java rename to src/test/java/io/personium/test/unit/core/model/impl/es/doc/AllTests.java index 4974d400b..84ade6f41 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/doc/AllTests.java +++ b/src/test/java/io/personium/test/unit/core/model/impl/es/doc/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.model.impl.es.doc; +package io.personium.test.unit.core.model.impl.es.doc; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/doc/OEntityDocHandlerTest.java b/src/test/java/io/personium/test/unit/core/model/impl/es/doc/OEntityDocHandlerTest.java similarity index 87% rename from src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/doc/OEntityDocHandlerTest.java rename to src/test/java/io/personium/test/unit/core/model/impl/es/doc/OEntityDocHandlerTest.java index 7b13be7a4..1946df1dc 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/doc/OEntityDocHandlerTest.java +++ b/src/test/java/io/personium/test/unit/core/model/impl/es/doc/OEntityDocHandlerTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.model.impl.es.doc; +package io.personium.test.unit.core.model.impl.es.doc; import static org.junit.Assert.assertEquals; @@ -28,12 +28,12 @@ import org.odata4j.edm.EdmDataServices; import org.odata4j.edm.EdmEntitySet; -import com.fujitsu.dc.common.es.response.DcGetResponse; -import com.fujitsu.dc.common.es.response.DcSearchHit; -import com.fujitsu.dc.core.model.ctl.CtlSchema; -import com.fujitsu.dc.core.model.impl.es.doc.OEntityDocHandler; -import com.fujitsu.dc.core.odata.OEntityWrapper; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.common.es.response.PersoniumGetResponse; +import io.personium.common.es.response.PersoniumSearchHit; +import io.personium.core.model.ctl.CtlSchema; +import io.personium.core.model.impl.es.doc.OEntityDocHandler; +import io.personium.core.odata.OEntityWrapper; +import io.personium.test.categories.Unit; /** * OEntityDocHandlerのユニットテスト. @@ -59,7 +59,7 @@ public void testOEntityDocHandlerGetResponse() { Map src = this.createMockSrc(); // Mockの作成 - DcGetResponse gRes = Mockito.mock(DcGetResponse.class); + PersoniumGetResponse gRes = Mockito.mock(PersoniumGetResponse.class); Mockito.when(gRes.id()).thenReturn(ID_0); Mockito.when(gRes.getId()).thenReturn(ID_0); Mockito.when(gRes.version()).thenReturn(VERSION_0); @@ -81,7 +81,7 @@ public void testOEntityDocHandlerSearchHit() { Map src = this.createMockSrc(); // Mockの作成 - DcSearchHit hit = Mockito.mock(DcSearchHit.class); + PersoniumSearchHit hit = Mockito.mock(PersoniumSearchHit.class); Mockito.when(hit.id()).thenReturn(ID_0); Mockito.when(hit.getId()).thenReturn(ID_0); Mockito.when(hit.version()).thenReturn(VERSION_0); @@ -121,7 +121,7 @@ OEntityDocHandler createTestHandler() { Map src = this.createMockSrc(); // Mockの作成 - DcGetResponse gRes = Mockito.mock(DcGetResponse.class); + PersoniumGetResponse gRes = Mockito.mock(PersoniumGetResponse.class); Mockito.when(gRes.id()).thenReturn(ID_0); Mockito.when(gRes.getId()).thenReturn(ID_0); Mockito.when(gRes.version()).thenReturn(VERSION_0); diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/doc/PropertyAliasTest.java b/src/test/java/io/personium/test/unit/core/model/impl/es/doc/PropertyAliasTest.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/doc/PropertyAliasTest.java rename to src/test/java/io/personium/test/unit/core/model/impl/es/doc/PropertyAliasTest.java index df697f3d4..7559b9421 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/doc/PropertyAliasTest.java +++ b/src/test/java/io/personium/test/unit/core/model/impl/es/doc/PropertyAliasTest.java @@ -14,15 +14,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.model.impl.es.doc; +package io.personium.test.unit.core.model.impl.es.doc; import static org.junit.Assert.assertEquals; import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.core.model.impl.es.odata.PropertyAlias; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.core.model.impl.es.odata.PropertyAlias; +import io.personium.test.categories.Unit; /** * OEntityDocHandlerのユニットテスト. diff --git a/src/test/java/io/personium/test/unit/core/model/impl/es/doc/package-info.java b/src/test/java/io/personium/test/unit/core/model/impl/es/doc/package-info.java new file mode 100644 index 000000000..84459ac3e --- /dev/null +++ b/src/test/java/io/personium/test/unit/core/model/impl/es/doc/package-info.java @@ -0,0 +1,21 @@ +/** + * personium.io + * Copyright 2014 FUJITSU LIMITED + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * JUnit test. + */ +package io.personium.test.unit.core.model.impl.es.doc; + diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/odata/AllTests.java b/src/test/java/io/personium/test/unit/core/model/impl/es/odata/AllTests.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/odata/AllTests.java rename to src/test/java/io/personium/test/unit/core/model/impl/es/odata/AllTests.java index 80c96d68e..aadbebe6e 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/odata/AllTests.java +++ b/src/test/java/io/personium/test/unit/core/model/impl/es/odata/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.model.impl.es.odata; +package io.personium.test.unit.core.model.impl.es.odata; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/odata/CellCtlODataProducerTest.java b/src/test/java/io/personium/test/unit/core/model/impl/es/odata/CellCtlODataProducerTest.java similarity index 89% rename from src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/odata/CellCtlODataProducerTest.java rename to src/test/java/io/personium/test/unit/core/model/impl/es/odata/CellCtlODataProducerTest.java index 1056cfdc1..d31a0899c 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/odata/CellCtlODataProducerTest.java +++ b/src/test/java/io/personium/test/unit/core/model/impl/es/odata/CellCtlODataProducerTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.model.impl.es.odata; +package io.personium.test.unit.core.model.impl.es.odata; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -29,14 +29,14 @@ import org.odata4j.core.OEntityKey; import org.odata4j.edm.EdmEntitySet; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.ctl.ReceivedMessagePort; -import com.fujitsu.dc.core.model.impl.es.CellEsImpl; -import com.fujitsu.dc.core.model.impl.es.doc.EntitySetDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.OEntityDocHandler; -import com.fujitsu.dc.core.model.impl.es.odata.CellCtlODataProducer; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.Cell; +import io.personium.core.model.ctl.ReceivedMessagePort; +import io.personium.core.model.impl.es.CellEsImpl; +import io.personium.core.model.impl.es.doc.EntitySetDocHandler; +import io.personium.core.model.impl.es.doc.OEntityDocHandler; +import io.personium.core.model.impl.es.odata.CellCtlODataProducer; +import io.personium.test.categories.Unit; /** * UnitCtlODataProducerユニットテストクラス. @@ -395,9 +395,9 @@ protected EntitySetDocHandler retrieveWithKey(EdmEntitySet entitySet, OEntityKey public void extCellの存在確認でOEntityKeyのパースに失敗した場合はREQUEST_RELATION_TARGET_PARSE_ERRORが発生すること() { try { getExtCell("https://example.com/'/"); - fail("DcCoreException.ReceiveMessage.REQUEST_RELATION_TARGET_PARSE_ERROR does not occurred."); - } catch (DcCoreException e) { - DcCoreException expected = DcCoreException.ReceiveMessage.REQUEST_RELATION_TARGET_PARSE_ERROR; + fail("PersoniumCoreException.ReceiveMessage.REQUEST_RELATION_TARGET_PARSE_ERROR does not occurred."); + } catch (PersoniumCoreException e) { + PersoniumCoreException expected = PersoniumCoreException.ReceiveMessage.REQUEST_RELATION_TARGET_PARSE_ERROR; assertEquals(expected.getCode(), e.getCode()); assertEquals(expected.getMessage(), e.getMessage()); } @@ -415,9 +415,9 @@ protected EntitySetDocHandler retrieveWithKey(EdmEntitySet entitySet, OEntityKey docHandler.setStaticFields(staticFields); try { breakRelation(docHandler); - fail("DcCoreException.ReceiveMessage.REQUEST_RELATION_PARSE_ERROR does not occurred."); - } catch (DcCoreException e) { - DcCoreException expected = DcCoreException.ReceiveMessage.REQUEST_RELATION_PARSE_ERROR; + fail("PersoniumCoreException.ReceiveMessage.REQUEST_RELATION_PARSE_ERROR does not occurred."); + } catch (PersoniumCoreException e) { + PersoniumCoreException expected = PersoniumCoreException.ReceiveMessage.REQUEST_RELATION_PARSE_ERROR; assertEquals(expected.getCode(), e.getCode()); assertEquals(expected.getMessage(), e.getMessage()); } @@ -437,9 +437,9 @@ protected EntitySetDocHandler retrieveWithKey(EdmEntitySet entitySet, OEntityKey CellCtlODataProducerMock mock = new CellCtlODataProducerMock(); mock.setGetRelationNullFlag(true); mock.breakRelationMock(docHandler); - fail("DcCoreException.ReceiveMessage.REQUEST_RELATION_DOES_NOT_EXISTS does not occurred."); - } catch (DcCoreException e) { - DcCoreException expected = DcCoreException.ReceiveMessage.REQUEST_RELATION_DOES_NOT_EXISTS + fail("PersoniumCoreException.ReceiveMessage.REQUEST_RELATION_DOES_NOT_EXISTS does not occurred."); + } catch (PersoniumCoreException e) { + PersoniumCoreException expected = PersoniumCoreException.ReceiveMessage.REQUEST_RELATION_DOES_NOT_EXISTS .params("+:me"); assertEquals(expected.getCode(), e.getCode()); assertEquals(expected.getMessage(), e.getMessage()); @@ -462,9 +462,9 @@ protected EntitySetDocHandler retrieveWithKey(EdmEntitySet entitySet, OEntityKey CellCtlODataProducerMock mock = new CellCtlODataProducerMock(); mock.setGetExtCellNullFlag(true); mock.breakRelationMock(docHandler); - fail("DcCoreException.ReceiveMessage.REQUEST_RELATION_TARGET_DOES_NOT_EXISTS does not occurred."); - } catch (DcCoreException e) { - DcCoreException expected = DcCoreException.ReceiveMessage.REQUEST_RELATION_TARGET_DOES_NOT_EXISTS + fail("PersoniumCoreException.ReceiveMessage.REQUEST_RELATION_TARGET_DOES_NOT_EXISTS does not occurred."); + } catch (PersoniumCoreException e) { + PersoniumCoreException expected = PersoniumCoreException.ReceiveMessage.REQUEST_RELATION_TARGET_DOES_NOT_EXISTS .params("https://example.com/test0110/"); assertEquals(expected.getCode(), e.getCode()); assertEquals(expected.getMessage(), e.getMessage()); @@ -486,9 +486,9 @@ protected EntitySetDocHandler retrieveWithKey(EdmEntitySet entitySet, OEntityKey try { CellCtlODataProducerMock mock = new CellCtlODataProducerMock(); mock.breakRelationMock(docHandler); - fail("DcCoreException.ReceiveMessage.LINK_DOES_NOT_EXISTS does not occurred."); - } catch (DcCoreException e) { - DcCoreException expected = DcCoreException.ReceiveMessage.LINK_DOES_NOT_EXISTS + fail("PersoniumCoreException.ReceiveMessage.LINK_DOES_NOT_EXISTS does not occurred."); + } catch (PersoniumCoreException e) { + PersoniumCoreException expected = PersoniumCoreException.ReceiveMessage.LINK_DOES_NOT_EXISTS .params("+:me", "https://example.com/test0110/"); assertEquals(expected.getCode(), e.getCode()); assertEquals(expected.getMessage(), e.getMessage()); diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/odata/EsQueryHandlerTest.java b/src/test/java/io/personium/test/unit/core/model/impl/es/odata/EsQueryHandlerTest.java similarity index 87% rename from src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/odata/EsQueryHandlerTest.java rename to src/test/java/io/personium/test/unit/core/model/impl/es/odata/EsQueryHandlerTest.java index 71b4279fc..a8cc17b64 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/odata/EsQueryHandlerTest.java +++ b/src/test/java/io/personium/test/unit/core/model/impl/es/odata/EsQueryHandlerTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.model.impl.es.odata; +package io.personium.test.unit.core.model.impl.es.odata; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -36,10 +36,10 @@ import org.odata4j.expression.ExpressionParser; import org.odata4j.producer.QueryInfo; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.impl.es.odata.EsQueryHandler; -import com.fujitsu.dc.core.odata.DcOptionsQueryParser; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.impl.es.odata.EsQueryHandler; +import io.personium.core.odata.PersoniumOptionsQueryParser; +import io.personium.test.categories.Unit; /** * EsQueryHandlerユニットテストクラス. @@ -67,7 +67,7 @@ public class EsQueryHandlerTest { @Test public void スキーマ定義上の項目を完全一致クエリを指定してelasitcsearch用のクエリに変換可能であること() { String filterStr = "item eq 'itemValue'"; - BoolCommonExpression filterExp = DcOptionsQueryParser.parseFilter(filterStr); + BoolCommonExpression filterExp = PersoniumOptionsQueryParser.parseFilter(filterStr); // ESQueryHandlerでVisitする QueryInfo queryInfo = new QueryInfo(null, null, null, filterExp, null, null, null, null, null); @@ -100,7 +100,7 @@ public class EsQueryHandlerTest { @Test public void スキーマ定義外の完全一致クエリを指定してelasitcsearch用のクエリに変換可能であること() { String filterStr = "itemKey eq 'itemValue'"; - BoolCommonExpression filterExp = DcOptionsQueryParser.parseFilter(filterStr); + BoolCommonExpression filterExp = PersoniumOptionsQueryParser.parseFilter(filterStr); // ESQueryHandlerでVisitする QueryInfo queryInfo = new QueryInfo(null, null, null, filterExp, null, null, null, null, null); @@ -129,21 +129,21 @@ public class EsQueryHandlerTest { } /** - * 完全一致クエリの検索語をシングルクオート無しで指定してDcCoreExceptionが発生すること. + * 完全一致クエリの検索語をシングルクオート無しで指定してPersoniumCoreExceptionが発生すること. */ @Test - public void 完全一致クエリの検索語をシングルクオート無しで指定してDcCoreExceptionが発生すること() { + public void 完全一致クエリの検索語をシングルクオート無しで指定してPersoniumCoreExceptionが発生すること() { String filterStr = "itemKey eq itemValue"; - BoolCommonExpression filterExp = DcOptionsQueryParser.parseFilter(filterStr); + BoolCommonExpression filterExp = PersoniumOptionsQueryParser.parseFilter(filterStr); // ESQueryHandlerでVisitする EsQueryHandler esQueryHandler = new EsQueryHandler(entityType); try { filterExp.visit(esQueryHandler); fail("Not Throw Exception."); - } catch (DcCoreException e) { - assertEquals(DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), e.getCode()); - String message = DcCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("itemKey").getMessage(); + } catch (PersoniumCoreException e) { + assertEquals(PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.getCode(), e.getCode()); + String message = PersoniumCoreException.OData.OPERATOR_AND_OPERAND_TYPE_MISMATCHED.params("itemKey").getMessage(); assertEquals(message, e.getMessage()); } catch (Exception e) { fail(e.getMessage()); @@ -156,7 +156,7 @@ public class EsQueryHandlerTest { @Test public void andクエリを指定してelasitcsearch用のクエリに変換可能であること() { String filterStr = "itemKey eq 'itemValue' and itemKey2 eq 'itemValue2'"; - BoolCommonExpression filterExp = DcOptionsQueryParser.parseFilter(filterStr); + BoolCommonExpression filterExp = PersoniumOptionsQueryParser.parseFilter(filterStr); // ESQueryHandlerでVisitする QueryInfo queryInfo = new QueryInfo(null, null, null, filterExp, null, null, null, null, null); @@ -203,7 +203,7 @@ public class EsQueryHandlerTest { @Test public void andクエリを複数指定してelasitcsearch用のクエリに変換可能であること() { String filterStr = "itemKey eq 'itemValue' and itemKey2 eq 'itemValue2' and itemKey3 eq 'itemValue3'"; - BoolCommonExpression filterExp = DcOptionsQueryParser.parseFilter(filterStr); + BoolCommonExpression filterExp = PersoniumOptionsQueryParser.parseFilter(filterStr); // ESQueryHandlerでVisitする QueryInfo queryInfo = new QueryInfo(null, null, null, filterExp, null, null, null, null, null); @@ -262,7 +262,7 @@ public class EsQueryHandlerTest { @Test public void orクエリを指定してelasitcsearch用のクエリに変換可能であること() { String filterStr = "itemKey eq 'itemValue' or itemKey2 eq 'itemValue2'"; - BoolCommonExpression filterExp = DcOptionsQueryParser.parseFilter(filterStr); + BoolCommonExpression filterExp = PersoniumOptionsQueryParser.parseFilter(filterStr); // ESQueryHandlerでVisitする QueryInfo queryInfo = new QueryInfo(null, null, null, filterExp, null, null, null, null, null); @@ -309,7 +309,7 @@ public class EsQueryHandlerTest { @Test public void orクエリを複数指定してelasitcsearch用のクエリに変換可能であること() { String filterStr = "itemKey eq 'itemValue' or itemKey2 eq 'itemValue2' or itemKey3 eq 'itemValue3'"; - BoolCommonExpression filterExp = DcOptionsQueryParser.parseFilter(filterStr); + BoolCommonExpression filterExp = PersoniumOptionsQueryParser.parseFilter(filterStr); // ESQueryHandlerでVisitする QueryInfo queryInfo = new QueryInfo(null, null, null, filterExp, null, null, null, null, null); @@ -368,7 +368,7 @@ public class EsQueryHandlerTest { @Test public void 部分一致クエリを指定してelasitcsearch用のクエリに変換可能であること() { String filterStr = "substringof('itemValue', itemKey)"; - BoolCommonExpression filterExp = DcOptionsQueryParser.parseFilter(filterStr); + BoolCommonExpression filterExp = PersoniumOptionsQueryParser.parseFilter(filterStr); // ESQueryHandlerでVisitする QueryInfo queryInfo = new QueryInfo(null, null, null, filterExp, null, null, null, null, null); @@ -411,7 +411,7 @@ public class EsQueryHandlerTest { public void 括弧検索クエリを指定してelasitcsearch用のクエリに変換可能であること() { String filterStr = "itemKey eq 'itemValue' and (itemKey2 eq 'itemValue2' or itemKey3 eq 'itemValue3')"; - BoolCommonExpression filterExp = DcOptionsQueryParser.parseFilter(filterStr); + BoolCommonExpression filterExp = PersoniumOptionsQueryParser.parseFilter(filterStr); // ESQueryHandlerでVisitする QueryInfo queryInfo = new QueryInfo(null, null, null, filterExp, null, null, null, null, null); @@ -486,10 +486,10 @@ public class EsQueryHandlerTest { filterExp.visit(esQueryHandler); fail("Not Throw Exception, operator = " + operator); } catch (Exception e) { - String code = DcCoreException.OData.UNSUPPORTED_QUERY_OPERATOR.params(operator).getCode(); - String message = DcCoreException.OData.UNSUPPORTED_QUERY_OPERATOR.params(operator).getMessage(); - assertEquals(code, ((DcCoreException) e).getCode()); - assertEquals(message, ((DcCoreException) e).getMessage()); + String code = PersoniumCoreException.OData.UNSUPPORTED_QUERY_OPERATOR.params(operator).getCode(); + String message = PersoniumCoreException.OData.UNSUPPORTED_QUERY_OPERATOR.params(operator).getMessage(); + assertEquals(code, ((PersoniumCoreException) e).getCode()); + assertEquals(message, ((PersoniumCoreException) e).getMessage()); } } } @@ -512,13 +512,13 @@ public class EsQueryHandlerTest { String operator = entry.getKey(); String filterExp = entry.getValue(); try { - DcOptionsQueryParser.parseFilter(filterExp); + PersoniumOptionsQueryParser.parseFilter(filterExp); fail("Not Throw Exception, operator = " + operator); } catch (Exception e) { - String code = DcCoreException.OData.UNSUPPORTED_QUERY_OPERATOR.getCode(); - String message = DcCoreException.OData.UNSUPPORTED_QUERY_OPERATOR.getMessage(); - assertEquals(code, ((DcCoreException) e).getCode()); - assertEquals(message, ((DcCoreException) e).getMessage()); + String code = PersoniumCoreException.OData.UNSUPPORTED_QUERY_OPERATOR.getCode(); + String message = PersoniumCoreException.OData.UNSUPPORTED_QUERY_OPERATOR.getMessage(); + assertEquals(code, ((PersoniumCoreException) e).getCode()); + assertEquals(message, ((PersoniumCoreException) e).getMessage()); } } } @@ -540,10 +540,10 @@ public class EsQueryHandlerTest { filterExp.visit(esQueryHandler); fail("Not Throw Exception, function = " + function); } catch (Exception e) { - String code = DcCoreException.OData.UNSUPPORTED_QUERY_FUNCTION.getCode(); - String message = DcCoreException.OData.UNSUPPORTED_QUERY_FUNCTION.getMessage(); - assertEquals(code, ((DcCoreException) e).getCode()); - assertEquals(message, ((DcCoreException) e).getMessage()); + String code = PersoniumCoreException.OData.UNSUPPORTED_QUERY_FUNCTION.getCode(); + String message = PersoniumCoreException.OData.UNSUPPORTED_QUERY_FUNCTION.getMessage(); + assertEquals(code, ((PersoniumCoreException) e).getCode()); + assertEquals(message, ((PersoniumCoreException) e).getMessage()); } } } @@ -578,13 +578,13 @@ public class EsQueryHandlerTest { String operator = entry.getKey(); String filterExp = entry.getValue(); try { - DcOptionsQueryParser.parseFilter(filterExp); + PersoniumOptionsQueryParser.parseFilter(filterExp); fail("Not Throw Exception, function = " + operator); } catch (Exception e) { - String code = DcCoreException.OData.UNSUPPORTED_QUERY_FUNCTION.getCode(); - String message = DcCoreException.OData.UNSUPPORTED_QUERY_FUNCTION.getMessage(); - assertEquals(code, ((DcCoreException) e).getCode()); - assertEquals(message, ((DcCoreException) e).getMessage()); + String code = PersoniumCoreException.OData.UNSUPPORTED_QUERY_FUNCTION.getCode(); + String message = PersoniumCoreException.OData.UNSUPPORTED_QUERY_FUNCTION.getMessage(); + assertEquals(code, ((PersoniumCoreException) e).getCode()); + assertEquals(message, ((PersoniumCoreException) e).getMessage()); } } } diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/odata/PropertyLimitCheckerTest.java b/src/test/java/io/personium/test/unit/core/model/impl/es/odata/PropertyLimitCheckerTest.java similarity index 97% rename from src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/odata/PropertyLimitCheckerTest.java rename to src/test/java/io/personium/test/unit/core/model/impl/es/odata/PropertyLimitCheckerTest.java index f0d38b765..2d5aeec79 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/odata/PropertyLimitCheckerTest.java +++ b/src/test/java/io/personium/test/unit/core/model/impl/es/odata/PropertyLimitCheckerTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.model.impl.es.odata; +package io.personium.test.unit.core.model.impl.es.odata; import static org.junit.Assert.assertEquals; @@ -34,13 +34,13 @@ import org.odata4j.edm.EdmSchema; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.model.ctl.ComplexType; -import com.fujitsu.dc.core.model.ctl.EntityType; -import com.fujitsu.dc.core.model.impl.es.doc.ComplexTypePropertyDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.PropertyDocHandler; -import com.fujitsu.dc.core.model.impl.es.odata.PropertyLimitChecker; -import com.fujitsu.dc.core.model.impl.es.odata.PropertyLimitChecker.CheckError; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.core.model.ctl.ComplexType; +import io.personium.core.model.ctl.EntityType; +import io.personium.core.model.impl.es.doc.ComplexTypePropertyDocHandler; +import io.personium.core.model.impl.es.doc.PropertyDocHandler; +import io.personium.core.model.impl.es.odata.PropertyLimitChecker; +import io.personium.core.model.impl.es.odata.PropertyLimitChecker.CheckError; +import io.personium.test.categories.Unit; /** * UnitCtlODataProducerユニットテストクラス. diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/odata/UnitCtlODataProducerTest.java b/src/test/java/io/personium/test/unit/core/model/impl/es/odata/UnitCtlODataProducerTest.java similarity index 66% rename from src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/odata/UnitCtlODataProducerTest.java rename to src/test/java/io/personium/test/unit/core/model/impl/es/odata/UnitCtlODataProducerTest.java index 77020e9b9..fe1096747 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/odata/UnitCtlODataProducerTest.java +++ b/src/test/java/io/personium/test/unit/core/model/impl/es/odata/UnitCtlODataProducerTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.model.impl.es.odata; +package io.personium.test.unit.core.model.impl.es.odata; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.fail; @@ -23,8 +23,8 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.core.model.impl.es.odata.UnitCtlODataProducer; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.core.model.impl.es.odata.UnitCtlODataProducer; +import io.personium.test.categories.Unit; /** * UnitCtlODataProducerユニットテストクラス. @@ -33,7 +33,7 @@ public class UnitCtlODataProducerTest { /** - * Test method for {@link com.fujitsu.dc.core.model.impl.es.odata.UnitCtlODataProducer#UnitCtlODataProducer()}. + * Test method for {@link io.personium.core.model.impl.es.odata.UnitCtlODataProducer#UnitCtlODataProducer()}. */ @Test @Ignore @@ -43,17 +43,17 @@ public void testUnitCtlODataProducer() { /** * Test method for - * {@link com.fujitsu.dc.core.model.impl.es.odata.UnitCtlODataProducer#getAccessorForEntitySet(java.lang.String)}. + * {@link io.personium.core.model.impl.es.odata.UnitCtlODataProducer#getAccessorForEntitySet(java.lang.String)}. */ @Test public void testGetAccessorForEntitySetString() { -// EsClient.setConnectionConfiguration(DcCoreConfig.getEsClusterName(), DcCoreConfig.getEsHosts()); +// EsClient.setConnectionConfiguration(PersoniumUnitConfig.getEsClusterName(), PersoniumUnitConfig.getEsHosts()); UnitCtlODataProducer producer = new UnitCtlODataProducer(null); assertNotNull(producer.getAccessorForEntitySet("Cell")); } /** - * Test method for {@link com.fujitsu.dc.core.model.impl.es.odata.UnitCtlODataProducer#getAccessorForLink()}. + * Test method for {@link io.personium.core.model.impl.es.odata.UnitCtlODataProducer#getAccessorForLink()}. */ @Test @Ignore @@ -62,7 +62,7 @@ public void testGetAccessorForLink() { } /** - * Test method for {@link com.fujitsu.dc.core.model.impl.es.odata.UnitCtlODataProducer#getAccessorForLog()}. + * Test method for {@link io.personium.core.model.impl.es.odata.UnitCtlODataProducer#getAccessorForLog()}. */ @Test @Ignore @@ -71,7 +71,7 @@ public void testGetAccessorForLog() { } /** - * Test method for {@link com.fujitsu.dc.core.model.impl.es.odata.UnitCtlODataProducer#getMetadata()}. + * Test method for {@link io.personium.core.model.impl.es.odata.UnitCtlODataProducer#getMetadata()}. */ @Test public void testGetMetadata() { @@ -80,7 +80,7 @@ public void testGetMetadata() { } /** - * Test method for {@link com.fujitsu.dc.core.model.impl.es.odata.EsODataProducer#getAccessorForLink()}. + * Test method for {@link io.personium.core.model.impl.es.odata.EsODataProducer#getAccessorForLink()}. */ @Test @Ignore @@ -89,7 +89,7 @@ public void testGetEsTypeForLink1() { } /** - * Test method for {@link com.fujitsu.dc.core.model.impl.es.odata.EsODataProducer#getAccessorForLog()}. + * Test method for {@link io.personium.core.model.impl.es.odata.EsODataProducer#getAccessorForLog()}. */ @Test @Ignore @@ -98,7 +98,7 @@ public void testGetEsTypeForLog1() { } /** - * Test method for {@link com.fujitsu.dc.core.model.impl.es.odata.EsODataProducer#EsODataProducer()}. + * Test method for {@link io.personium.core.model.impl.es.odata.EsODataProducer#EsODataProducer()}. */ @Test @Ignore @@ -108,7 +108,7 @@ public void testEsODataProducer() { /** * Test method for - * {@link com.fujitsu.dc.core.model.impl.es.odata.EsODataProducer#callFunction + * {@link io.personium.core.model.impl.es.odata.EsODataProducer#callFunction * (org.odata4j.edm.EdmFunctionImport, java.util.Map, org.odata4j.producer.QueryInfo)} * . */ @@ -119,7 +119,7 @@ public void testCallFunction() { } /** - * Test method for {@link com.fujitsu.dc.core.model.impl.es.odata.EsODataProducer#close()}. + * Test method for {@link io.personium.core.model.impl.es.odata.EsODataProducer#close()}. */ @Test @Ignore @@ -129,7 +129,7 @@ public void testClose() { /** * Test method for - * {@link com.fujitsu.dc.core.model.impl.es.odata.EsODataProducer#getEntity + * {@link io.personium.core.model.impl.es.odata.EsODataProducer#getEntity * (java.lang.String, org.odata4j.core.OEntityKey, org.odata4j.producer.EntityQueryInfo)} * . */ @@ -141,7 +141,7 @@ public void testGetEntity() { /** * Test method for - * {@link com.fujitsu.dc.core.model.impl.es.odata.EsODataProducer#getEntities + * {@link io.personium.core.model.impl.es.odata.EsODataProducer#getEntities * (java.lang.String, org.odata4j.producer.QueryInfo)} * . */ @@ -153,7 +153,7 @@ public void testGetEntities() { /** * Test method for - * {@link com.fujitsu.dc.core.model.impl.es.odata.EsODataProducer#deleteEntity + * {@link io.personium.core.model.impl.es.odata.EsODataProducer#deleteEntity * (java.lang.String, org.odata4j.core.OEntityKey)} * . */ @@ -164,7 +164,7 @@ public void testDeleteEntity() { } /** - * Test method for {@link com.fujitsu.dc.core.model.impl.es.odata.EsODataProducer#createEntity + * Test method for {@link io.personium.core.model.impl.es.odata.EsODataProducer#createEntity * (java.lang.String, * org.odata4j.core.OEntity)} . */ @Test @@ -175,7 +175,7 @@ public void testCreateEntityStringOEntity() { /** * Test method for - * {@link com.fujitsu.dc.core.model.impl.es.odata.EsODataProducer#createEntity + * {@link io.personium.core.model.impl.es.odata.EsODataProducer#createEntity * (java.lang.String, org.odata4j.core.OEntityKey, java.lang.String, org.odata4j.core.OEntity)} * . */ @@ -187,7 +187,7 @@ public void testCreateEntityStringOEntityKeyStringOEntity() { /** * Test method for - * {@link com.fujitsu.dc.core.model.impl.es.odata.EsODataProducer#createLink + * {@link io.personium.core.model.impl.es.odata.EsODataProducer#createLink * (org.odata4j.core.OEntityId, java.lang.String, org.odata4j.core.OEntityId)} * . */ @@ -199,7 +199,7 @@ public void testCreateLink() { /** * Test method for - * {@link com.fujitsu.dc.core.model.impl.es.odata.EsODataProducer#deleteLink + * {@link io.personium.core.model.impl.es.odata.EsODataProducer#deleteLink * (org.odata4j.core.OEntityId, java.lang.String, org.odata4j.core.OEntityKey)} * . */ @@ -211,7 +211,7 @@ public void testDeleteLink() { /** * Test method for - * {@link com.fujitsu.dc.core.model.impl.es.odata.EsODataProducer#getLinks + * {@link io.personium.core.model.impl.es.odata.EsODataProducer#getLinks * (org.odata4j.core.OEntityId, java.lang.String)} * . */ @@ -222,7 +222,7 @@ public void testGetLinks() { } /** - * Test method for {@link com.fujitsu.dc.core.model.impl.es.odata.EsODataProducer#getMetadataProducer()}. + * Test method for {@link io.personium.core.model.impl.es.odata.EsODataProducer#getMetadataProducer()}. */ @Test @Ignore @@ -232,7 +232,7 @@ public void testGetMetadataProducer() { /** * Test method for - * {@link com.fujitsu.dc.core.model.impl.es.odata.EsODataProducer#getNavProperty + * {@link io.personium.core.model.impl.es.odata.EsODataProducer#getNavProperty * (java.lang.String, org.odata4j.core.OEntityKey, java.lang.String, org.odata4j.producer.QueryInfo)} * . */ @@ -244,7 +244,7 @@ public void testGetNavProperty() { /** * Test method for - * {@link com.fujitsu.dc.core.model.impl.es.odata.EsODataProducer#mergeEntity + * {@link io.personium.core.model.impl.es.odata.EsODataProducer#mergeEntity * (java.lang.String, org.odata4j.core.OEntity)} * . */ @@ -256,7 +256,7 @@ public void testMergeEntity() { /** * Test method for - * {@link com.fujitsu.dc.core.model.impl.es.odata.EsODataProducer#updateEntity + * {@link io.personium.core.model.impl.es.odata.EsODataProducer#updateEntity * (java.lang.String, org.odata4j.core.OEntity)} * . */ @@ -268,7 +268,7 @@ public void testUpdateEntity() { /** * Test method for - * {@link com.fujitsu.dc.core.model.impl.es.odata.EsODataProducer#updateLink + * {@link io.personium.core.model.impl.es.odata.EsODataProducer#updateLink * (org.odata4j.core.OEntityId, java.lang.String, org.odata4j.core.OEntityKey, org.odata4j.core.OEntityId)} * . */ @@ -280,7 +280,7 @@ public void testUpdateLink() { /** * Test method for - * {@link com.fujitsu.dc.core.model.impl.es.odata.EsODataProducer#getEntitiesCount + * {@link io.personium.core.model.impl.es.odata.EsODataProducer#getEntitiesCount * (java.lang.String, org.odata4j.producer.QueryInfo)} * . */ @@ -292,7 +292,7 @@ public void testGetEntitiesCount() { /** * Test method for - * {@link com.fujitsu.dc.core.model.impl.es.odata.EsODataProducer#getNavPropertyCount + * {@link io.personium.core.model.impl.es.odata.EsODataProducer#getNavPropertyCount * (java.lang.String, org.odata4j.core.OEntityKey, java.lang.String, org.odata4j.producer.QueryInfo)} * . */ diff --git a/src/test/java/io/personium/test/unit/core/model/impl/es/odata/package-info.java b/src/test/java/io/personium/test/unit/core/model/impl/es/odata/package-info.java new file mode 100644 index 000000000..06e4194b8 --- /dev/null +++ b/src/test/java/io/personium/test/unit/core/model/impl/es/odata/package-info.java @@ -0,0 +1,21 @@ +/** + * personium.io + * Copyright 2014 FUJITSU LIMITED + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * JUnit test. + */ +package io.personium.test.unit.core.model.impl.es.odata; + diff --git a/src/test/java/io/personium/test/unit/core/model/impl/es/package-info.java b/src/test/java/io/personium/test/unit/core/model/impl/es/package-info.java new file mode 100644 index 000000000..0284207a1 --- /dev/null +++ b/src/test/java/io/personium/test/unit/core/model/impl/es/package-info.java @@ -0,0 +1,21 @@ +/** + * personium.io + * Copyright 2014 FUJITSU LIMITED + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * JUnit test. + */ +package io.personium.test.unit.core.model.impl.es; + diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/repair/AdsAcessorTest.java b/src/test/java/io/personium/test/unit/core/model/impl/es/repair/AdsAcessorTest.java similarity index 84% rename from src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/repair/AdsAcessorTest.java rename to src/test/java/io/personium/test/unit/core/model/impl/es/repair/AdsAcessorTest.java index 9e2965953..7e3aaa5e4 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/repair/AdsAcessorTest.java +++ b/src/test/java/io/personium/test/unit/core/model/impl/es/repair/AdsAcessorTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.model.impl.es.repair; +package io.personium.test.unit.core.model.impl.es.repair; import static org.junit.Assert.assertEquals; @@ -32,18 +32,18 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.es.EsType; -import com.fujitsu.dc.common.es.response.DcIndexResponse; -import com.fujitsu.dc.common.es.response.DcSearchResponse; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.model.impl.es.EsModel; -import com.fujitsu.dc.core.model.impl.es.ads.Ads; -import com.fujitsu.dc.core.model.impl.es.ads.AdsConnectionException; -import com.fujitsu.dc.core.model.impl.es.ads.AdsException; -import com.fujitsu.dc.core.model.impl.es.ads.JdbcAds; -import com.fujitsu.dc.core.model.impl.es.repair.AdsAccessor; -import com.fujitsu.dc.core.model.impl.es.repair.EsAccessor; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.common.es.EsType; +import io.personium.common.es.response.PersoniumIndexResponse; +import io.personium.common.es.response.PersoniumSearchResponse; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.model.impl.es.EsModel; +import io.personium.core.model.impl.es.ads.Ads; +import io.personium.core.model.impl.es.ads.AdsConnectionException; +import io.personium.core.model.impl.es.ads.AdsException; +import io.personium.core.model.impl.es.ads.JdbcAds; +import io.personium.core.model.impl.es.repair.AdsAccessor; +import io.personium.core.model.impl.es.repair.EsAccessor; +import io.personium.test.categories.Unit; /** * EsAcessorユニットテストクラス. @@ -54,7 +54,7 @@ public class AdsAcessorTest { static Logger log = LoggerFactory.getLogger(AdsAcessorTest.class); - private String idxName = DcCoreConfig.getEsUnitPrefix() + "_anon"; + private String idxName = PersoniumUnitConfig.getEsUnitPrefix() + "_anon"; private String[] idList = {"documentId1" }; private Ads ads; @@ -76,7 +76,7 @@ public void before() throws InterruptedException, AdsConnectionException { json1.put("c", ROUTING_ID); json1.put("p", Long.parseLong("1406595596944")); json1.put("u", Long.parseLong("1406595596944")); - DcIndexResponse res1 = type.create("documentId1", json1); + PersoniumIndexResponse res1 = type.create("documentId1", json1); assertEquals(idList[0], res1.getId()); } @@ -101,7 +101,7 @@ public void after() throws InterruptedException { AdsAccessor.initializedAds(); // Elasticsearchへリペア対象のデータを取得 List list = Arrays.asList(idList); - DcSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); + PersoniumSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); // ADSへリペアを実施する AdsAccessor.createAds(idxName, "Cell", esResponse); @@ -134,14 +134,14 @@ public void after() throws InterruptedException { json1.put("k2", "_u8jGStVRNmS2dypzsQAHD"); json1.put("p", Long.parseLong("1406595596944")); json1.put("u", Long.parseLong("1406595596944")); - DcIndexResponse res1 = type.create("documentId2", json1); + PersoniumIndexResponse res1 = type.create("documentId2", json1); assertEquals("documentId2", res1.getId()); AdsAccessor.initializedAds(); // Elasticsearchへリペア対象のデータを取得 List list = new ArrayList(); list.add("documentId2"); - DcSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); + PersoniumSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); // ADSへリペアを実施する AdsAccessor.createAds(idxName, "link", esResponse); @@ -164,7 +164,7 @@ public void after() throws InterruptedException { AdsAccessor.initializedAds(); // Elasticsearchへリペア対象のデータを取得 List list = Arrays.asList(idList); - DcSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); + PersoniumSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); // ADSへリペアを実施する AdsAccessor.createAds(idxName, "dav", esResponse); @@ -187,7 +187,7 @@ public void after() throws InterruptedException { AdsAccessor.initializedAds(); // Elasticsearchへリペア対象のデータを取得 List list = Arrays.asList(idList); - DcSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); + PersoniumSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); // ADSへリペアを実施する AdsAccessor.createAds(idxName, "Box", esResponse); @@ -210,7 +210,7 @@ public void after() throws InterruptedException { AdsAccessor.initializedAds(); // Elasticsearchへリペア対象のデータを取得 List list = Arrays.asList(idList); - DcSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); + PersoniumSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); AdsAccessor.createAds(idxName, "Cell", esResponse); Map map = esResponse.getHits().getHits()[0].getSource(); @@ -247,14 +247,14 @@ public void after() throws InterruptedException { json1.put("k2", "_u8jGStVRNmS2dypzsQAHD"); json1.put("p", Long.parseLong("1406595596944")); json1.put("u", Long.parseLong("1406595596944")); - DcIndexResponse res1 = type.create("documentId2", json1); + PersoniumIndexResponse res1 = type.create("documentId2", json1); assertEquals("documentId2", res1.getId()); AdsAccessor.initializedAds(); // Elasticsearchへリペア対象のデータを取得 List list = new ArrayList(); list.add("documentId2"); - DcSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); + PersoniumSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); // ADSへリペアを実施する AdsAccessor.createAds(idxName, "link", esResponse); @@ -286,7 +286,7 @@ public void after() throws InterruptedException { AdsAccessor.initializedAds(); // Elasticsearchへリペア対象のデータを取得 List list = Arrays.asList(idList); - DcSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); + PersoniumSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); AdsAccessor.createAds(idxName, "dav", esResponse); Map map = esResponse.getHits().getHits()[0].getSource(); @@ -313,7 +313,7 @@ public void after() throws InterruptedException { AdsAccessor.initializedAds(); // Elasticsearchへリペア対象のデータを取得 List list = Arrays.asList(idList); - DcSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); + PersoniumSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); AdsAccessor.createAds(idxName, "Box", esResponse); Map map = esResponse.getHits().getHits()[0].getSource(); diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/repair/AllTests.java b/src/test/java/io/personium/test/unit/core/model/impl/es/repair/AllTests.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/repair/AllTests.java rename to src/test/java/io/personium/test/unit/core/model/impl/es/repair/AllTests.java index ed3740d1a..a17e166f9 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/repair/AllTests.java +++ b/src/test/java/io/personium/test/unit/core/model/impl/es/repair/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.model.impl.es.repair; +package io.personium.test.unit.core.model.impl.es.repair; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/repair/EsAcessorTest.java b/src/test/java/io/personium/test/unit/core/model/impl/es/repair/EsAcessorTest.java similarity index 74% rename from src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/repair/EsAcessorTest.java rename to src/test/java/io/personium/test/unit/core/model/impl/es/repair/EsAcessorTest.java index 712fd2aa0..1073a1273 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/repair/EsAcessorTest.java +++ b/src/test/java/io/personium/test/unit/core/model/impl/es/repair/EsAcessorTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.model.impl.es.repair; +package io.personium.test.unit.core.model.impl.es.repair; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -29,15 +29,15 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.es.EsIndex; -import com.fujitsu.dc.common.es.EsType; -import com.fujitsu.dc.common.es.response.DcIndexResponse; -import com.fujitsu.dc.common.es.response.DcSearchHit; -import com.fujitsu.dc.common.es.response.DcSearchResponse; -import com.fujitsu.dc.common.es.util.DcUUID; -import com.fujitsu.dc.core.model.impl.es.EsModel; -import com.fujitsu.dc.core.model.impl.es.repair.EsAccessor; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.common.es.EsIndex; +import io.personium.common.es.EsType; +import io.personium.common.es.response.PersoniumIndexResponse; +import io.personium.common.es.response.PersoniumSearchHit; +import io.personium.common.es.response.PersoniumSearchResponse; +import io.personium.common.es.util.PersoniumUUID; +import io.personium.core.model.impl.es.EsModel; +import io.personium.core.model.impl.es.repair.EsAccessor; +import io.personium.test.categories.Unit; import java.util.Arrays; @@ -50,7 +50,7 @@ public class EsAcessorTest { static Logger log = LoggerFactory.getLogger(EsAcessorTest.class); - private String idxName = "test" + DcUUID.randomUUID(); + private String idxName = "test" + PersoniumUUID.randomUUID(); private String[] idList = {"documentId1", "documentId2" }; /** @@ -71,12 +71,12 @@ public void before() throws InterruptedException { JSONObject json1 = new JSONObject(); json1.put("key1-1", "value1"); json1.put("key1-2", "value2"); - DcIndexResponse res1 = type.create("documentId1", json1); + PersoniumIndexResponse res1 = type.create("documentId1", json1); assertEquals(idList[0], res1.getId()); JSONObject json2 = new JSONObject(); json2.put("key2-1", "value1"); json2.put("key2-2", "value2"); - DcIndexResponse res2 = type.create("documentId2", json2); + PersoniumIndexResponse res2 = type.create("documentId2", json2); assertEquals(idList[1], res2.getId()); } @@ -98,9 +98,9 @@ public void after() throws InterruptedException { public void EsModelの基礎的なテスト() { List list = Arrays.asList(idList); - DcSearchResponse response = EsAccessor.search(idxName, ROUTING_ID, list, "tType2"); + PersoniumSearchResponse response = EsAccessor.search(idxName, ROUTING_ID, list, "tType2"); assertEquals(2, response.getHits().getHits().length); - for (DcSearchHit hit : response.getHits().getHits()) { + for (PersoniumSearchHit hit : response.getHits().getHits()) { assertTrue(list.contains(hit.getId())); } } diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/repair/RepairAdsCompleteTest.java b/src/test/java/io/personium/test/unit/core/model/impl/es/repair/RepairAdsCompleteTest.java similarity index 98% rename from src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/repair/RepairAdsCompleteTest.java rename to src/test/java/io/personium/test/unit/core/model/impl/es/repair/RepairAdsCompleteTest.java index 55ca79a37..0e2abb000 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/repair/RepairAdsCompleteTest.java +++ b/src/test/java/io/personium/test/unit/core/model/impl/es/repair/RepairAdsCompleteTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.model.impl.es.repair; +package io.personium.test.unit.core.model.impl.es.repair; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -31,12 +31,12 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.ads.AbstractAdsWriteFailureLog; -import com.fujitsu.dc.common.ads.AdsWriteFailureLogException; -import com.fujitsu.dc.common.ads.AdsWriteFailureLogWriter; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.model.impl.es.repair.RepairAds; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.common.ads.AbstractAdsWriteFailureLog; +import io.personium.common.ads.AdsWriteFailureLogException; +import io.personium.common.ads.AdsWriteFailureLogWriter; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.model.impl.es.repair.RepairAds; +import io.personium.test.categories.Unit; /** * RepairAdsTest ユニットテストクラス. @@ -54,7 +54,7 @@ public class RepairAdsCompleteTest { @BeforeClass public static void beforeClass() { // 他のテスト中で作成されたADS書込み失敗ログの削除 - File logDir = new File(DcCoreConfig.getAdsWriteFailureLogDir()); + File logDir = new File(PersoniumUnitConfig.getAdsWriteFailureLogDir()); File[] files = logDir.listFiles(); for (File file : files) { file.delete(); diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/repair/RepairAdsIntegrationTest.java b/src/test/java/io/personium/test/unit/core/model/impl/es/repair/RepairAdsIntegrationTest.java similarity index 82% rename from src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/repair/RepairAdsIntegrationTest.java rename to src/test/java/io/personium/test/unit/core/model/impl/es/repair/RepairAdsIntegrationTest.java index 78d53b6ba..7176a42a8 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/repair/RepairAdsIntegrationTest.java +++ b/src/test/java/io/personium/test/unit/core/model/impl/es/repair/RepairAdsIntegrationTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.model.impl.es.repair; +package io.personium.test.unit.core.model.impl.es.repair; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -35,42 +35,42 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import com.fujitsu.dc.common.ads.AdsWriteFailureLogException; -import com.fujitsu.dc.common.ads.AdsWriteFailureLogInfo; -import com.fujitsu.dc.common.ads.AdsWriteFailureLogWriter; -import com.fujitsu.dc.common.es.EsIndex; -import com.fujitsu.dc.common.es.EsType; -import com.fujitsu.dc.common.es.response.DcSearchHit; -import com.fujitsu.dc.common.es.response.DcSearchResponse; -import com.fujitsu.dc.common.es.util.IndexNameEncoder; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.DcCoreLog; -import com.fujitsu.dc.core.model.Cell; -import com.fujitsu.dc.core.model.impl.es.EsModel; -import com.fujitsu.dc.core.model.impl.es.ads.Ads; -import com.fujitsu.dc.core.model.impl.es.ads.AdsException; -import com.fujitsu.dc.core.model.impl.es.ads.JdbcAds; -import com.fujitsu.dc.core.model.impl.es.doc.CellDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.EntitySetDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.UserDataDocHandler; -import com.fujitsu.dc.core.model.impl.es.odata.UserDataODataProducer; -import com.fujitsu.dc.core.model.lock.Lock; -import com.fujitsu.dc.core.model.lock.LockKeyComposer; -import com.fujitsu.dc.core.webcontainer.listener.RepairServiceLauncher; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRunner; -import com.fujitsu.dc.test.utils.BoxUtils; -import com.fujitsu.dc.test.utils.CellUtils; -import com.fujitsu.dc.test.utils.DavResourceUtils; -import com.fujitsu.dc.test.utils.EntityTypeUtils; -import com.fujitsu.dc.test.utils.UserDataUtils; +import io.personium.common.ads.AdsWriteFailureLogException; +import io.personium.common.ads.AdsWriteFailureLogInfo; +import io.personium.common.ads.AdsWriteFailureLogWriter; +import io.personium.common.es.EsIndex; +import io.personium.common.es.EsType; +import io.personium.common.es.response.PersoniumSearchHit; +import io.personium.common.es.response.PersoniumSearchResponse; +import io.personium.common.es.util.IndexNameEncoder; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.PersoniumCoreLog; +import io.personium.core.model.Cell; +import io.personium.core.model.impl.es.EsModel; +import io.personium.core.model.impl.es.ads.Ads; +import io.personium.core.model.impl.es.ads.AdsException; +import io.personium.core.model.impl.es.ads.JdbcAds; +import io.personium.core.model.impl.es.doc.CellDocHandler; +import io.personium.core.model.impl.es.doc.EntitySetDocHandler; +import io.personium.core.model.impl.es.doc.UserDataDocHandler; +import io.personium.core.model.impl.es.odata.UserDataODataProducer; +import io.personium.core.model.lock.Lock; +import io.personium.core.model.lock.LockKeyComposer; +import io.personium.core.webcontainer.listener.RepairServiceLauncher; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumIntegTestRunner; +import io.personium.test.utils.BoxUtils; +import io.personium.test.utils.CellUtils; +import io.personium.test.utils.DavResourceUtils; +import io.personium.test.utils.EntityTypeUtils; +import io.personium.test.utils.UserDataUtils; import com.sun.jersey.test.framework.WebAppDescriptor; /** * マスタ自動復旧機能のcoreとの結合テストクラス. */ -@RunWith(DcRunner.class) +@RunWith(PersoniumIntegTestRunner.class) @Category({Unit.class }) public class RepairAdsIntegrationTest extends AbstractCase { @@ -82,11 +82,11 @@ public class RepairAdsIntegrationTest extends AbstractCase { private static final Map INIT_PARAMS = new HashMap(); static { INIT_PARAMS.put("com.sun.jersey.config.property.packages", - "com.fujitsu.dc.core.rs"); + "io.personium.core.rs"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerRequestFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); INIT_PARAMS.put("com.sun.jersey.spi.container.ContainerResponseFilters", - "com.fujitsu.dc.core.jersey.filter.DcCoreContainerFilter"); + "io.personium.core.jersey.filter.PersoniumCoreContainerFilter"); } /** @@ -115,8 +115,8 @@ public void before() throws AdsException { */ @Test public void persnoium経由で登録されたCellデータをMySQLに登録できること() throws AdsException { - String indexName = DcCoreConfig.getEsUnitPrefix() + "_" + IndexNameEncoder.encodeEsIndexName("ad"); - String dbName = DcCoreConfig.getEsUnitPrefix() + "_" + IndexNameEncoder.encodeEsIndexName(owner); + String indexName = PersoniumUnitConfig.getEsUnitPrefix() + "_" + IndexNameEncoder.encodeEsIndexName("ad"); + String dbName = PersoniumUnitConfig.getEsUnitPrefix() + "_" + IndexNameEncoder.encodeEsIndexName(owner); // ESアクセス情報 String esTypeName = Cell.EDM_TYPE_NAME; @@ -129,7 +129,7 @@ public void before() throws AdsException { CellUtils.create(cellName, MASTER_TOKEN_NAME, owner, HttpStatus.SC_CREATED); // ESからデータ取得 - DcSearchHit esHit = searchFromEs(indexName, esTypeName, routingId, searchFieldName, searchFieldValue); + PersoniumSearchHit esHit = searchFromEs(indexName, esTypeName, routingId, searchFieldName, searchFieldValue); String id = esHit.getId(); EntitySetDocHandler esDocument = new CellDocHandler(esHit); @@ -205,7 +205,7 @@ public void before() throws AdsException { @Test public void core経由で登録されたODATAデータをMySQLに登録できること() throws AdsException { - String userDataIndexName = DcCoreConfig.getEsUnitPrefix() + "_" + IndexNameEncoder.encodeEsIndexName(owner); + String userDataIndexName = PersoniumUnitConfig.getEsUnitPrefix() + "_" + IndexNameEncoder.encodeEsIndexName(owner); // ESアクセス情報 String userDataEsTypeName = UserDataODataProducer.USER_ODATA_NAMESPACE; @@ -231,11 +231,11 @@ public void before() throws AdsException { .create(MASTER_TOKEN_NAME, HttpStatus.SC_CREATED, body, cellName, boxName, colName, entityType); // ESからデータ取得 - String cellIndexName = DcCoreConfig.getEsUnitPrefix() + "_" + IndexNameEncoder.encodeEsIndexName("ad"); - DcSearchHit cellEsHit = searchFromEs(cellIndexName, Cell.EDM_TYPE_NAME, EsIndex.CELL_ROUTING_KEY_NAME, + String cellIndexName = PersoniumUnitConfig.getEsUnitPrefix() + "_" + IndexNameEncoder.encodeEsIndexName("ad"); + PersoniumSearchHit cellEsHit = searchFromEs(cellIndexName, Cell.EDM_TYPE_NAME, EsIndex.CELL_ROUTING_KEY_NAME, "Name", cellName); String cellId = cellEsHit.getId(); - DcSearchHit userDataEsHit = searchFromEs(userDataIndexName, userDataEsTypeName, cellId, + PersoniumSearchHit userDataEsHit = searchFromEs(userDataIndexName, userDataEsTypeName, cellId, userDataSearchFieldName, userDataSearchFieldValue); EntitySetDocHandler esDocument = new UserDataDocHandler(userDataEsHit); @@ -323,7 +323,7 @@ public void before() throws AdsException { * @return 検索結果 */ @SuppressWarnings("unchecked") - DcSearchHit searchFromEs(String indexName, + PersoniumSearchHit searchFromEs(String indexName, String esTypeName, String routingId, String searchFieldName, @@ -340,11 +340,11 @@ DcSearchHit searchFromEs(String indexName, + " }, " + " \"size\": 1" + "}"; - DcSearchResponse esResponse; + PersoniumSearchResponse esResponse; try { esResponse = type.search((Map) new JSONParser().parse(query)); assertEquals("Failed to retrieve test data from Elasticsearch.", 1, esResponse.getHits().getCount()); - DcSearchHit esHit = esResponse.getHits().getAt(0); + PersoniumSearchHit esHit = esResponse.getHits().getAt(0); return esHit; } catch (ParseException e) { fail("Failed to parse query for ES. " + e.getMessage()); @@ -358,14 +358,14 @@ DcSearchHit searchFromEs(String indexName, */ protected void recordAdsWriteFailureLog(AdsWriteFailureLogInfo loginfo) { AdsWriteFailureLogWriter adsWriteFailureLogWriter = AdsWriteFailureLogWriter.getInstance( - DcCoreConfig.getAdsWriteFailureLogDir(), - DcCoreConfig.getCoreVersion(), - DcCoreConfig.getAdsWriteFailureLogPhysicalDelete()); + PersoniumUnitConfig.getAdsWriteFailureLogDir(), + PersoniumUnitConfig.getCoreVersion(), + PersoniumUnitConfig.getAdsWriteFailureLogPhysicalDelete()); try { adsWriteFailureLogWriter.writeActiveFile(loginfo); } catch (AdsWriteFailureLogException e2) { - DcCoreLog.Server.WRITE_ADS_FAILURE_LOG_ERROR.reason(e2).writeLog(); - DcCoreLog.Server.WRITE_ADS_FAILURE_LOG_INFO.params(loginfo.toString()); + PersoniumCoreLog.Server.WRITE_ADS_FAILURE_LOG_ERROR.reason(e2).writeLog(); + PersoniumCoreLog.Server.WRITE_ADS_FAILURE_LOG_INFO.params(loginfo.toString()); } } diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/repair/RepairAdsTest.java b/src/test/java/io/personium/test/unit/core/model/impl/es/repair/RepairAdsTest.java similarity index 85% rename from src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/repair/RepairAdsTest.java rename to src/test/java/io/personium/test/unit/core/model/impl/es/repair/RepairAdsTest.java index c6e1925c1..56e93b505 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/repair/RepairAdsTest.java +++ b/src/test/java/io/personium/test/unit/core/model/impl/es/repair/RepairAdsTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.model.impl.es.repair; +package io.personium.test.unit.core.model.impl.es.repair; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -31,25 +31,25 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.common.ads.AdsWriteFailureLogException; -import com.fujitsu.dc.common.ads.AdsWriteFailureLogInfo; -import com.fujitsu.dc.common.es.EsType; -import com.fujitsu.dc.common.es.response.DcIndexResponse; -import com.fujitsu.dc.common.es.response.DcSearchResponse; -import com.fujitsu.dc.common.es.util.DcUUID; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.model.impl.es.EsModel; -import com.fujitsu.dc.core.model.impl.es.ads.Ads; -import com.fujitsu.dc.core.model.impl.es.ads.AdsConnectionException; -import com.fujitsu.dc.core.model.impl.es.ads.AdsException; -import com.fujitsu.dc.core.model.impl.es.ads.JdbcAds; -import com.fujitsu.dc.core.model.impl.es.doc.EntitySetDocHandler; -import com.fujitsu.dc.core.model.impl.es.doc.OEntityDocHandler; -import com.fujitsu.dc.core.model.impl.es.repair.AdsAccessor; -import com.fujitsu.dc.core.model.impl.es.repair.EsAccessor; -import com.fujitsu.dc.core.model.impl.es.repair.RepairAds; -import com.fujitsu.dc.core.model.impl.es.repair.RepairAdsException; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.common.ads.AdsWriteFailureLogException; +import io.personium.common.ads.AdsWriteFailureLogInfo; +import io.personium.common.es.EsType; +import io.personium.common.es.response.PersoniumIndexResponse; +import io.personium.common.es.response.PersoniumSearchResponse; +import io.personium.common.es.util.PersoniumUUID; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.model.impl.es.EsModel; +import io.personium.core.model.impl.es.ads.Ads; +import io.personium.core.model.impl.es.ads.AdsConnectionException; +import io.personium.core.model.impl.es.ads.AdsException; +import io.personium.core.model.impl.es.ads.JdbcAds; +import io.personium.core.model.impl.es.doc.EntitySetDocHandler; +import io.personium.core.model.impl.es.doc.OEntityDocHandler; +import io.personium.core.model.impl.es.repair.AdsAccessor; +import io.personium.core.model.impl.es.repair.EsAccessor; +import io.personium.core.model.impl.es.repair.RepairAds; +import io.personium.core.model.impl.es.repair.RepairAdsException; +import io.personium.test.categories.Unit; /** * RepairAdsTest ユニットテストクラス. @@ -61,8 +61,8 @@ public class RepairAdsTest { static Logger log = LoggerFactory.getLogger(RepairAdsTest.class); - private String idxName = DcCoreConfig.getEsUnitPrefix() + "_anon"; - private String id = "repair_" + DcUUID.randomUUID(); + private String idxName = PersoniumUnitConfig.getEsUnitPrefix() + "_anon"; + private String id = "repair_" + PersoniumUUID.randomUUID(); private String[] idList = {id }; private Ads ads; @@ -84,7 +84,7 @@ public void before() throws InterruptedException, AdsConnectionException { json1.put("c", ROUTING_ID); json1.put("p", Long.parseLong("1406595596944")); json1.put("u", Long.parseLong("1406595596944")); - DcIndexResponse res1 = type.create(id, json1); + PersoniumIndexResponse res1 = type.create(id, json1); assertEquals(idList[0], res1.getId()); } @@ -135,7 +135,7 @@ public void after() throws InterruptedException { RepairAds repair = RepairAds.getInstance(); StringBuilder sbuf = new StringBuilder(); - sbuf.append(DcCoreConfig.getEsUnitPrefix() + "_anon\t"); + sbuf.append(PersoniumUnitConfig.getEsUnitPrefix() + "_anon\t"); sbuf.append("ComplexTypeProperty\t"); sbuf.append("odata-gsX3t2q3Qz6jdIn30fFMaQ\t"); sbuf.append("aCUuueHzTKCPchE0yxTZZA\t"); @@ -147,7 +147,7 @@ public void after() throws InterruptedException { List list = new ArrayList(); list.add("abc"); - DcSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); + PersoniumSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); List adsResponse = AdsAccessor.getIdListOnAds(logInfo); repair.repairToAds(logInfo, esResponse, adsResponse); @@ -173,7 +173,7 @@ public void after() throws InterruptedException { // AdsWriteFailureLogInfoを生成 StringBuilder sbuf = new StringBuilder(); - sbuf.append(DcCoreConfig.getEsUnitPrefix() + "_anon\t"); + sbuf.append(PersoniumUnitConfig.getEsUnitPrefix() + "_anon\t"); sbuf.append("ComplexTypeProperty\t"); sbuf.append("odata-gsX3t2q3Qz6jdIn30fFMaQ\t"); sbuf.append("aCUuueHzTKCPchE0yxTZZA\t"); @@ -186,7 +186,7 @@ public void after() throws InterruptedException { // 前準備で登録したデータをESから取得する List list = new ArrayList(); list.add(id); - DcSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); + PersoniumSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); // ADSへ同じデータを2件登録する AdsAccessor.createAds(idxName, "Cell", esResponse); @@ -223,7 +223,7 @@ public void after() throws InterruptedException { // AdsWriteFailureLogInfoを生成 StringBuilder sbuf = new StringBuilder(); - sbuf.append(DcCoreConfig.getEsUnitPrefix() + "_anon\t"); + sbuf.append(PersoniumUnitConfig.getEsUnitPrefix() + "_anon\t"); sbuf.append("ComplexTypeProperty\t"); sbuf.append("odata-gsX3t2q3Qz6jdIn30fFMaQ\t"); sbuf.append("aCUuueHzTKCPchE0yxTZZA\t"); @@ -236,7 +236,7 @@ public void after() throws InterruptedException { // 前準備で登録したデータをESから取得する List list = new ArrayList(); list.add(id); - DcSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); + PersoniumSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); // ADSから対象データを検索する List adsResponseBefore = AdsAccessor.getIdListOnAds(logInfo); @@ -272,7 +272,7 @@ public void after() throws InterruptedException { // ADSにデータを登録する List list = new ArrayList(); list.add(id); - DcSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); + PersoniumSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); AdsAccessor.createAds(idxName, "Entity", esResponse); // ESにデータ更新をする(バージョンが2) @@ -286,7 +286,7 @@ public void after() throws InterruptedException { // AdsWriteFailureLogInfoを生成 StringBuilder sbuf = new StringBuilder(); - sbuf.append(DcCoreConfig.getEsUnitPrefix() + "_anon\t"); + sbuf.append(PersoniumUnitConfig.getEsUnitPrefix() + "_anon\t"); sbuf.append("ComplexTypeProperty\t"); sbuf.append("odata-gsX3t2q3Qz6jdIn30fFMaQ\t"); sbuf.append("aCUuueHzTKCPchE0yxTZZA\t"); @@ -338,7 +338,7 @@ public void after() throws InterruptedException { // AdsWriteFailureLogInfoを生成 StringBuilder sbuf = new StringBuilder(); - sbuf.append(DcCoreConfig.getEsUnitPrefix() + "_anon\t"); + sbuf.append(PersoniumUnitConfig.getEsUnitPrefix() + "_anon\t"); sbuf.append("ComplexTypeProperty\t"); sbuf.append("odata-gsX3t2q3Qz6jdIn30fFMaQ\t"); sbuf.append("aCUuueHzTKCPchE0yxTZZA\t"); @@ -351,7 +351,7 @@ public void after() throws InterruptedException { // 前準備で登録したデータをESから取得する List list = new ArrayList(); list.add(id); - DcSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); + PersoniumSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); // ADSにデータを登録 EntitySetDocHandler oedh = new OEntityDocHandler(esResponse.getHits().getHits()[0]); @@ -390,7 +390,7 @@ public void after() throws InterruptedException { // AdsWriteFailureLogInfoを生成 StringBuilder sbuf = new StringBuilder(); - sbuf.append(DcCoreConfig.getEsUnitPrefix() + "_anon\t"); + sbuf.append(PersoniumUnitConfig.getEsUnitPrefix() + "_anon\t"); sbuf.append("ComplexTypeProperty\t"); sbuf.append("odata-gsX3t2q3Qz6jdIn30fFMaQ\t"); sbuf.append("aCUuueHzTKCPchE0yxTZZA\t"); @@ -407,7 +407,7 @@ public void after() throws InterruptedException { // ADSから対象データを検索する(0件) List adsResponseBefore = AdsAccessor.getIdListOnAds(logInfo); // ESから対象データを検索する(0件) - DcSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); + PersoniumSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); // 対象データのリペア処理が無視されること repair.repairToAds(logInfo, esResponse, adsResponseBefore); @@ -436,7 +436,7 @@ public void after() throws InterruptedException { // ADSにデータを登録する List list = new ArrayList(); list.add(id); - DcSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); + PersoniumSearchResponse esResponse = EsAccessor.search(idxName, ROUTING_ID, list, "UserData"); AdsAccessor.createAds(idxName, "Entity", esResponse); // ESにデータ更新をする(バージョンが2) @@ -450,7 +450,7 @@ public void after() throws InterruptedException { // AdsWriteFailureLogInfoを生成 StringBuilder sbuf = new StringBuilder(); - sbuf.append(DcCoreConfig.getEsUnitPrefix() + "_anon\t"); + sbuf.append(PersoniumUnitConfig.getEsUnitPrefix() + "_anon\t"); sbuf.append("ComplexTypeProperty\t"); sbuf.append("odata-gsX3t2q3Qz6jdIn30fFMaQ\t"); sbuf.append("aCUuueHzTKCPchE0yxTZZA\t"); diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/repair/package-info.java b/src/test/java/io/personium/test/unit/core/model/impl/es/repair/package-info.java similarity index 88% rename from src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/repair/package-info.java rename to src/test/java/io/personium/test/unit/core/model/impl/es/repair/package-info.java index 9d037e4be..7e9a10a62 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/impl/es/repair/package-info.java +++ b/src/test/java/io/personium/test/unit/core/model/impl/es/repair/package-info.java @@ -17,5 +17,5 @@ /** * JUnit test for ads repair. */ -package com.fujitsu.dc.test.unit.core.model.impl.es.repair; +package io.personium.test.unit.core.model.impl.es.repair; diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/jaxb/AclTest.java b/src/test/java/io/personium/test/unit/core/model/jaxb/AclTest.java similarity index 96% rename from src/test/java/com/fujitsu/dc/test/unit/core/model/jaxb/AclTest.java rename to src/test/java/io/personium/test/unit/core/model/jaxb/AclTest.java index f2df5c672..3aea764fc 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/jaxb/AclTest.java +++ b/src/test/java/io/personium/test/unit/core/model/jaxb/AclTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.model.jaxb; +package io.personium.test.unit.core.model.jaxb; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -28,9 +28,9 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.core.model.jaxb.Acl; -import com.fujitsu.dc.core.model.jaxb.ObjectIo; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.core.model.jaxb.Acl; +import io.personium.core.model.jaxb.ObjectIo; +import io.personium.test.categories.Unit; /** * ユニットテストクラス. diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/jaxb/AllTests.java b/src/test/java/io/personium/test/unit/core/model/jaxb/AllTests.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/unit/core/model/jaxb/AllTests.java rename to src/test/java/io/personium/test/unit/core/model/jaxb/AllTests.java index 966eabd59..b05548c83 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/jaxb/AllTests.java +++ b/src/test/java/io/personium/test/unit/core/model/jaxb/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.model.jaxb; +package io.personium.test.unit.core.model.jaxb; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/lock/AllTests.java b/src/test/java/io/personium/test/unit/core/model/lock/AllTests.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/unit/core/model/lock/AllTests.java rename to src/test/java/io/personium/test/unit/core/model/lock/AllTests.java index 7dc2b0b31..05758e31e 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/lock/AllTests.java +++ b/src/test/java/io/personium/test/unit/core/model/lock/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.model.lock; +package io.personium.test.unit.core.model.lock; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/lock/UnitUserLockManagerTest.java b/src/test/java/io/personium/test/unit/core/model/lock/UnitUserLockManagerTest.java similarity index 82% rename from src/test/java/com/fujitsu/dc/test/unit/core/model/lock/UnitUserLockManagerTest.java rename to src/test/java/io/personium/test/unit/core/model/lock/UnitUserLockManagerTest.java index 524406160..1f3a973f5 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/lock/UnitUserLockManagerTest.java +++ b/src/test/java/io/personium/test/unit/core/model/lock/UnitUserLockManagerTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.model.lock; +package io.personium.test.unit.core.model.lock; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -22,9 +22,9 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.model.lock.UnitUserLockManager; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.model.lock.UnitUserLockManager; +import io.personium.test.categories.Unit; /** * UnitUserLockManager ユニットテストクラス. @@ -39,7 +39,7 @@ public class UnitUserLockManagerTest { */ @Test public void ロックされている場合にTRUEを返すこと() { - String unitPrefix = DcCoreConfig.getEsUnitPrefix(); + String unitPrefix = PersoniumUnitConfig.getEsUnitPrefix(); String unitUserName = unitPrefix + "_unituserlocktest"; try { UnitUserLockManager.registLockObjct(unitUserName); @@ -54,7 +54,7 @@ public class UnitUserLockManagerTest { */ @Test public void ロックされていない場合にFALSEを返すこと() { - String unitPrefix = DcCoreConfig.getEsUnitPrefix(); + String unitPrefix = PersoniumUnitConfig.getEsUnitPrefix(); String unitUserName = unitPrefix + "_unituserlocktest"; assertFalse(UnitUserLockManager.hasLockObject(unitUserName)); } @@ -64,7 +64,7 @@ public class UnitUserLockManagerTest { */ @Test public void 異なるUnitUserでロックされている場合にFALSEを返すこと() { - String unitPrefix = DcCoreConfig.getEsUnitPrefix(); + String unitPrefix = PersoniumUnitConfig.getEsUnitPrefix(); String unitUserName = unitPrefix + "_unituserlocktest"; try { UnitUserLockManager.registLockObjct(unitUserName + "XX"); diff --git a/src/test/java/io/personium/test/unit/core/model/lock/package-info.java b/src/test/java/io/personium/test/unit/core/model/lock/package-info.java new file mode 100644 index 000000000..4484c0f9d --- /dev/null +++ b/src/test/java/io/personium/test/unit/core/model/lock/package-info.java @@ -0,0 +1,21 @@ +/** + * personium.io + * Copyright 2014 FUJITSU LIMITED + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * JUnit test. + */ +package io.personium.test.unit.core.model.lock; + diff --git a/src/test/java/io/personium/test/unit/core/model/package-info.java b/src/test/java/io/personium/test/unit/core/model/package-info.java new file mode 100644 index 000000000..df4bf34be --- /dev/null +++ b/src/test/java/io/personium/test/unit/core/model/package-info.java @@ -0,0 +1,21 @@ +/** + * personium.io + * Copyright 2014 FUJITSU LIMITED + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * JUnit test. + */ +package io.personium.test.unit.core.model; + diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/progress/AllTests.java b/src/test/java/io/personium/test/unit/core/model/progress/AllTests.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/unit/core/model/progress/AllTests.java rename to src/test/java/io/personium/test/unit/core/model/progress/AllTests.java index abee80f88..9f96b5bf7 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/progress/AllTests.java +++ b/src/test/java/io/personium/test/unit/core/model/progress/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.model.progress; +package io.personium.test.unit.core.model.progress; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/model/progress/MemcachedProgressManagerTest.java b/src/test/java/io/personium/test/unit/core/model/progress/MemcachedProgressManagerTest.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/unit/core/model/progress/MemcachedProgressManagerTest.java rename to src/test/java/io/personium/test/unit/core/model/progress/MemcachedProgressManagerTest.java index dc9502d58..5b39600d7 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/model/progress/MemcachedProgressManagerTest.java +++ b/src/test/java/io/personium/test/unit/core/model/progress/MemcachedProgressManagerTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.model.progress; +package io.personium.test.unit.core.model.progress; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; @@ -27,9 +27,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.core.model.progress.Progress; -import com.fujitsu.dc.core.model.progress.ProgressManager; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.core.model.progress.Progress; +import io.personium.core.model.progress.ProgressManager; +import io.personium.test.categories.Unit; /** * MemcachedProgressManager ユニットテストクラス. diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/token/package-info.java b/src/test/java/io/personium/test/unit/core/model/progress/package-info.java similarity index 89% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/auth/token/package-info.java rename to src/test/java/io/personium/test/unit/core/model/progress/package-info.java index 1fcaf1404..815ed6f16 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/token/package-info.java +++ b/src/test/java/io/personium/test/unit/core/model/progress/package-info.java @@ -17,5 +17,5 @@ /** * JUnit test. */ -package com.fujitsu.dc.test.jersey.cell.auth.token; +package io.personium.test.unit.core.model.progress; diff --git a/src/test/java/io/personium/test/unit/core/odata/AllTests.java b/src/test/java/io/personium/test/unit/core/odata/AllTests.java new file mode 100644 index 000000000..c725cb12a --- /dev/null +++ b/src/test/java/io/personium/test/unit/core/odata/AllTests.java @@ -0,0 +1,31 @@ +/** + * personium.io + * Copyright 2014 FUJITSU LIMITED + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.personium.test.unit.core.odata; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; +import org.junit.runners.Suite.SuiteClasses; + +/** + * パッケージ配下のテストケースを全て実行するためのテストスイート. + */ +@RunWith(Suite.class) +@SuiteClasses({ + PersoniumExpressionParserTest.class + }) +public class AllTests { +} diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/odata/DcExpressionParserTest.java b/src/test/java/io/personium/test/unit/core/odata/PersoniumExpressionParserTest.java similarity index 85% rename from src/test/java/com/fujitsu/dc/test/unit/core/odata/DcExpressionParserTest.java rename to src/test/java/io/personium/test/unit/core/odata/PersoniumExpressionParserTest.java index b417d0602..cad399931 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/odata/DcExpressionParserTest.java +++ b/src/test/java/io/personium/test/unit/core/odata/PersoniumExpressionParserTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.odata; +package io.personium.test.unit.core.odata; import static org.junit.Assert.assertEquals; @@ -25,15 +25,15 @@ import org.junit.experimental.categories.Category; import org.odata4j.expression.ExpressionParser.TokenType; -import com.fujitsu.dc.core.odata.DcExpressionParser; -import com.fujitsu.dc.core.odata.DcExpressionParser.Token; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.core.odata.PersoniumExpressionParser; +import io.personium.core.odata.PersoniumExpressionParser.Token; +import io.personium.test.categories.Unit; /** - * DcExpressionParser ユニットテストクラス. + * PersoniumExpressionParser ユニットテストクラス. */ @Category({ Unit.class }) -public class DcExpressionParserTest { +public class PersoniumExpressionParserTest { /** @@ -50,7 +50,7 @@ public class DcExpressionParserTest { tokenList.add(t2); tokenList.add(t3); tokenList.add(t4); - List result = DcExpressionParser.processParentheses(tokenList); + List result = PersoniumExpressionParser.processParentheses(tokenList); assertEquals("[[(][test][)]]", result.toString()); } @@ -68,7 +68,7 @@ public class DcExpressionParserTest { tokenList.add(t2); tokenList.add(t3); tokenList.add(t4); - List result = DcExpressionParser.processParentheses(tokenList); + List result = PersoniumExpressionParser.processParentheses(tokenList); assertEquals("[[(][true][)]]", result.toString()); } @@ -87,7 +87,7 @@ public class DcExpressionParserTest { tokenList.add(t3); tokenList.add(t4); try { - DcExpressionParser.processParentheses(tokenList); + PersoniumExpressionParser.processParentheses(tokenList); } catch (Exception e) { assertEquals("expected ':', found: [)]", e.getMessage()); } @@ -106,7 +106,7 @@ public class DcExpressionParserTest { tokenList.add(t2); tokenList.add(t3); try { - DcExpressionParser.processParentheses(tokenList); + PersoniumExpressionParser.processParentheses(tokenList); } catch (Exception e) { assertEquals("expected ':', found: eof", e.getMessage()); } @@ -123,7 +123,7 @@ public class DcExpressionParserTest { tokenList.add(t1); tokenList.add(t2); try { - DcExpressionParser.processParentheses(tokenList); + PersoniumExpressionParser.processParentheses(tokenList); } catch (Exception e) { assertEquals("unexpected token: eof", e.getMessage()); } @@ -144,7 +144,7 @@ public class DcExpressionParserTest { tokenList.add(t2); tokenList.add(t3); tokenList.add(t4); - List result = DcExpressionParser.processParentheses(tokenList); + List result = PersoniumExpressionParser.processParentheses(tokenList); assertEquals("[[/any], [test], [:]]", result.toString()); } @@ -170,7 +170,7 @@ public class DcExpressionParserTest { tokenList.add(t7); try { - DcExpressionParser.processParentheses(tokenList); + PersoniumExpressionParser.processParentheses(tokenList); } catch (Exception e) { assertEquals("illegal any predicate", e.getMessage()); } @@ -188,7 +188,7 @@ public class DcExpressionParserTest { tokenList.add(t1); tokenList.add(t2); tokenList.add(t3); - List result = DcExpressionParser.processParentheses(tokenList); + List result = PersoniumExpressionParser.processParentheses(tokenList); assertEquals("[[/any][(][)]]", result.toString()); } @@ -206,7 +206,7 @@ public class DcExpressionParserTest { tokenList.add(t2); tokenList.add(t3); tokenList.add(t4); - List result = DcExpressionParser.processParentheses(tokenList); + List result = PersoniumExpressionParser.processParentheses(tokenList); assertEquals("[[/all], [test], [:]]", result.toString()); } diff --git a/src/test/java/io/personium/test/unit/core/odata/package-info.java b/src/test/java/io/personium/test/unit/core/odata/package-info.java new file mode 100644 index 000000000..434b7e506 --- /dev/null +++ b/src/test/java/io/personium/test/unit/core/odata/package-info.java @@ -0,0 +1,21 @@ +/** + * personium.io + * Copyright 2014 FUJITSU LIMITED + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * JUnit test. + */ +package io.personium.test.unit.core.odata; + diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/package-info.java b/src/test/java/io/personium/test/unit/core/package-info.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/unit/core/package-info.java rename to src/test/java/io/personium/test/unit/core/package-info.java index 9d1248625..c5c3ea294 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/package-info.java +++ b/src/test/java/io/personium/test/unit/core/package-info.java @@ -17,5 +17,5 @@ /** * JUnit test. */ -package com.fujitsu.dc.test.unit.core; +package io.personium.test.unit.core; diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/rs/odata/AllTests.java b/src/test/java/io/personium/test/unit/core/rs/odata/AllTests.java similarity index 86% rename from src/test/java/com/fujitsu/dc/test/unit/core/rs/odata/AllTests.java rename to src/test/java/io/personium/test/unit/core/rs/odata/AllTests.java index eb5c582d0..fc9b42f17 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/rs/odata/AllTests.java +++ b/src/test/java/io/personium/test/unit/core/rs/odata/AllTests.java @@ -14,13 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.rs.odata; +package io.personium.test.unit.core.rs.odata; import org.junit.runner.RunWith; import org.junit.runners.Suite; import org.junit.runners.Suite.SuiteClasses; -import com.fujitsu.dc.test.jersey.box.odatacol.batch.BatchRequestShutterTest; +import io.personium.test.jersey.box.odatacol.batch.BatchRequestShutterTest; /** * パッケージ配下のテストケースを全て実行するためのテストスイート. diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/rs/odata/DecideOutputFormatTest.java b/src/test/java/io/personium/test/unit/core/rs/odata/DecideOutputFormatTest.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/unit/core/rs/odata/DecideOutputFormatTest.java rename to src/test/java/io/personium/test/unit/core/rs/odata/DecideOutputFormatTest.java index d146d8fb0..266eb0850 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/rs/odata/DecideOutputFormatTest.java +++ b/src/test/java/io/personium/test/unit/core/rs/odata/DecideOutputFormatTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.rs.odata; +package io.personium.test.unit.core.rs.odata; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -24,9 +24,9 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.rs.odata.ODataEntityResource; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.core.PersoniumCoreException; +import io.personium.core.rs.odata.ODataEntityResource; +import io.personium.test.categories.Unit; /** */ @@ -122,7 +122,7 @@ public class DecideOutputFormatTest { try { odataEntityResource.decideOutputFormat("INVALID_VALUE", null); fail(); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { assertEquals("PR415-OD-0001", e.getCode()); } catch (Exception e) { fail(); @@ -164,7 +164,7 @@ public class DecideOutputFormatTest { odataEntityResource.decideOutputFormat( MediaType.APPLICATION_ATOM_XML + "," + "INVALID_VALUE", null); fail(); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { assertEquals("PR415-OD-0001", e.getCode()); } catch (Exception e) { fail(); @@ -225,7 +225,7 @@ public class DecideOutputFormatTest { try { odataEntityResource.decideOutputFormat(null, "INVALID_VALUE"); fail(); - } catch (DcCoreException e) { + } catch (PersoniumCoreException e) { assertEquals("PR400-OD-0005", e.getCode()); } catch (Exception e) { fail(); diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/rs/odata/EscapeResponseBodyTest.java b/src/test/java/io/personium/test/unit/core/rs/odata/EscapeResponseBodyTest.java similarity index 96% rename from src/test/java/com/fujitsu/dc/test/unit/core/rs/odata/EscapeResponseBodyTest.java rename to src/test/java/io/personium/test/unit/core/rs/odata/EscapeResponseBodyTest.java index ed1b388f4..c83159184 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/rs/odata/EscapeResponseBodyTest.java +++ b/src/test/java/io/personium/test/unit/core/rs/odata/EscapeResponseBodyTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.rs.odata; +package io.personium.test.unit.core.rs.odata; import static org.junit.Assert.assertEquals; @@ -25,8 +25,8 @@ import org.junit.experimental.theories.Theory; import org.junit.runner.RunWith; -import com.fujitsu.dc.core.rs.odata.ODataEntityResource; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.core.rs.odata.ODataEntityResource; +import io.personium.test.categories.Unit; /** */ diff --git a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/package-info.java b/src/test/java/io/personium/test/unit/core/rs/odata/package-info.java similarity index 90% rename from src/test/java/com/fujitsu/dc/test/jersey/cell/auth/package-info.java rename to src/test/java/io/personium/test/unit/core/rs/odata/package-info.java index 2409dfdce..0559cf175 100644 --- a/src/test/java/com/fujitsu/dc/test/jersey/cell/auth/package-info.java +++ b/src/test/java/io/personium/test/unit/core/rs/odata/package-info.java @@ -17,5 +17,5 @@ /** * JUnit test. */ -package com.fujitsu.dc.test.jersey.cell.auth; +package io.personium.test.unit.core.rs.odata; diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/rs/odata/validate/AllTests.java b/src/test/java/io/personium/test/unit/core/rs/odata/validate/AllTests.java similarity index 91% rename from src/test/java/com/fujitsu/dc/test/unit/core/rs/odata/validate/AllTests.java rename to src/test/java/io/personium/test/unit/core/rs/odata/validate/AllTests.java index fec4355c9..a3d4f65eb 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/rs/odata/validate/AllTests.java +++ b/src/test/java/io/personium/test/unit/core/rs/odata/validate/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.rs.odata.validate; +package io.personium.test.unit.core.rs.odata.validate; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/rs/odata/validate/ReceivedMessageValidateTest.java b/src/test/java/io/personium/test/unit/core/rs/odata/validate/ReceivedMessageValidateTest.java similarity index 61% rename from src/test/java/com/fujitsu/dc/test/unit/core/rs/odata/validate/ReceivedMessageValidateTest.java rename to src/test/java/io/personium/test/unit/core/rs/odata/validate/ReceivedMessageValidateTest.java index 8d6df50e6..c26e27481 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/rs/odata/validate/ReceivedMessageValidateTest.java +++ b/src/test/java/io/personium/test/unit/core/rs/odata/validate/ReceivedMessageValidateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.rs.odata.validate; +package io.personium.test.unit.core.rs.odata.validate; import static org.junit.Assert.assertEquals; @@ -24,12 +24,12 @@ import org.odata4j.core.OProperty; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.ReceivedMessage; -import com.fujitsu.dc.core.rs.cell.MessageODataResource; -import com.fujitsu.dc.core.rs.odata.AbstractODataResource; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.ReceivedMessage; +import io.personium.core.rs.cell.MessageODataResource; +import io.personium.core.rs.odata.AbstractODataResource; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; /** * Messageバリデートテスト. @@ -43,70 +43,70 @@ public ReceivedMessageValidateTest() { } /** - * idが31文字の場合にDcCoreExceptionが発生すること. + * idが31文字の場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void idが31文字の場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void idが31文字の場合にPersoniumCoreExceptionが発生すること() { this.validateProperty(ReceivedMessage.P_ID.build(), ReceivedMessage.P_ID.getName(), OProperties.string(ReceivedMessage.P_ID.getName(), "1234567890123456789012345678901")); } /** - * idが32文字の場合にDcCoreExceptionが発生しないこと. + * idが32文字の場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void idが32文字の場合にDcCoreExceptionが発生しないこと() { + public final void idが32文字の場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty(ReceivedMessage.P_ID.build(), ReceivedMessage.P_ID.getName(), OProperties.string(ReceivedMessage.P_ID.getName(), "12345678901234567890123456789012")); } /** - * idが33文字の場合にDcCoreExceptionが発生すること. + * idが33文字の場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void idが33文字の場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void idが33文字の場合にPersoniumCoreExceptionが発生すること() { this.validateProperty(ReceivedMessage.P_ID.build(), ReceivedMessage.P_ID.getName(), OProperties.string(ReceivedMessage.P_ID.getName(), "123456789012345678901234567890123")); } /** - * idがNullの場合にDcCoreExceptionが発生すること. + * idがNullの場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void idがNullの場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void idがNullの場合にPersoniumCoreExceptionが発生すること() { this.setDefaultValue(ReceivedMessage.P_ID.build(), ReceivedMessage.P_ID.getName(), OProperties.string(ReceivedMessage.P_ID.getName(), "")); } /** - * InReplyToが31文字の場合にDcCoreExceptionが発生すること. + * InReplyToが31文字の場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void InReplyToが31文字の場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void InReplyToが31文字の場合にPersoniumCoreExceptionが発生すること() { this.validateProperty(ReceivedMessage.P_IN_REPLY_TO.build(), ReceivedMessage.P_IN_REPLY_TO.getName(), OProperties.string(ReceivedMessage.P_IN_REPLY_TO.getName(), "1234567890123456789012345678901")); } /** - * InReplyToが32文字の場合にDcCoreExceptionが発生しないこと. + * InReplyToが32文字の場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void InReplyToが32文字の場合にDcCoreExceptionが発生しないこと() { + public final void InReplyToが32文字の場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty(ReceivedMessage.P_IN_REPLY_TO.build(), ReceivedMessage.P_IN_REPLY_TO.getName(), OProperties.string(ReceivedMessage.P_IN_REPLY_TO.getName(), "12345678901234567890123456789012")); } /** - * InReplyToが33文字の場合にDcCoreExceptionが発生すること. + * InReplyToが33文字の場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void InReplyToが33文字の場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void InReplyToが33文字の場合にPersoniumCoreExceptionが発生すること() { this.validateProperty(ReceivedMessage.P_IN_REPLY_TO.build(), ReceivedMessage.P_IN_REPLY_TO.getName(), OProperties.string(ReceivedMessage.P_IN_REPLY_TO.getName(), "123456789012345678901234567890123")); @@ -126,90 +126,90 @@ public ReceivedMessageValidateTest() { } /** - * FromがURL形式の場合にDcCoreExceptionが発生しないこと. + * FromがURL形式の場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void FromがURL形式の場合にDcCoreExceptionが発生しないこと() { + public final void FromがURL形式の場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty(ReceivedMessage.P_FROM.build(), ReceivedMessage.P_FROM.getName(), OProperties.string(ReceivedMessage.P_FROM.getName(), "http://example.com/test")); } /** - * FromがURL形式でない場合にDcCoreExceptionが発生すること. + * FromがURL形式でない場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void FromがURL形式でない場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void FromがURL形式でない場合にPersoniumCoreExceptionが発生すること() { this.validateProperty(ReceivedMessage.P_FROM.build(), ReceivedMessage.P_FROM.getName(), OProperties.string(ReceivedMessage.P_FROM.getName(), "ftp://example.com/test")); } /** - * FromがNullの場合にDcCoreExceptionが発生すること. + * FromがNullの場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void FromがNullの場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void FromがNullの場合にPersoniumCoreExceptionが発生すること() { this.setDefaultValue(ReceivedMessage.P_FROM.build(), ReceivedMessage.P_FROM.getName(), OProperties.string(ReceivedMessage.P_FROM.getName(), "")); } /** - * Typeがmessageの場合にDcCoreExceptionが発生しないこと. + * Typeがmessageの場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void Typeがmessageの場合にDcCoreExceptionが発生しないこと() { + public final void Typeがmessageの場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty(ReceivedMessage.P_TYPE.build(), ReceivedMessage.P_TYPE.getName(), OProperties.string(ReceivedMessage.P_TYPE.getName(), "message")); } /** - * Typeがreq.relation.buildの場合にDcCoreExceptionが発生しないこと. + * Typeがreq.relation.buildの場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void Typeがreq_relation_buildeの場合にDcCoreExceptionが発生しないこと() { + public final void Typeがreq_relation_buildeの場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty(ReceivedMessage.P_TYPE.build(), ReceivedMessage.P_TYPE.getName(), OProperties.string(ReceivedMessage.P_TYPE.getName(), "req.relation.build")); } /** - * Typeがreq.relation.breakの場合にDcCoreExceptionが発生しないこと. + * Typeがreq.relation.breakの場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void Typeがreq_relation_breakの場合にDcCoreExceptionが発生しないこと() { + public final void Typeがreq_relation_breakの場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty(ReceivedMessage.P_TYPE.build(), ReceivedMessage.P_TYPE.getName(), OProperties.string(ReceivedMessage.P_TYPE.getName(), "req.relation.break")); } /** - * Typeがsocial_messageの場合にDcCoreExceptionが発生すること. + * Typeがsocial_messageの場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void Typeがsocial_messageの場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void Typeがsocial_messageの場合にPersoniumCoreExceptionが発生すること() { this.validateProperty(ReceivedMessage.P_TYPE.build(), ReceivedMessage.P_TYPE.getName(), OProperties.string(ReceivedMessage.P_TYPE.getName(), "social.message")); } /** - * Typeがnullの場合にDcCoreExceptionが発生すること. + * Typeがnullの場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void Typeがnullの場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void Typeがnullの場合にPersoniumCoreExceptionが発生すること() { this.setDefaultValue(ReceivedMessage.P_TYPE.build(), ReceivedMessage.P_TYPE.getName(), OProperties.string(ReceivedMessage.P_TYPE.getName(), "")); } /** - * Titleが0文字の場合にDcCoreExceptionが発生しないこと. + * Titleが0文字の場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void Titleが0文字の場合にDcCoreExceptionが発生しないこと() { + public final void Titleが0文字の場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty( ReceivedMessage.P_TITLE.build(), ReceivedMessage.P_TITLE.getName(), @@ -217,10 +217,10 @@ public ReceivedMessageValidateTest() { } /** - * Titleが256文字の場合にDcCoreExceptionが発生しないこと. + * Titleが256文字の場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void Titleが256文字の場合にDcCoreExceptionが発生しないこと() { + public final void Titleが256文字の場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty( ReceivedMessage.P_TITLE.build(), ReceivedMessage.P_TITLE.getName(), @@ -229,10 +229,10 @@ public ReceivedMessageValidateTest() { } /** - * Titleが257文字の場合にDcCoreExceptionが発生すること. + * Titleが257文字の場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void Titleが257文字の場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void Titleが257文字の場合にPersoniumCoreExceptionが発生すること() { this.validateProperty( ReceivedMessage.P_TITLE.build(), ReceivedMessage.P_TITLE.getName(), @@ -241,20 +241,20 @@ public ReceivedMessageValidateTest() { } /** - * Titleがnullの場合にDcCoreExceptionが発生すること. + * Titleがnullの場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void Titleがnullの場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void Titleがnullの場合にPersoniumCoreExceptionが発生すること() { this.setDefaultValue(ReceivedMessage.P_TITLE.build(), ReceivedMessage.P_TITLE.getName(), OProperties.string(ReceivedMessage.P_TITLE.getName(), "")); } /** - * Priorityが0の場合にDcCoreExceptionが発生すること. + * Priorityが0の場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void Priorityが0の場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void Priorityが0の場合にPersoniumCoreExceptionが発生すること() { this.validateProperty( ReceivedMessage.P_PRIORITY.build(), ReceivedMessage.P_PRIORITY.getName(), @@ -262,60 +262,60 @@ public ReceivedMessageValidateTest() { } /** - * Priorityが1の場合にDcCoreExceptionが発生しないこと. + * Priorityが1の場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void Priorityが1の場合にDcCoreExceptionが発生しないこと() { + public final void Priorityが1の場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty(ReceivedMessage.P_PRIORITY.build(), ReceivedMessage.P_PRIORITY.getName(), OProperties.int32(ReceivedMessage.P_PRIORITY.getName(), 1)); } /** - * Priorityが2の場合にDcCoreExceptionが発生しないこと. + * Priorityが2の場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void Priorityが2の場合にDcCoreExceptionが発生しないこと() { + public final void Priorityが2の場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty(ReceivedMessage.P_PRIORITY.build(), ReceivedMessage.P_PRIORITY.getName(), OProperties.int32(ReceivedMessage.P_PRIORITY.getName(), 2)); } /** - * Priorityが3の場合にDcCoreExceptionが発生しないこと. + * Priorityが3の場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void Priorityが3の場合にDcCoreExceptionが発生しないこと() { + public final void Priorityが3の場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty(ReceivedMessage.P_PRIORITY.build(), ReceivedMessage.P_PRIORITY.getName(), OProperties.int32(ReceivedMessage.P_PRIORITY.getName(), 3)); } /** - * Priorityが4の場合にDcCoreExceptionが発生しないこと. + * Priorityが4の場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void Priorityが4の場合にDcCoreExceptionが発生しないこと() { + public final void Priorityが4の場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty(ReceivedMessage.P_PRIORITY.build(), ReceivedMessage.P_PRIORITY.getName(), OProperties.int32(ReceivedMessage.P_PRIORITY.getName(), 4)); } /** - * Priorityが5の場合にDcCoreExceptionが発生しないこと. + * Priorityが5の場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void Priorityが5の場合にDcCoreExceptionが発生しないこと() { + public final void Priorityが5の場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty(ReceivedMessage.P_PRIORITY.build(), ReceivedMessage.P_PRIORITY.getName(), OProperties.int32(ReceivedMessage.P_PRIORITY.getName(), 5)); } /** - * Priorityが6の場合にDcCoreExceptionが発生すること. + * Priorityが6の場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void Priorityが6の場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void Priorityが6の場合にPersoniumCoreExceptionが発生すること() { this.validateProperty( ReceivedMessage.P_PRIORITY.build(), ReceivedMessage.P_PRIORITY.getName(), @@ -323,30 +323,30 @@ public ReceivedMessageValidateTest() { } /** - * Priorityがnullの場合にDcCoreExceptionが発生すること. + * Priorityがnullの場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void Priorityがnullの場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void Priorityがnullの場合にPersoniumCoreExceptionが発生すること() { this.setDefaultValue(ReceivedMessage.P_PRIORITY.build(), ReceivedMessage.P_PRIORITY.getName(), OProperties.string(ReceivedMessage.P_PRIORITY.getName(), "")); } /** - * RequestRelationがURL形式の場合にDcCoreExceptionが発生しないこと. + * RequestRelationがURL形式の場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void RequestRelationがURL形式の場合にDcCoreExceptionが発生しないこと() { + public final void RequestRelationがURL形式の場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty(ReceivedMessage.P_REQUEST_RELATION.build(), ReceivedMessage.P_REQUEST_RELATION.getName(), OProperties.string(ReceivedMessage.P_REQUEST_RELATION.getName(), "http://example.com/test")); } /** - * RequestRelationがURL形式でない場合にDcCoreExceptionが発生すること. + * RequestRelationがURL形式でない場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void RequestRelationがURL形式でない場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void RequestRelationがURL形式でない場合にPersoniumCoreExceptionが発生すること() { this.validateProperty(ReceivedMessage.P_REQUEST_RELATION.build(), ReceivedMessage.P_REQUEST_RELATION.getName(), OProperties.string(ReceivedMessage.P_REQUEST_RELATION.getName(), "ftp://example.com/test")); @@ -365,20 +365,20 @@ public ReceivedMessageValidateTest() { } /** - * RequestRelationTargetがURL形式の場合にDcCoreExceptionが発生しないこと. + * RequestRelationTargetがURL形式の場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void RequestRelationTargetがURL形式の場合にDcCoreExceptionが発生しないこと() { + public final void RequestRelationTargetがURL形式の場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty(ReceivedMessage.P_REQUEST_RELATION_TARGET.build(), ReceivedMessage.P_REQUEST_RELATION_TARGET.getName(), OProperties.string(ReceivedMessage.P_REQUEST_RELATION_TARGET.getName(), "http://example.com/test")); } /** - * RequestRelationTargetがURL形式でない場合にDcCoreExceptionが発生すること. + * RequestRelationTargetがURL形式でない場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void RequestRelationTargetがURL形式でない場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void RequestRelationTargetがURL形式でない場合にPersoniumCoreExceptionが発生すること() { this.validateProperty(ReceivedMessage.P_REQUEST_RELATION_TARGET.build(), ReceivedMessage.P_REQUEST_RELATION_TARGET.getName(), OProperties.string(ReceivedMessage.P_REQUEST_RELATION_TARGET.getName(), "ftp://example.com/test")); @@ -398,45 +398,45 @@ public ReceivedMessageValidateTest() { } /** - * MulticastToがURL形式の場合にDcCoreExceptionが発生しないこと. + * MulticastToがURL形式の場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void MulticastToがURL形式の場合にDcCoreExceptionが発生しないこと() { + public final void MulticastToがURL形式の場合にPersoniumCoreExceptionが発生しないこと() { MessageODataResource.validateUriCsv(ReceivedMessage.P_MULTICAST_TO.getName(), "http://example.com/test"); } /** - * MulticastToがCSV複数URL形式の場合にDcCoreExceptionが発生しないこと. + * MulticastToがCSV複数URL形式の場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void MulticastToがCSV複数URL形式の場合にDcCoreExceptionが発生しないこと() { + public final void MulticastToがCSV複数URL形式の場合にPersoniumCoreExceptionが発生しないこと() { MessageODataResource.validateUriCsv(ReceivedMessage.P_MULTICAST_TO.getName(), "http://example.com/test,http://example.com/test"); } /** - * MulticastToがURL形式でない場合にDcCoreExceptionが発生すること. + * MulticastToがURL形式でない場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void MulticastToがURL形式でない場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void MulticastToがURL形式でない場合にPersoniumCoreExceptionが発生すること() { MessageODataResource.validateUriCsv(ReceivedMessage.P_MULTICAST_TO.getName(), "ftp://example.com/test"); } /** - * MulticastToがCSV複数URL形式とURL形式でない場合にDcCoreExceptionが発生すること. + * MulticastToがCSV複数URL形式とURL形式でない場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void MulticastToがCSV複数URL形式とURL形式でない場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void MulticastToがCSV複数URL形式とURL形式でない場合にPersoniumCoreExceptionが発生すること() { MessageODataResource.validateUriCsv(ReceivedMessage.P_MULTICAST_TO.getName(), "http://example.com/test,ftp://example.com/test"); } /** - * MulticastToが不正なCSV形式の場合にDcCoreExceptionが発生すること. + * MulticastToが不正なCSV形式の場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void MulticastToが不正なCSV形式の場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void MulticastToが不正なCSV形式の場合にPersoniumCoreExceptionが発生すること() { MessageODataResource.validateUriCsv(ReceivedMessage.P_MULTICAST_TO.getName(), "http://example.com/test,,http://example.com/test"); } @@ -454,82 +454,82 @@ public ReceivedMessageValidateTest() { } /** - * TypeがmessageでStatusがunreadの場合にDcCoreExceptionが発生しないこと. + * TypeがmessageでStatusがunreadの場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void TypeがmessageでStatusがunreadの場合にDcCoreExceptionが発生しないこと() { + public final void TypeがmessageでStatusがunreadの場合にPersoniumCoreExceptionが発生しないこと() { MessageODataResource.validateStatus("message", "unread"); } /** - * TypeがmessageでStatusがnoneの場合にDcCoreExceptionが発生すること. + * TypeがmessageでStatusがnoneの場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void TypeがmessageでStatusがnoneの場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void TypeがmessageでStatusがnoneの場合にPersoniumCoreExceptionが発生すること() { MessageODataResource.validateStatus("message", "none"); } /** - * Typeがreq.relation.buildでStatusがnoneの場合にDcCoreExceptionが発生しないこと. + * Typeがreq.relation.buildでStatusがnoneの場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void Typeがreq_relation_buildでStatusがnoneの場合にDcCoreExceptionが発生しないこと() { + public final void Typeがreq_relation_buildでStatusがnoneの場合にPersoniumCoreExceptionが発生しないこと() { MessageODataResource.validateStatus("req.relation.build", "none"); } /** - * Typeがreq.relation.breakでStatusがnoneの場合にDcCoreExceptionが発生しないこと. + * Typeがreq.relation.breakでStatusがnoneの場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void Typeがreq_relation_breakでStatusがnoneの場合にDcCoreExceptionが発生しないこと() { + public final void Typeがreq_relation_breakでStatusがnoneの場合にPersoniumCoreExceptionが発生しないこと() { MessageODataResource.validateStatus("req.relation.break", "none"); } /** - * Typeがreq.relation.buildでStatusがunreadの場合にDcCoreExceptionが発生すること. + * Typeがreq.relation.buildでStatusがunreadの場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void Typeがreq_relation_buildでStatusがunreadの場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void Typeがreq_relation_buildでStatusがunreadの場合にPersoniumCoreExceptionが発生すること() { MessageODataResource.validateStatus("req.relation.build", "unread"); } /** - * Typeがreq.relation.breakでStatusがunreadの場合にDcCoreExceptionが発生すること. + * Typeがreq.relation.breakでStatusがunreadの場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void Typeがreq_relation_breakでStatusがunreadの場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void Typeがreq_relation_breakでStatusがunreadの場合にPersoniumCoreExceptionが発生すること() { MessageODataResource.validateStatus("req.relation.break", "unread"); } /** - * Typeがreq.relation.breakでRequestRelationとRequestRelationTargetの指定がある場合にDcCoreExceptionが発生しないこと. + * Typeがreq.relation.breakでRequestRelationとRequestRelationTargetの指定がある場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void Typeがreq_relation_breakでRequestRelationとRequestRelationTargetの指定がある場合にDcCoreExceptionが発生しないこと() { + public final void Typeがreq_relation_breakでRequestRelationとRequestRelationTargetの指定がある場合にPersoniumCoreExceptionが発生しないこと() { MessageODataResource.validateReqRelation("req.relation.break", "http://xxx.com/xx", "http://xxx.com/xx"); } /** - * Typeがreq.relation.breakでRequestRelationがnullの場合にDcCoreExceptionが発生すること. + * Typeがreq.relation.breakでRequestRelationがnullの場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void Typeがreq_relation_breakでRequestRelationがnullの場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void Typeがreq_relation_breakでRequestRelationがnullの場合にPersoniumCoreExceptionが発生すること() { MessageODataResource.validateReqRelation("req.relation.break", null, "http://example.com/test"); } /** - * Typeがreq.relation.breakでRequestRelationTargetがnullの場合にDcCoreExceptionが発生すること. + * Typeがreq.relation.breakでRequestRelationTargetがnullの場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void Typeがreq_relation_breakでRequestRelationTargetがnullの場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void Typeがreq_relation_breakでRequestRelationTargetがnullの場合にPersoniumCoreExceptionが発生すること() { MessageODataResource.validateReqRelation("req.relation.break", "http://example.com/test", null); } /** - * TypeがmessageでRequestRelationがnullの場合にDcCoreExceptionが発生しないこと. + * TypeがmessageでRequestRelationがnullの場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void TypeがmessageでRequestRelationがnullの場合にDcCoreExceptionが発生しないこと() { + public final void TypeがmessageでRequestRelationがnullの場合にPersoniumCoreExceptionが発生しないこと() { MessageODataResource.validateReqRelation("message", null, "http://example.com/test"); } diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/rs/odata/validate/SentMessageValidateTest.java b/src/test/java/io/personium/test/unit/core/rs/odata/validate/SentMessageValidateTest.java similarity index 67% rename from src/test/java/com/fujitsu/dc/test/unit/core/rs/odata/validate/SentMessageValidateTest.java rename to src/test/java/io/personium/test/unit/core/rs/odata/validate/SentMessageValidateTest.java index 84a8d4373..503c511a3 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/rs/odata/validate/SentMessageValidateTest.java +++ b/src/test/java/io/personium/test/unit/core/rs/odata/validate/SentMessageValidateTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.rs.odata.validate; +package io.personium.test.unit.core.rs.odata.validate; import static org.junit.Assert.assertEquals; @@ -24,14 +24,14 @@ import org.odata4j.core.OProperty; import org.odata4j.edm.EdmSimpleType; -import com.fujitsu.dc.core.DcCoreException; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.model.ctl.ReceivedMessage; -import com.fujitsu.dc.core.model.ctl.SentMessage; -import com.fujitsu.dc.core.rs.cell.MessageODataResource; -import com.fujitsu.dc.core.rs.odata.AbstractODataResource; -import com.fujitsu.dc.test.categories.Unit; -import com.fujitsu.dc.test.jersey.AbstractCase; +import io.personium.core.PersoniumCoreException; +import io.personium.core.model.ctl.Common; +import io.personium.core.model.ctl.ReceivedMessage; +import io.personium.core.model.ctl.SentMessage; +import io.personium.core.rs.cell.MessageODataResource; +import io.personium.core.rs.odata.AbstractODataResource; +import io.personium.test.categories.Unit; +import io.personium.test.jersey.AbstractCase; /** * Message送信バリデートテスト. @@ -45,30 +45,30 @@ public SentMessageValidateTest() { } /** - * InReplyToが31文字の場合にDcCoreExceptionが発生すること. + * InReplyToが31文字の場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void InReplyToが31文字の場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void InReplyToが31文字の場合にPersoniumCoreExceptionが発生すること() { this.validateProperty(SentMessage.P_IN_REPLY_TO.build(), SentMessage.P_IN_REPLY_TO.getName(), OProperties.string(SentMessage.P_IN_REPLY_TO.getName(), "1234567890123456789012345678901")); } /** - * InReplyToが32文字の場合にDcCoreExceptionが発生しないこと. + * InReplyToが32文字の場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void InReplyToが32文字の場合にDcCoreExceptionが発生しないこと() { + public final void InReplyToが32文字の場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty(SentMessage.P_IN_REPLY_TO.build(), SentMessage.P_IN_REPLY_TO.getName(), OProperties.string(SentMessage.P_IN_REPLY_TO.getName(), "12345678901234567890123456789012")); } /** - * InReplyToが33文字の場合にDcCoreExceptionが発生すること. + * InReplyToが33文字の場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void InReplyToが33文字の場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void InReplyToが33文字の場合にPersoniumCoreExceptionが発生すること() { this.validateProperty(SentMessage.P_IN_REPLY_TO.build(), SentMessage.P_IN_REPLY_TO.getName(), OProperties.string(SentMessage.P_IN_REPLY_TO.getName(), "123456789012345678901234567890123")); @@ -88,45 +88,45 @@ public SentMessageValidateTest() { } /** - * ToがURL形式の場合にDcCoreExceptionが発生しないこと. + * ToがURL形式の場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void ToがURL形式の場合にDcCoreExceptionが発生しないこと() { + public final void ToがURL形式の場合にPersoniumCoreExceptionが発生しないこと() { MessageODataResource.validateUriCsv(SentMessage.P_TO.getName(), "http://example.com/test"); } /** - * ToがCSV複数URL形式の場合にDcCoreExceptionが発生しないこと. + * ToがCSV複数URL形式の場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void ToがCSV複数URL形式の場合にDcCoreExceptionが発生しないこと() { + public final void ToがCSV複数URL形式の場合にPersoniumCoreExceptionが発生しないこと() { MessageODataResource.validateUriCsv(SentMessage.P_TO.getName(), "http://example.com/test,http://example.com/test"); } /** - * ToがURL形式でない場合にDcCoreExceptionが発生すること. + * ToがURL形式でない場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void ToがURL形式でない場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void ToがURL形式でない場合にPersoniumCoreExceptionが発生すること() { MessageODataResource.validateUriCsv(SentMessage.P_TO.getName(), "ftp://example.com/test"); } /** - * ToがCSV複数URL形式とURL形式でない場合にDcCoreExceptionが発生すること. + * ToがCSV複数URL形式とURL形式でない場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void ToがCSV複数URL形式とURL形式でない場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void ToがCSV複数URL形式とURL形式でない場合にPersoniumCoreExceptionが発生すること() { MessageODataResource.validateUriCsv(SentMessage.P_TO.getName(), "http://example.com/test,ftp://example.com/test"); } /** - * Toが不正なCSV形式の場合にDcCoreExceptionが発生すること. + * Toが不正なCSV形式の場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void Toが不正なCSV形式の場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void Toが不正なCSV形式の場合にPersoniumCoreExceptionが発生すること() { MessageODataResource.validateUriCsv(SentMessage.P_TO.getName(), "http://example.com/test,,http://example.com/test"); } @@ -144,10 +144,10 @@ public SentMessageValidateTest() { } /** - * ToRelationが0文字の場合にDcCoreExceptionが発生すること. + * ToRelationが0文字の場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void ToRelationが0文字の場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void ToRelationが0文字の場合にPersoniumCoreExceptionが発生すること() { this.validateProperty( SentMessage.P_TO_RELATION.build(), SentMessage.P_TO_RELATION.getName(), @@ -155,10 +155,10 @@ public SentMessageValidateTest() { } /** - * ToRelationが1文字の場合にDcCoreExceptionが発生しないこと. + * ToRelationが1文字の場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void ToRelationが1文字の場合にDcCoreExceptionが発生しないこと() { + public final void ToRelationが1文字の場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty( SentMessage.P_TO_RELATION.build(), SentMessage.P_TO_RELATION.getName(), @@ -166,10 +166,10 @@ public SentMessageValidateTest() { } /** - * ToRelationが128文字の場合にDcCoreExceptionが発生しないこと. + * ToRelationが128文字の場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void ToRelationが128文字の場合にDcCoreExceptionが発生しないこと() { + public final void ToRelationが128文字の場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty( SentMessage.P_TO_RELATION.build(), SentMessage.P_TO_RELATION.getName(), @@ -177,10 +177,10 @@ public SentMessageValidateTest() { } /** - * ToRelationが129文字の場合にDcCoreExceptionが発生すること. + * ToRelationが129文字の場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void ToRelationが129文字の場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void ToRelationが129文字の場合にPersoniumCoreExceptionが発生すること() { this.validateProperty( SentMessage.P_TO_RELATION.build(), SentMessage.P_TO_RELATION.getName(), @@ -188,10 +188,10 @@ public SentMessageValidateTest() { } /** - * ToRelationが使用可能な文字種の場合にDcCoreExceptionが発生しないこと. + * ToRelationが使用可能な文字種の場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void ToRelationが使用可能な文字種の場合にDcCoreExceptionが発生しないこと() { + public final void ToRelationが使用可能な文字種の場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty( SentMessage.P_TO_RELATION.build(), SentMessage.P_TO_RELATION.getName(), @@ -199,10 +199,10 @@ public SentMessageValidateTest() { } /** - * ToRelationがアンダーバー始まりの場合にDcCoreExceptionが発生すること. + * ToRelationがアンダーバー始まりの場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void ToRelationがアンダーバー始まりの場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void ToRelationがアンダーバー始まりの場合にPersoniumCoreExceptionが発生すること() { this.validateProperty( SentMessage.P_TO_RELATION.build(), SentMessage.P_TO_RELATION.getName(), @@ -210,10 +210,10 @@ public SentMessageValidateTest() { } /** - * ToRelationがコロン始まりの場合にDcCoreExceptionが発生すること. + * ToRelationがコロン始まりの場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void ToRelationがコロン始まりの場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void ToRelationがコロン始まりの場合にPersoniumCoreExceptionが発生すること() { this.validateProperty( SentMessage.P_TO_RELATION.build(), SentMessage.P_TO_RELATION.getName(), @@ -233,40 +233,40 @@ public SentMessageValidateTest() { } /** - * Typeがmessageの場合にDcCoreExceptionが発生しないこと. + * Typeがmessageの場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void Typeがmessageの場合にDcCoreExceptionが発生しないこと() { + public final void Typeがmessageの場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty(SentMessage.P_TYPE.build(), SentMessage.P_TYPE.getName(), OProperties.string(SentMessage.P_TYPE.getName(), "message")); } /** - * Typeがreq.relation.buildの場合にDcCoreExceptionが発生しないこと. + * Typeがreq.relation.buildの場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void Typeがreq_relation_buildの場合にDcCoreExceptionが発生しないこと() { + public final void Typeがreq_relation_buildの場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty(SentMessage.P_TYPE.build(), SentMessage.P_TYPE.getName(), OProperties.string(SentMessage.P_TYPE.getName(), "req.relation.build")); } /** - * Typeがreq.relation.breakの場合にDcCoreExceptionが発生しないこと. + * Typeがreq.relation.breakの場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void Typeがreq_relation_breakの場合にDcCoreExceptionが発生しないこと() { + public final void Typeがreq_relation_breakの場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty(SentMessage.P_TYPE.build(), SentMessage.P_TYPE.getName(), OProperties.string(SentMessage.P_TYPE.getName(), "req.relation.break")); } /** - * Typeがsocial_messageの場合にDcCoreExceptionが発生すること. + * Typeがsocial_messageの場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void Typeがsocial_messageの場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void Typeがsocial_messageの場合にPersoniumCoreExceptionが発生すること() { this.validateProperty(SentMessage.P_TYPE.build(), SentMessage.P_TYPE.getName(), OProperties.string(SentMessage.P_TYPE.getName(), "social.message")); @@ -285,10 +285,10 @@ public SentMessageValidateTest() { } /** - * Titleが0文字の場合にDcCoreExceptionが発生しないこと. + * Titleが0文字の場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void Titleが0文字の場合にDcCoreExceptionが発生しないこと() { + public final void Titleが0文字の場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty( SentMessage.P_TITLE.build(), SentMessage.P_TITLE.getName(), @@ -296,10 +296,10 @@ public SentMessageValidateTest() { } /** - * Titleが256文字の場合にDcCoreExceptionが発生しないこと. + * Titleが256文字の場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void Titleが256文字の場合にDcCoreExceptionが発生しないこと() { + public final void Titleが256文字の場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty( SentMessage.P_TITLE.build(), SentMessage.P_TITLE.getName(), @@ -308,10 +308,10 @@ public SentMessageValidateTest() { } /** - * Titleが257文字の場合にDcCoreExceptionが発生すること. + * Titleが257文字の場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void Titleが257文字の場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void Titleが257文字の場合にPersoniumCoreExceptionが発生すること() { this.validateProperty( SentMessage.P_TITLE.build(), SentMessage.P_TITLE.getName(), @@ -344,19 +344,19 @@ public SentMessageValidateTest() { } /** - * Bodyが0byteの場合にDcCoreExceptionが発生しないこと. + * Bodyが0byteの場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void Bodyが0byteの場合にDcCoreExceptionが発生しないこと() { + public final void Bodyが0byteの場合にPersoniumCoreExceptionが発生しないこと() { String body = ""; MessageODataResource.validateBody(body, Common.MAX_MESSAGE_BODY_LENGTH); } /** - * Bodyが64Kbyteの場合にDcCoreExceptionが発生しないこと. + * Bodyが64Kbyteの場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void Bodyが64Kbyteの場合にDcCoreExceptionが発生しないこと() { + public final void Bodyが64Kbyteの場合にPersoniumCoreExceptionが発生しないこと() { char[] buff = new char[65536]; for (int i = 0; i < buff.length; i++) { buff[i] = 0x41; @@ -367,10 +367,10 @@ public SentMessageValidateTest() { } /** - * Bodyが64Kbyteを超える場合にDcCoreExceptionが発生すること. + * Bodyが64Kbyteを超える場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void Bodyが64Kbyteを超える場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void Bodyが64Kbyteを超える場合にPersoniumCoreExceptionが発生すること() { char[] buff = new char[65537]; for (int i = 0; i < buff.length; i++) { buff[i] = 0x41; @@ -381,10 +381,10 @@ public SentMessageValidateTest() { } /** - * Priorityが0の場合にDcCoreExceptionが発生すること. + * Priorityが0の場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void Priorityが0の場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void Priorityが0の場合にPersoniumCoreExceptionが発生すること() { this.validateProperty( SentMessage.P_PRIORITY.build(), SentMessage.P_PRIORITY.getName(), @@ -392,60 +392,60 @@ public SentMessageValidateTest() { } /** - * Priorityが1の場合にDcCoreExceptionが発生しないこと. + * Priorityが1の場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void Priorityが1の場合にDcCoreExceptionが発生しないこと() { + public final void Priorityが1の場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty(SentMessage.P_PRIORITY.build(), SentMessage.P_PRIORITY.getName(), OProperties.int32(SentMessage.P_PRIORITY.getName(), 1)); } /** - * Priorityが2の場合にDcCoreExceptionが発生しないこと. + * Priorityが2の場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void Priorityが2の場合にDcCoreExceptionが発生しないこと() { + public final void Priorityが2の場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty(SentMessage.P_PRIORITY.build(), SentMessage.P_PRIORITY.getName(), OProperties.int32(SentMessage.P_PRIORITY.getName(), 2)); } /** - * Priorityが3の場合にDcCoreExceptionが発生しないこと. + * Priorityが3の場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void Priorityが3の場合にDcCoreExceptionが発生しないこと() { + public final void Priorityが3の場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty(SentMessage.P_PRIORITY.build(), SentMessage.P_PRIORITY.getName(), OProperties.int32(SentMessage.P_PRIORITY.getName(), 3)); } /** - * Priorityが4の場合にDcCoreExceptionが発生しないこと. + * Priorityが4の場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void Priorityが4の場合にDcCoreExceptionが発生しないこと() { + public final void Priorityが4の場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty(SentMessage.P_PRIORITY.build(), SentMessage.P_PRIORITY.getName(), OProperties.int32(SentMessage.P_PRIORITY.getName(), 4)); } /** - * Priorityが5の場合にDcCoreExceptionが発生しないこと. + * Priorityが5の場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void Priorityが5の場合にDcCoreExceptionが発生しないこと() { + public final void Priorityが5の場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty(SentMessage.P_PRIORITY.build(), SentMessage.P_PRIORITY.getName(), OProperties.int32(SentMessage.P_PRIORITY.getName(), 5)); } /** - * Priorityが6の場合にDcCoreExceptionが発生すること. + * Priorityが6の場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void Priorityが6の場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void Priorityが6の場合にPersoniumCoreExceptionが発生すること() { this.validateProperty( SentMessage.P_PRIORITY.build(), SentMessage.P_PRIORITY.getName(), @@ -465,20 +465,20 @@ public SentMessageValidateTest() { } /** - * RequestRelationがURL形式の場合にDcCoreExceptionが発生しないこと. + * RequestRelationがURL形式の場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void RequestRelationがURL形式の場合にDcCoreExceptionが発生しないこと() { + public final void RequestRelationがURL形式の場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty(SentMessage.P_REQUEST_RELATION.build(), SentMessage.P_REQUEST_RELATION.getName(), OProperties.string(SentMessage.P_REQUEST_RELATION.getName(), "http://example.com/test")); } /** - * RequestRelationがURL形式でない場合にDcCoreExceptionが発生すること. + * RequestRelationがURL形式でない場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void RequestRelationがURL形式でない場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void RequestRelationがURL形式でない場合にPersoniumCoreExceptionが発生すること() { this.validateProperty(SentMessage.P_REQUEST_RELATION.build(), SentMessage.P_REQUEST_RELATION.getName(), OProperties.string(SentMessage.P_REQUEST_RELATION.getName(), "ftp://example.com/test")); @@ -497,20 +497,20 @@ public SentMessageValidateTest() { } /** - * RequestRelationTargetがURL形式の場合にDcCoreExceptionが発生しないこと. + * RequestRelationTargetがURL形式の場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void RequestRelationTargetがURL形式の場合にDcCoreExceptionが発生しないこと() { + public final void RequestRelationTargetがURL形式の場合にPersoniumCoreExceptionが発生しないこと() { this.validateProperty(SentMessage.P_REQUEST_RELATION_TARGET.build(), SentMessage.P_REQUEST_RELATION_TARGET.getName(), OProperties.string(SentMessage.P_REQUEST_RELATION_TARGET.getName(), "http://example.com/test")); } /** - * RequestRelationTargetがURL形式でない場合にDcCoreExceptionが発生すること. + * RequestRelationTargetがURL形式でない場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void RequestRelationTargetがURL形式でない場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void RequestRelationTargetがURL形式でない場合にPersoniumCoreExceptionが発生すること() { this.validateProperty(SentMessage.P_REQUEST_RELATION_TARGET.build(), SentMessage.P_REQUEST_RELATION_TARGET.getName(), OProperties.string(SentMessage.P_REQUEST_RELATION_TARGET.getName(), "ftp://example.com/test")); @@ -530,10 +530,10 @@ public SentMessageValidateTest() { } /** - * ToもToRelationも存在しない場合にDcCoreExceptionが発生すること. + * ToもToRelationも存在しない場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void ToもToRelationも存在しない場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void ToもToRelationも存在しない場合にPersoniumCoreExceptionが発生すること() { String to = (String) OProperties.null_(SentMessage.P_TO.getName(), EdmSimpleType.STRING).getValue(); String toRelation = (String) OProperties.null_(SentMessage.P_TO_RELATION.getName(), @@ -542,10 +542,10 @@ public SentMessageValidateTest() { } /** - * ToがあってToRelationがない場合にDcCoreExceptionが発生しないこと. + * ToがあってToRelationがない場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void ToがあってToRelationがない場合にDcCoreExceptionが発生しないこと() { + public final void ToがあってToRelationがない場合にPersoniumCoreExceptionが発生しないこと() { String to = "http://example.com/toAddress"; String toRelation = (String) OProperties.null_(SentMessage.P_TO_RELATION.getName(), EdmSimpleType.STRING).getValue(); @@ -553,10 +553,10 @@ public SentMessageValidateTest() { } /** - * ToがなくてToRelationがある場合にDcCoreExceptionが発生しないこと. + * ToがなくてToRelationがある場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void ToがなくてToRelationがある場合にDcCoreExceptionが発生しないこと() { + public final void ToがなくてToRelationがある場合にPersoniumCoreExceptionが発生しないこと() { String to = (String) OProperties.null_(SentMessage.P_TO.getName(), EdmSimpleType.STRING).getValue(); String toRelation = "http://example.com/toRelation"; @@ -564,20 +564,20 @@ public SentMessageValidateTest() { } /** - * ToとToRelationが両方ある場合にDcCoreExceptionが発生しないこと. + * ToとToRelationが両方ある場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void ToとToRelationが両方ある場合にDcCoreExceptionが発生しないこと() { + public final void ToとToRelationが両方ある場合にPersoniumCoreExceptionが発生しないこと() { String to = "http://example.com/toAddress"; String toRelation = "http://example.com/toRelation"; MessageODataResource.validateToAndToRelation(to, toRelation); } /** - * Typeが関係登録依頼でRequestRelationがない場合にDcCoreExceptionが発生すること. + * Typeが関係登録依頼でRequestRelationがない場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void Typeが関係登録依頼でRequestRelationがない場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void Typeが関係登録依頼でRequestRelationがない場合にPersoniumCoreExceptionが発生すること() { String type = ReceivedMessage.TYPE_REQ_RELATION_BUILD; String requestRelation = (String) OProperties.null_( SentMessage.P_REQUEST_RELATION.getName(), @@ -587,10 +587,10 @@ public SentMessageValidateTest() { } /** - * Typeが関係登録依頼でRequestRelationがある場合にDcCoreExceptionが発生しないこと. + * Typeが関係登録依頼でRequestRelationがある場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void Typeが関係登録依頼でRequestRelationがある場合にDcCoreExceptionが発生しないこと() { + public final void Typeが関係登録依頼でRequestRelationがある場合にPersoniumCoreExceptionが発生しないこと() { String type = ReceivedMessage.TYPE_REQ_RELATION_BUILD; String requestRelation = "http://example.com/reqRelation"; String requestRelationTarget = "http://example.com/reqRelation"; @@ -598,10 +598,10 @@ public SentMessageValidateTest() { } /** - * Typeが関係削除依頼でRequestRelationがない場合にDcCoreExceptionが発生すること. + * Typeが関係削除依頼でRequestRelationがない場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void Typeが関係削除依頼でRequestRelationがない場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void Typeが関係削除依頼でRequestRelationがない場合にPersoniumCoreExceptionが発生すること() { String type = ReceivedMessage.TYPE_REQ_RELATION_BREAK; String requestRelation = (String) OProperties.null_( SentMessage.P_REQUEST_RELATION.getName(), @@ -611,10 +611,10 @@ public SentMessageValidateTest() { } /** - * Typeが関係削除依頼でRequestRelationがある場合にDcCoreExceptionが発生しないこと. + * Typeが関係削除依頼でRequestRelationがある場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void Typeが関係削除依頼でRequestRelationがある場合にDcCoreExceptionが発生しないこと() { + public final void Typeが関係削除依頼でRequestRelationがある場合にPersoniumCoreExceptionが発生しないこと() { String type = ReceivedMessage.TYPE_REQ_RELATION_BREAK; String requestRelation = "http://example.com/reqRelation"; String requestRelationTarget = "http://example.com/reqRelation"; @@ -622,10 +622,10 @@ public SentMessageValidateTest() { } /** - * Typeが関係登録依頼でRequestRelationTargetがない場合にDcCoreExceptionが発生すること. + * Typeが関係登録依頼でRequestRelationTargetがない場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void Typeが関係登録依頼でRequestRelationTargetがない場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void Typeが関係登録依頼でRequestRelationTargetがない場合にPersoniumCoreExceptionが発生すること() { String type = ReceivedMessage.TYPE_REQ_RELATION_BUILD; String requestRelation = "http://example.com/reqRelation"; String requestRelationTarget = (String) OProperties.null_( @@ -635,10 +635,10 @@ public SentMessageValidateTest() { } /** - * Typeが関係登録依頼でRequestRelationTargetがある場合にDcCoreExceptionが発生しないこと. + * Typeが関係登録依頼でRequestRelationTargetがある場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void Typeが関係登録依頼でRequestRelationTargetがある場合にDcCoreExceptionが発生しないこと() { + public final void Typeが関係登録依頼でRequestRelationTargetがある場合にPersoniumCoreExceptionが発生しないこと() { String type = ReceivedMessage.TYPE_REQ_RELATION_BUILD; String requestRelation = "http://example.com/reqRelation"; String requestRelationTarget = "http://example.com/reqRelation"; @@ -646,10 +646,10 @@ public SentMessageValidateTest() { } /** - * Typeが関係削除依頼でRequestRelationTargetがない場合にDcCoreExceptionが発生すること. + * Typeが関係削除依頼でRequestRelationTargetがない場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void Typeが関係削除依頼でRequestRelationTargetがない場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void Typeが関係削除依頼でRequestRelationTargetがない場合にPersoniumCoreExceptionが発生すること() { String type = ReceivedMessage.TYPE_REQ_RELATION_BREAK; String requestRelation = "http://example.com/reqRelation"; String requestRelationTarget = (String) OProperties.null_( @@ -659,10 +659,10 @@ public SentMessageValidateTest() { } /** - * Typeが関係削除依頼でRequestRelationTargetがある場合にDcCoreExceptionが発生しないこと. + * Typeが関係削除依頼でRequestRelationTargetがある場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void Typeが関係削除依頼でRequestRelationTargetがある場合にDcCoreExceptionが発生しないこと() { + public final void Typeが関係削除依頼でRequestRelationTargetがある場合にPersoniumCoreExceptionが発生しないこと() { String type = ReceivedMessage.TYPE_REQ_RELATION_BREAK; String requestRelation = "http://example.com/reqRelation"; String requestRelationTarget = "http://example.com/reqRelation"; @@ -670,19 +670,19 @@ public SentMessageValidateTest() { } /** - * 送信先URLが最大送信許可数を超えている場合にDcCoreExceptionが発生すること. + * 送信先URLが最大送信許可数を超えている場合にPersoniumCoreExceptionが発生すること. */ - @Test(expected = DcCoreException.class) - public final void 送信先URLが最大送信許可数を超えている場合にDcCoreExceptionが発生すること() { + @Test(expected = PersoniumCoreException.class) + public final void 送信先URLが最大送信許可数を超えている場合にPersoniumCoreExceptionが発生すること() { MessageODataResource mor = new MessageODataResource(null, null, null); mor.checkMaxDestinationsSize(1001); } /** - * 送信先URLが最大送信許可数を超えていない場合にDcCoreExceptionが発生しないこと. + * 送信先URLが最大送信許可数を超えていない場合にPersoniumCoreExceptionが発生しないこと. */ @Test - public final void 送信先URLが最大送信許可数を超えていない場合にDcCoreExceptionが発生しないこと() { + public final void 送信先URLが最大送信許可数を超えていない場合にPersoniumCoreExceptionが発生しないこと() { MessageODataResource mor = new MessageODataResource(null, null, null); mor.checkMaxDestinationsSize(1000); } diff --git a/src/test/java/io/personium/test/unit/core/rs/odata/validate/package-info.java b/src/test/java/io/personium/test/unit/core/rs/odata/validate/package-info.java new file mode 100644 index 000000000..c2aae730a --- /dev/null +++ b/src/test/java/io/personium/test/unit/core/rs/odata/validate/package-info.java @@ -0,0 +1,21 @@ +/** + * personium.io + * Copyright 2014 FUJITSU LIMITED + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * JUnit test. + */ +package io.personium.test.unit.core.rs.odata.validate; + diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/event/package-info.java b/src/test/java/io/personium/test/unit/core/rs/unit/package-info.java similarity index 90% rename from src/test/java/com/fujitsu/dc/test/unit/core/event/package-info.java rename to src/test/java/io/personium/test/unit/core/rs/unit/package-info.java index 818f8010c..31a4f16b8 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/event/package-info.java +++ b/src/test/java/io/personium/test/unit/core/rs/unit/package-info.java @@ -17,5 +17,5 @@ /** * JUnit test. */ -package com.fujitsu.dc.test.unit.core.event; +package io.personium.test.unit.core.rs.unit; diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/utils/AllTests.java b/src/test/java/io/personium/test/unit/core/utils/AllTests.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/unit/core/utils/AllTests.java rename to src/test/java/io/personium/test/unit/core/utils/AllTests.java index 6fed432f7..bc7d9e398 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/utils/AllTests.java +++ b/src/test/java/io/personium/test/unit/core/utils/AllTests.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.utils; +package io.personium.test.unit.core.utils; import org.junit.runner.RunWith; import org.junit.runners.Suite; diff --git a/src/test/java/com/fujitsu/dc/test/unit/core/utils/ResourceUtilTest.java b/src/test/java/io/personium/test/unit/core/utils/ResourceUtilTest.java similarity index 93% rename from src/test/java/com/fujitsu/dc/test/unit/core/utils/ResourceUtilTest.java rename to src/test/java/io/personium/test/unit/core/utils/ResourceUtilTest.java index bf46adb64..db8ab6753 100644 --- a/src/test/java/com/fujitsu/dc/test/unit/core/utils/ResourceUtilTest.java +++ b/src/test/java/io/personium/test/unit/core/utils/ResourceUtilTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.unit.core.utils; +package io.personium.test.unit.core.utils; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -22,8 +22,8 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import com.fujitsu.dc.core.utils.ResourceUtils; -import com.fujitsu.dc.test.categories.Unit; +import io.personium.core.utils.ResourceUtils; +import io.personium.test.categories.Unit; /** * ResourceUtilユニットテストクラス. diff --git a/src/test/java/com/fujitsu/dc/test/utils/AccountUtils.java b/src/test/java/io/personium/test/utils/AccountUtils.java similarity index 96% rename from src/test/java/com/fujitsu/dc/test/utils/AccountUtils.java rename to src/test/java/io/personium/test/utils/AccountUtils.java index efcd7abaa..75bdeab74 100644 --- a/src/test/java/com/fujitsu/dc/test/utils/AccountUtils.java +++ b/src/test/java/io/personium/test/utils/AccountUtils.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.utils; +package io.personium.test.utils; import static org.junit.Assert.assertEquals; @@ -23,8 +23,8 @@ import org.apache.http.HttpStatus; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.unit.core.UrlUtils; /** * Httpリクエストドキュメントを利用するユーティリティ. @@ -99,7 +99,7 @@ public static TResponse create(final String token, final String cellName, } /** - * X-Dc-Credentialヘッダー有でTypeを指定してアカウントを作成するユーティリティ. + * X-Personium-Credentialヘッダー有でTypeを指定してアカウントを作成するユーティリティ. * @param token トークン * @param typeName Type値 * @param cellName セル名 @@ -123,7 +123,7 @@ public static TResponse createWithType(final String token, final String cellName } /** - * X-Dc-Credentialヘッダー無しでアカウントを作成するユーティリティ. + * X-Personium-Credentialヘッダー無しでアカウントを作成するユーティリティ. * @param token トークン * @param cellName セル名 * @param userName ユーザ名 @@ -143,7 +143,7 @@ public static TResponse createNonCredential(final String token, final String cel } /** - * X-Dc-Credentialヘッダー無しでTypeを指定してアカウントを作成するユーティリティ. + * X-Personium-Credentialヘッダー無しでTypeを指定してアカウントを作成するユーティリティ. * @param token トークン * @param cellName セル名 * @param userName ユーザ名 diff --git a/src/test/java/com/fujitsu/dc/test/utils/AssociationEndUtils.java b/src/test/java/io/personium/test/utils/AssociationEndUtils.java similarity index 96% rename from src/test/java/com/fujitsu/dc/test/utils/AssociationEndUtils.java rename to src/test/java/io/personium/test/utils/AssociationEndUtils.java index b724e2072..ef9a5e123 100644 --- a/src/test/java/com/fujitsu/dc/test/utils/AssociationEndUtils.java +++ b/src/test/java/io/personium/test/utils/AssociationEndUtils.java @@ -14,16 +14,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.utils; +package io.personium.test.utils; import javax.ws.rs.core.MediaType; import org.apache.http.HttpStatus; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; /** * Odata関連のHttpリクエストドキュメントを利用するユーティリティ. @@ -196,7 +196,7 @@ public static TResponse createViaEntityTypeNP( .with("collection", collection) .with("accept", MediaType.APPLICATION_JSON) .with("contentType", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("name", associationEndName) .with("multiplicity", multiplicity) .with("entityTypeName", entityTypeName) diff --git a/src/test/java/com/fujitsu/dc/test/utils/BatchUtils.java b/src/test/java/io/personium/test/utils/BatchUtils.java similarity index 99% rename from src/test/java/com/fujitsu/dc/test/utils/BatchUtils.java rename to src/test/java/io/personium/test/utils/BatchUtils.java index a55f83962..86b9a9287 100644 --- a/src/test/java/com/fujitsu/dc/test/utils/BatchUtils.java +++ b/src/test/java/io/personium/test/utils/BatchUtils.java @@ -14,13 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.utils; +package io.personium.test.utils; import java.util.List; import org.json.simple.JSONObject; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.test.unit.core.UrlUtils; /** * $batch用のUtilクラス. diff --git a/src/test/java/com/fujitsu/dc/test/utils/BoxUtils.java b/src/test/java/io/personium/test/utils/BoxUtils.java similarity index 89% rename from src/test/java/com/fujitsu/dc/test/utils/BoxUtils.java rename to src/test/java/io/personium/test/utils/BoxUtils.java index 29fb2573f..5a0e51b4c 100644 --- a/src/test/java/com/fujitsu/dc/test/utils/BoxUtils.java +++ b/src/test/java/io/personium/test/utils/BoxUtils.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.utils; +package io.personium.test.utils; import static org.junit.Assert.assertEquals; @@ -26,10 +26,10 @@ import org.apache.http.HttpHeaders; import org.apache.http.HttpStatus; -import com.fujitsu.dc.test.jersey.DcException; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRestAdapter; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.test.jersey.PersoniumException; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumRestAdapter; +import io.personium.test.unit.core.UrlUtils; /** * Httpリクエストドキュメントを利用するユーティリティ. @@ -62,12 +62,12 @@ public static void get(final String cellName, final String token, final String b * @param boxName boxName * @param authorization Authorizationヘッダの値(auth-schemaを含む文字列) * @return レスポンス - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ - public static DcResponse getWithAuthSchema(final String cellName, + public static PersoniumResponse getWithAuthSchema(final String cellName, final String boxName, - final String authorization) throws DcException { - DcRestAdapter adaper = new DcRestAdapter(); + final String authorization) throws PersoniumException { + PersoniumRestAdapter adaper = new PersoniumRestAdapter(); HashMap header = new HashMap(); header.put(HttpHeaders.AUTHORIZATION, authorization); @@ -114,12 +114,12 @@ public static void create(final String cellName, final String boxName, final Str * @param boxName boxName * @param authorization Authorizationヘッダの値(auth-schemaを含む文字列) * @return レスポンス - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ - public static DcResponse createWithAuthSchema(final String cellName, + public static PersoniumResponse createWithAuthSchema(final String cellName, final String boxName, - final String authorization) throws DcException { - DcRestAdapter adaper = new DcRestAdapter(); + final String authorization) throws PersoniumException { + PersoniumRestAdapter adaper = new PersoniumRestAdapter(); HashMap header = new HashMap(); header.put(HttpHeaders.AUTHORIZATION, authorization); @@ -203,11 +203,11 @@ public static TResponse createViaNP( * @param cellName cellName * @param authorization Authorizationヘッダの値(auth-schemaを含む文字列) * @return レスポンス - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ - public static DcResponse listWithAuthSchema(final String cellName, - final String authorization) throws DcException { - DcRestAdapter adaper = new DcRestAdapter(); + public static PersoniumResponse listWithAuthSchema(final String cellName, + final String authorization) throws PersoniumException { + PersoniumRestAdapter adaper = new PersoniumRestAdapter(); HashMap header = new HashMap(); header.put(HttpHeaders.AUTHORIZATION, authorization); @@ -269,13 +269,13 @@ public static void update(final String cellName, final String token, final Strin * @param newName 新ボックス名 * @param authorization Authorizationヘッダの値(auth-schemaを含む文字列) * @return レスポンス - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ - public static DcResponse updateWithAuthSchema(final String cellName, + public static PersoniumResponse updateWithAuthSchema(final String cellName, final String boxName, final String newName, - final String authorization) throws DcException { - DcRestAdapter adaper = new DcRestAdapter(); + final String authorization) throws PersoniumException { + PersoniumRestAdapter adaper = new PersoniumRestAdapter(); HashMap header = new HashMap(); header.put(HttpHeaders.AUTHORIZATION, authorization); @@ -327,12 +327,12 @@ public static void delete(final String cellName, final String token, final Strin * @param boxName boxName * @param authorization Authorizationヘッダの値(auth-schemaを含む文字列) * @return レスポンス - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ - public static DcResponse deleteWithAuthSchema(final String cellName, + public static PersoniumResponse deleteWithAuthSchema(final String cellName, final String boxName, - final String authorization) throws DcException { - DcRestAdapter adaper = new DcRestAdapter(); + final String authorization) throws PersoniumException { + PersoniumRestAdapter adaper = new PersoniumRestAdapter(); HashMap header = new HashMap(); header.put(HttpHeaders.AUTHORIZATION, authorization); diff --git a/src/test/java/com/fujitsu/dc/test/utils/CellUtils.java b/src/test/java/io/personium/test/utils/CellUtils.java similarity index 88% rename from src/test/java/com/fujitsu/dc/test/utils/CellUtils.java rename to src/test/java/io/personium/test/utils/CellUtils.java index f613cbfb1..e997d798e 100644 --- a/src/test/java/com/fujitsu/dc/test/utils/CellUtils.java +++ b/src/test/java/io/personium/test/utils/CellUtils.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.utils; +package io.personium.test.utils; import static org.junit.Assert.assertEquals; @@ -28,14 +28,14 @@ import org.apache.http.HttpStatus; import org.json.simple.JSONObject; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcException; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.DcRestAdapter; -import com.fujitsu.dc.test.jersey.bar.BarInstallTestUtils; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumException; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.PersoniumRestAdapter; +import io.personium.test.jersey.bar.BarInstallTestUtils; +import io.personium.test.unit.core.UrlUtils; /** * Httpリクエストドキュメントを利用するユーティリティ. @@ -79,7 +79,7 @@ public static void get(final String cellName, final String token, final int code * オーナー指定でCellを1件取得するユーティリティ. * @param cellName セル名 * @param token トークン - * @param owner X-Dc-Unit-Userに指定する値 + * @param owner X-Personium-Unit-Userに指定する値 * @param code 返却値 */ public static void get(final String cellName, final String token, final String owner, final int code) { @@ -127,7 +127,7 @@ public static TResponse list(final String token, final int code) { /** * オーナー指定でCellを一覧取得するユーティリティ. * @param token トークン - * @param owner X-Dc-Unit-Userに指定する値 + * @param owner X-Personium-Unit-Userに指定する値 * @param code 返却値 * @return レスポンス */ @@ -178,7 +178,7 @@ public static void create(final String cellName, final String token, int code) { * オーナー指定でCellを作成するユーティリティ. * @param cellName セル名 * @param token トークン - * @param owner X-Dc-Unit-Userに指定する値 + * @param owner X-Personium-Unit-Userに指定する値 * @param code 返却値 */ public static void create(final String cellName, final String token, final String owner, final int code) { @@ -264,7 +264,7 @@ public static void update(final String cellPath, final String cellName, final St * @param cellPath 更新前のセル名 * @param cellName 更新後のセル名 * @param token トークン - * @param owner X-Dc-Unit-Userに指定する値 + * @param owner X-Personium-Unit-Userに指定する値 * @param code 返却値 */ public static void update(final String cellPath, final String cellName, final String token, @@ -345,11 +345,11 @@ public static void delete(final String token, final String cellName, String owne * @param cellName 対象セル名 * @return レスポンス */ - public static DcResponse bulkDeletion(final String tokenWithAuthSchema, final String cellName) { + public static PersoniumResponse bulkDeletion(final String tokenWithAuthSchema, final String cellName) { // セル再帰的削除APIを実行する - DcRequest request = DcRequest.delete(UrlUtils.cellRoot(cellName)); + PersoniumRequest request = PersoniumRequest.delete(UrlUtils.cellRoot(cellName)); request.header(HttpHeaders.AUTHORIZATION, tokenWithAuthSchema) - .header("X-Dc-Recursive", "true"); + .header("X-Personium-Recursive", "true"); return AbstractCase.request(request); } @@ -511,23 +511,23 @@ public static TResponse eventWithAnyAuthSchema(String authorization, * @param object イベントの対象オブジェクト * @param result イベントの結果 * @return レスポンス - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ @SuppressWarnings("unchecked") - public static DcResponse eventUnderBox(String authorization, + public static PersoniumResponse eventUnderBox(String authorization, String cellName, String boxName, String level, String action, String object, - String result) throws DcException { + String result) throws PersoniumException { JSONObject body = new JSONObject(); body.put("level", level); body.put("action", action); body.put("object", object); body.put("result", result); - DcRestAdapter adaper = new DcRestAdapter(); + PersoniumRestAdapter adaper = new PersoniumRestAdapter(); HashMap header = new HashMap(); header.put(HttpHeaders.AUTHORIZATION, authorization); return adaper.post(UrlUtils.cellRoot(cellName) + "__event/" + boxName, @@ -562,10 +562,10 @@ public static TResponse getLog(String token, int code, String cellName, String c * @param collection ログの種別("current" or "archive") * @param fileName ログのパス("default.log" or "default.log.{no}") * @return レスポンス DcResponse - * @throws DcException DcException + * @throws PersoniumException DcException */ - public static DcResponse getLog(String cellName, String collection, String fileName) throws DcException { - DcRestAdapter adaper = new DcRestAdapter(); + public static PersoniumResponse getLog(String cellName, String collection, String fileName) throws PersoniumException { + PersoniumRestAdapter adaper = new PersoniumRestAdapter(); HashMap header = new HashMap(); header.put(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); return adaper.get(UrlUtils.cellRoot(cellName) + "__log/" + collection + "/" + fileName, header); @@ -577,12 +577,12 @@ public static DcResponse getLog(String cellName, String collection, String fileN * @param fileName ログのパス("default.log" or "default.log.{no}") * @param authorization auth-schemaを含むAuthorizationヘッダの値 * @return レスポンス DcResponse - * @throws DcException DcException + * @throws PersoniumException DcException */ - public static DcResponse getCurrentLogWithAnyAuth(String cellName, + public static PersoniumResponse getCurrentLogWithAnyAuth(String cellName, String fileName, - String authorization) throws DcException { - DcRestAdapter adaper = new DcRestAdapter(); + String authorization) throws PersoniumException { + PersoniumRestAdapter adaper = new PersoniumRestAdapter(); HashMap header = new HashMap(); header.put(HttpHeaders.AUTHORIZATION, authorization); return adaper.get(UrlUtils.cellRoot(cellName) + "__log/current/" + fileName, header); @@ -613,15 +613,15 @@ public static TResponse propfindArchiveLogDir(String cellName, String authorizat * @param newPassword 新しいパスワード * @param authorization auth-schemaを含むAuthorizationヘッダの値 * @return レスポンス - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ - public static DcResponse changePassword(String cellName, String newPassword, String authorization) - throws DcException { - DcRestAdapter rest = new DcRestAdapter(); + public static PersoniumResponse changePassword(String cellName, String newPassword, String authorization) + throws PersoniumException { + PersoniumRestAdapter rest = new PersoniumRestAdapter(); // リクエストヘッダをセット HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, authorization); - requestheaders.put(DcCoreUtils.HttpHeaders.X_DC_CREDENTIAL, newPassword); + requestheaders.put(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_CREDENTIAL, newPassword); return rest.put(UrlUtils.cellRoot(cellName) + "__mypassword", "", requestheaders); } @@ -635,25 +635,25 @@ public static DcResponse changePassword(String cellName, String newPassword, Str * @param schemaAccount スキーマ認証元Cellに登録されたアカウント * @param schemaPassword スキーマ認証元Cellに登録されたパスワード * @return レスポンス - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ - public static DcResponse schemaAuthenticateWithBasic( + public static PersoniumResponse schemaAuthenticateWithBasic( String cellName, String account, String password, String schemaCell, String schemaAccount, - String schemaPassword) throws DcException { + String schemaPassword) throws PersoniumException { // スキーマ認証元Cellでトークン認証 TResponse res = tokenAuthenticationWithTarget(schemaCell, schemaAccount, schemaPassword, cellName); String schemaAuthenticatedToken = (String) res.bodyAsJson().get("access_token"); // スキーマ認証(Basic認証) - DcRestAdapter rest = new DcRestAdapter(); + PersoniumRestAdapter rest = new PersoniumRestAdapter(); // リクエストヘッダをセット String schemaCellUrl = UrlUtils.cellRoot(schemaCell); String authorization = - "Basic " + DcCoreUtils.createBasicAuthzHeader(schemaCellUrl, schemaAuthenticatedToken); + "Basic " + PersoniumCoreUtils.createBasicAuthzHeader(schemaCellUrl, schemaAuthenticatedToken); HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, authorization); @@ -679,7 +679,7 @@ public static TResponse tokenAuthenticationWithTarget(String cellName, .with("remoteCell", cellName) .with("username", account) .with("password", pass) - .with("dc_target", targetUrl) + .with("p_target", targetUrl) .returns() .statusCode(HttpStatus.SC_OK); } @@ -694,15 +694,15 @@ public static TResponse tokenAuthenticationWithTarget(String cellName, * @param state リクエストとコールバックの間で状態を維持するために使用するランダムな値 * @param addHeader 追加のヘッダ情報 * @return レスポンス - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ - public static DcResponse implicitflowAuthenticate(String cellName, + public static PersoniumResponse implicitflowAuthenticate(String cellName, String schemaCell, String schemaAccount, String schemaPassword, String redirectPath, String state, - HashMap addHeader) throws DcException { + HashMap addHeader) throws PersoniumException { String clientId = UrlUtils.cellRoot(schemaCell); if (null == redirectPath) { redirectPath = "__/redirect.html"; @@ -714,7 +714,7 @@ public static DcResponse implicitflowAuthenticate(String cellName, + "&password=" + schemaPassword + "&state=" + state; - DcRestAdapter rest = new DcRestAdapter(); + PersoniumRestAdapter rest = new PersoniumRestAdapter(); // リクエストヘッダをセット HashMap requestheaders = new HashMap(); @@ -732,12 +732,12 @@ public static DcResponse implicitflowAuthenticate(String cellName, * @param schemaCell schemaCell名 * @param authorization auth-schemaを含むAuthorizationヘッダの値 * @return レスポンス - * @throws DcException リクエスト失敗 + * @throws PersoniumException リクエスト失敗 */ - public static DcResponse getBoxUrl(String cellName, + public static PersoniumResponse getBoxUrl(String cellName, String schemaCell, - String authorization) throws DcException { - DcRestAdapter rest = new DcRestAdapter(); + String authorization) throws PersoniumException { + PersoniumRestAdapter rest = new PersoniumRestAdapter(); HashMap requestheaders = new HashMap(); requestheaders.put(HttpHeaders.AUTHORIZATION, authorization); diff --git a/src/test/java/com/fujitsu/dc/test/utils/DavResourceUtils.java b/src/test/java/io/personium/test/utils/DavResourceUtils.java similarity index 95% rename from src/test/java/com/fujitsu/dc/test/utils/DavResourceUtils.java rename to src/test/java/io/personium/test/utils/DavResourceUtils.java index 9df9ff484..5494a8859 100644 --- a/src/test/java/com/fujitsu/dc/test/utils/DavResourceUtils.java +++ b/src/test/java/io/personium/test/utils/DavResourceUtils.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.utils; +package io.personium.test.utils; import static org.fest.assertions.Assertions.assertThat; import static org.junit.Assert.assertEquals; @@ -34,15 +34,15 @@ import org.w3c.dom.NodeList; import org.w3c.dom.Text; -import com.fujitsu.dc.core.auth.OAuth2Helper; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.box.acl.jaxb.Ace; -import com.fujitsu.dc.test.jersey.box.acl.jaxb.Acl; -import com.fujitsu.dc.test.jersey.box.acl.jaxb.Grant; -import com.fujitsu.dc.test.jersey.box.acl.jaxb.Principal; -import com.fujitsu.dc.test.jersey.box.acl.jaxb.Privilege; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.core.auth.OAuth2Helper; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.box.acl.jaxb.Ace; +import io.personium.test.jersey.box.acl.jaxb.Acl; +import io.personium.test.jersey.box.acl.jaxb.Grant; +import io.personium.test.jersey.box.acl.jaxb.Principal; +import io.personium.test.jersey.box.acl.jaxb.Privilege; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; /** * WebDAV Httpリクエストドキュメントを利用するユーティリティ. @@ -1087,25 +1087,25 @@ public static String getXmlNodeValue(final Document doc, final String tagName) { /** * PROPFINDの結果にODataコレクションが含まれるかどうかをチェックする.
    - * dc:odataタグが含まれていれば OData コレクションが含まれものとする. + * p:odataタグが含まれていれば OData コレクションが含まれものとする. * @param res PROPFINDレスポンス */ public static void assertIsODataCol(TResponse res) { Document propfind = res.bodyAsXml(); NodeList list; - list = propfind.getElementsByTagName("dc:odata"); + list = propfind.getElementsByTagName("p:odata"); assertThat(list.getLength()).isGreaterThanOrEqualTo(1); } /** * PROPFINDの結果にServiceコレクションが含まれるかどうかをチェックする.
    - * dc:pathタグが含まれていれば Service コレクションが含まれものとする. + * p:pathタグが含まれていれば Service コレクションが含まれものとする. * @param res PROPFINDレスポンス */ public static void assertIsServiceCol(TResponse res) { Document propfind = res.bodyAsXml(); NodeList list; - list = propfind.getElementsByTagName("dc:path"); + list = propfind.getElementsByTagName("p:path"); assertThat(list.getLength()).isGreaterThanOrEqualTo(1); } diff --git a/src/test/java/com/fujitsu/dc/test/utils/EntityTypeUtils.java b/src/test/java/io/personium/test/utils/EntityTypeUtils.java similarity index 96% rename from src/test/java/com/fujitsu/dc/test/utils/EntityTypeUtils.java rename to src/test/java/io/personium/test/utils/EntityTypeUtils.java index 70382ae7b..c5b159c42 100644 --- a/src/test/java/com/fujitsu/dc/test/utils/EntityTypeUtils.java +++ b/src/test/java/io/personium/test/utils/EntityTypeUtils.java @@ -14,15 +14,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.utils; +package io.personium.test.utils; import javax.ws.rs.core.MediaType; import org.apache.commons.codec.binary.Base64; -import com.fujitsu.dc.core.model.ctl.Common; -import com.fujitsu.dc.core.model.ctl.EntityType; -import com.fujitsu.dc.test.setup.Setup; +import io.personium.core.model.ctl.Common; +import io.personium.core.model.ctl.EntityType; +import io.personium.test.setup.Setup; /** * Odata関連のHttpリクエストドキュメントを利用するユーティリティ. diff --git a/src/test/java/com/fujitsu/dc/test/utils/ExtCellUtils.java b/src/test/java/io/personium/test/utils/ExtCellUtils.java similarity index 89% rename from src/test/java/com/fujitsu/dc/test/utils/ExtCellUtils.java rename to src/test/java/io/personium/test/utils/ExtCellUtils.java index 8df446711..46c939800 100644 --- a/src/test/java/com/fujitsu/dc/test/utils/ExtCellUtils.java +++ b/src/test/java/io/personium/test/utils/ExtCellUtils.java @@ -14,13 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.utils; +package io.personium.test.utils; import javax.ws.rs.core.MediaType; import org.json.simple.JSONObject; -import com.fujitsu.dc.common.utils.DcCoreUtils; +import io.personium.common.utils.PersoniumCoreUtils; /** * ExtCell用ユーティリティ. @@ -43,7 +43,7 @@ public static void get(final String token, final String cellName, .with("cellPath", cellName) .with("token", token) .with("accept", "application/xml") - .with("url", DcCoreUtils.encodeUrlComp(url)) + .with("url", PersoniumCoreUtils.encodeUrlComp(url)) .returns() .debug() .statusCode(code); @@ -129,7 +129,7 @@ public static void update(final String token, final String cellName, .with("cellPath", cellName) .with("token", token) .with("accept", "application/xml") - .with("url", DcCoreUtils.encodeUrlComp(url)) + .with("url", PersoniumCoreUtils.encodeUrlComp(url)) .with("newUrl", newUrl) .returns() .statusCode(code); @@ -143,7 +143,7 @@ public static void update(final String token, final String cellName, */ public static void delete(final String token, final String cellName, final String url) { Http.request("cell/extCell-delete.txt").with("cellPath", cellName).with("token", token) - .with("accept", "application/xml").with("url", DcCoreUtils.encodeUrlComp(url)).returns(); + .with("accept", "application/xml").with("url", PersoniumCoreUtils.encodeUrlComp(url)).returns(); } /** @@ -159,7 +159,7 @@ public static void delete(final String token, final String cellName, .with("cellPath", cellName) .with("token", token) .with("accept", "application/xml") - .with("url", DcCoreUtils.encodeUrlComp(url)) + .with("url", PersoniumCoreUtils.encodeUrlComp(url)) .returns() .statusCode(code); } @@ -175,6 +175,6 @@ public static void delete(final String token, final String cellName, */ public static void extCellAccess(String method, String cellName, String url, String token, String body, int code) { Http.request("cell/extCell-multi.txt").with("method", method).with("cellPath", cellName).with("token", token) - .with("url", DcCoreUtils.encodeUrlComp(url)).with("body", body).returns().statusCode(code); + .with("url", PersoniumCoreUtils.encodeUrlComp(url)).with("body", body).returns().statusCode(code); } } diff --git a/src/test/java/com/fujitsu/dc/test/utils/ExtRoleUtils.java b/src/test/java/io/personium/test/utils/ExtRoleUtils.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/utils/ExtRoleUtils.java rename to src/test/java/io/personium/test/utils/ExtRoleUtils.java index d4a6b4845..8e1d9f8a4 100644 --- a/src/test/java/com/fujitsu/dc/test/utils/ExtRoleUtils.java +++ b/src/test/java/io/personium/test/utils/ExtRoleUtils.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.utils; +package io.personium.test.utils; import static org.junit.Assert.assertEquals; @@ -22,7 +22,7 @@ import org.json.simple.JSONObject; -import com.fujitsu.dc.common.utils.DcCoreUtils; +import io.personium.common.utils.PersoniumCoreUtils; /** * Httpリクエストドキュメントを利用するユーティリティ. @@ -45,7 +45,7 @@ public static TResponse get(final String token, final String cellName, final Str final String relationName, final String relationBoxName, final int code) { TResponse response = Http.request("cell/extRole/extRole-get.txt") .with("cellPath", cellName) - .with("extRoleName", DcCoreUtils.encodeUrlComp(extRoleName)) + .with("extRoleName", PersoniumCoreUtils.encodeUrlComp(extRoleName)) .with("relationName", relationName) .with("relationBoxName", relationBoxName) .with("token", token) @@ -142,7 +142,7 @@ public static void update(final String token, final String cellName, final Strin final String newRelation, final String newRelationBox, final int code) { Http.request("cell/extRole/extRole-update.txt") .with("cellPath", cellName) - .with("extRoleName", DcCoreUtils.encodeUrlComp(extRoleName)) + .with("extRoleName", PersoniumCoreUtils.encodeUrlComp(extRoleName)) .with("relationName", relationName) .with("relationBoxName", relationBoxName) .with("newextRoleName", newextRoleName) @@ -166,7 +166,7 @@ public static void update(final String token, final String cellName, final Strin final String relationName, final String relationBoxName, final JSONObject body, final int code) { Http.request("cell/extRole/extRole-update-nobody.txt") .with("cellPath", cellName) - .with("extRoleName", DcCoreUtils.encodeUrlComp(extRoleName)) + .with("extRoleName", PersoniumCoreUtils.encodeUrlComp(extRoleName)) .with("relationName", relationName) .with("relationBoxName", relationBoxName) .with("token", token) @@ -188,7 +188,7 @@ public static void delete(final String token, final String cellName, final Strin final String relationName, final String relationBoxName, final int code) { Http.request("cell/extRole/extRole-delete.txt") .with("cellPath", cellName) - .with("extRoleName", DcCoreUtils.encodeUrlComp(extRoleName)) + .with("extRoleName", PersoniumCoreUtils.encodeUrlComp(extRoleName)) .with("relationName", relationName) .with("relationBoxName", relationBoxName) .with("token", token) diff --git a/src/test/java/com/fujitsu/dc/test/utils/Http.java b/src/test/java/io/personium/test/utils/Http.java similarity index 95% rename from src/test/java/com/fujitsu/dc/test/utils/Http.java rename to src/test/java/io/personium/test/utils/Http.java index b624ce97c..a0e947316 100644 --- a/src/test/java/com/fujitsu/dc/test/utils/Http.java +++ b/src/test/java/io/personium/test/utils/Http.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.utils; +package io.personium.test.utils; import java.io.BufferedOutputStream; import java.io.BufferedReader; @@ -47,8 +47,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fujitsu.dc.test.DcCoreTestConfig; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.test.PersoniumCoreTestConfig; +import io.personium.test.unit.core.UrlUtils; import com.sun.jersey.core.header.OutBoundHeaders; /** @@ -164,7 +164,7 @@ public TResponse returns() { } // Version情報のヘッダを追加 - lines.add("X-Dc-Version: " + DcCoreTestConfig.getCoreVersion() + CRLF); + lines.add("X-Personium-Version: " + PersoniumCoreTestConfig.getCoreVersion() + CRLF); String body = null; // 前処理で空行でBreakしたときはBodyがあることの証。 if (line != null) { diff --git a/src/test/java/com/fujitsu/dc/test/utils/ODataSchemaUtils.java b/src/test/java/io/personium/test/utils/ODataSchemaUtils.java similarity index 95% rename from src/test/java/com/fujitsu/dc/test/utils/ODataSchemaUtils.java rename to src/test/java/io/personium/test/utils/ODataSchemaUtils.java index 5ad3441a9..e12def665 100644 --- a/src/test/java/com/fujitsu/dc/test/utils/ODataSchemaUtils.java +++ b/src/test/java/io/personium/test/utils/ODataSchemaUtils.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.utils; +package io.personium.test.utils; /** * OData Schema 取得($metadata 取得)を利用するユーティリティ. diff --git a/src/test/java/com/fujitsu/dc/test/utils/ReceivedMessageUtils.java b/src/test/java/io/personium/test/utils/ReceivedMessageUtils.java similarity index 93% rename from src/test/java/com/fujitsu/dc/test/utils/ReceivedMessageUtils.java rename to src/test/java/io/personium/test/utils/ReceivedMessageUtils.java index 74aa0cab9..d90c864db 100644 --- a/src/test/java/com/fujitsu/dc/test/utils/ReceivedMessageUtils.java +++ b/src/test/java/io/personium/test/utils/ReceivedMessageUtils.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.utils; +package io.personium.test.utils; import static org.junit.Assert.assertEquals; @@ -25,9 +25,9 @@ import org.json.simple.JSONObject; -import com.fujitsu.dc.common.auth.token.TransCellAccessToken; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.common.auth.token.TransCellAccessToken; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; /** * Httpリクエストドキュメントを利用するユーティリティ. @@ -50,7 +50,7 @@ public static TResponse receive( if (token == null) { String targetCellUrl = UrlUtils.cellRoot(cellName); String cellUrl = UrlUtils.cellRoot(Setup.TEST_CELL2); - List list = new ArrayList(); + List list = new ArrayList(); TransCellAccessToken ttk = new TransCellAccessToken(cellUrl, cellUrl, targetCellUrl, list, ""); token = ttk.toTokenString(); } diff --git a/src/test/java/com/fujitsu/dc/test/utils/RelationUtils.java b/src/test/java/io/personium/test/utils/RelationUtils.java similarity index 96% rename from src/test/java/com/fujitsu/dc/test/utils/RelationUtils.java rename to src/test/java/io/personium/test/utils/RelationUtils.java index 3c9a1a37e..4cdeef815 100644 --- a/src/test/java/com/fujitsu/dc/test/utils/RelationUtils.java +++ b/src/test/java/io/personium/test/utils/RelationUtils.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.utils; +package io.personium.test.utils; import static org.junit.Assert.assertEquals; diff --git a/src/test/java/com/fujitsu/dc/test/utils/ResourceUtils.java b/src/test/java/io/personium/test/utils/ResourceUtils.java similarity index 96% rename from src/test/java/com/fujitsu/dc/test/utils/ResourceUtils.java rename to src/test/java/io/personium/test/utils/ResourceUtils.java index 1193e0612..3651b7e85 100644 --- a/src/test/java/com/fujitsu/dc/test/utils/ResourceUtils.java +++ b/src/test/java/io/personium/test/utils/ResourceUtils.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.utils; +package io.personium.test.utils; import static org.junit.Assert.assertEquals; @@ -25,17 +25,17 @@ import org.apache.http.HttpStatus; import org.json.simple.JSONObject; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.core.auth.OAuth2Helper; -import com.fujitsu.dc.core.model.ctl.Account; -import com.fujitsu.dc.core.model.ctl.ExtCell; -import com.fujitsu.dc.core.model.ctl.ExtRole; -import com.fujitsu.dc.core.model.ctl.Relation; -import com.fujitsu.dc.core.model.ctl.Role; -import com.fujitsu.dc.test.jersey.bar.BarInstallTestUtils; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.core.auth.OAuth2Helper; +import io.personium.core.model.ctl.Account; +import io.personium.core.model.ctl.ExtCell; +import io.personium.core.model.ctl.ExtRole; +import io.personium.core.model.ctl.Relation; +import io.personium.core.model.ctl.Role; +import io.personium.test.jersey.bar.BarInstallTestUtils; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; /** * Httpリクエストドキュメントを利用するユーティリティ. @@ -136,7 +136,7 @@ public static TResponse deleteUserDataLinks(String userDataId, TResponse res = Http.request("box/odatacol/delete-link.txt").with("cell", cell).with("box", box) .with("collection", col).with("entityType", entity).with("id", userDataId) .with("navProp", "_" + navProp).with("navKey", navPropId) - .with("contentType", MediaType.APPLICATION_JSON).with("token", DcCoreConfig.getMasterToken()) + .with("contentType", MediaType.APPLICATION_JSON).with("token", PersoniumUnitConfig.getMasterToken()) .with("ifMatch", "*").returns().statusCode(code); return res; } @@ -221,7 +221,7 @@ public static void linksUserData(String srcEntity, String srcUserId, .with("colPath", Setup.TEST_ODATA) .with("srcPath", srcEntity + "('" + srcUserId + "')") .with("trgPath", targetEntity) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("trgUserdataUrl", targetUri) .returns() .debug() @@ -436,7 +436,7 @@ public static void linkExtCellRelationDelete(final String token, final String ce .with("token", token) .with("cellPath", cellName) .with("entitySet", ExtCell.EDM_TYPE_NAME) - .with("key", "'" + DcCoreUtils.encodeUrlComp(testExtCellName) + "'") + .with("key", "'" + PersoniumCoreUtils.encodeUrlComp(testExtCellName) + "'") .with("navProp", "_" + Relation.EDM_TYPE_NAME) .with("navKey", "'" + relationName + "'") .returns() @@ -698,7 +698,7 @@ public static TResponse logCollectionPropfind(String cellName, String accessToken, int code) { return Http.request("cell/log-propfind-with-nobody.txt") - .with("METHOD", com.fujitsu.dc.common.utils.DcCoreUtils.HttpMethod.PROPFIND) + .with("METHOD", io.personium.common.utils.PersoniumCoreUtils.HttpMethod.PROPFIND) .with("token", accessToken) .with("cellPath", cellName) .with("collection", collection) diff --git a/src/test/java/com/fujitsu/dc/test/utils/RoleUtils.java b/src/test/java/io/personium/test/utils/RoleUtils.java similarity index 96% rename from src/test/java/com/fujitsu/dc/test/utils/RoleUtils.java rename to src/test/java/io/personium/test/utils/RoleUtils.java index abc4aa1e9..3bc688711 100644 --- a/src/test/java/com/fujitsu/dc/test/utils/RoleUtils.java +++ b/src/test/java/io/personium/test/utils/RoleUtils.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.utils; +package io.personium.test.utils; import javax.ws.rs.HttpMethod; import javax.ws.rs.core.MediaType; @@ -22,8 +22,8 @@ import org.apache.http.HttpStatus; import org.json.simple.JSONObject; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.unit.core.UrlUtils; /** * Httpリクエストドキュメントを利用するユーティリティ. diff --git a/src/test/java/com/fujitsu/dc/test/utils/SentMessageUtils.java b/src/test/java/io/personium/test/utils/SentMessageUtils.java similarity index 95% rename from src/test/java/com/fujitsu/dc/test/utils/SentMessageUtils.java rename to src/test/java/io/personium/test/utils/SentMessageUtils.java index 5250fd30c..c3dcf14fb 100644 --- a/src/test/java/com/fujitsu/dc/test/utils/SentMessageUtils.java +++ b/src/test/java/io/personium/test/utils/SentMessageUtils.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.utils; +package io.personium.test.utils; import static org.junit.Assert.assertEquals; @@ -26,8 +26,8 @@ import org.json.simple.JSONArray; import org.json.simple.JSONObject; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.unit.core.UrlUtils; /** * Httpリクエストドキュメントを利用するユーティリティ. diff --git a/src/test/java/com/fujitsu/dc/test/utils/TResponse.java b/src/test/java/io/personium/test/utils/TResponse.java similarity index 96% rename from src/test/java/com/fujitsu/dc/test/utils/TResponse.java rename to src/test/java/io/personium/test/utils/TResponse.java index f6860cfa4..8fe85d17b 100644 --- a/src/test/java/com/fujitsu/dc/test/utils/TResponse.java +++ b/src/test/java/io/personium/test/utils/TResponse.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.utils; +package io.personium.test.utils; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; diff --git a/src/test/java/com/fujitsu/dc/test/utils/TestMethodUtils.java b/src/test/java/io/personium/test/utils/TestMethodUtils.java similarity index 93% rename from src/test/java/com/fujitsu/dc/test/utils/TestMethodUtils.java rename to src/test/java/io/personium/test/utils/TestMethodUtils.java index 40a4d9b4a..a59a67724 100644 --- a/src/test/java/com/fujitsu/dc/test/utils/TestMethodUtils.java +++ b/src/test/java/io/personium/test/utils/TestMethodUtils.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.utils; +package io.personium.test.utils; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -26,10 +26,10 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import com.fujitsu.dc.common.utils.DcCoreUtils; -import com.fujitsu.dc.core.model.jaxb.Ace; -import com.fujitsu.dc.core.model.jaxb.Acl; -import com.fujitsu.dc.core.model.jaxb.ObjectIo; +import io.personium.common.utils.PersoniumCoreUtils; +import io.personium.core.model.jaxb.Ace; +import io.personium.core.model.jaxb.Acl; +import io.personium.core.model.jaxb.ObjectIo; /** * 共通のテストメソッドを利用するユーティリティ. @@ -50,7 +50,7 @@ private TestMethodUtils() { */ public static void aclResponseTest(Element doc, String resorce, List>> list, int responseIndex, String baseUrl, String requireSchamaAuthz) { - String xmlStr = DcCoreUtils.nodeToString(doc); + String xmlStr = PersoniumCoreUtils.nodeToString(doc); NodeList response = doc.getElementsByTagName("response"); assertEquals(responseIndex, response.getLength()); Element node = (Element) response.item(0); diff --git a/src/test/java/com/fujitsu/dc/test/utils/UserDataUtils.java b/src/test/java/io/personium/test/utils/UserDataUtils.java similarity index 94% rename from src/test/java/com/fujitsu/dc/test/utils/UserDataUtils.java rename to src/test/java/io/personium/test/utils/UserDataUtils.java index dfc190636..891450f13 100644 --- a/src/test/java/com/fujitsu/dc/test/utils/UserDataUtils.java +++ b/src/test/java/io/personium/test/utils/UserDataUtils.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.fujitsu.dc.test.utils; +package io.personium.test.utils; import static org.junit.Assert.assertEquals; @@ -25,14 +25,14 @@ import org.apache.http.HttpStatus; import org.json.simple.JSONObject; -import com.fujitsu.dc.core.DcCoreConfig; -import com.fujitsu.dc.test.jersey.AbstractCase; -import com.fujitsu.dc.test.jersey.DcRequest; -import com.fujitsu.dc.test.jersey.DcResponse; -import com.fujitsu.dc.test.jersey.box.odatacol.schema.complextypeproperty.ComplexTypePropertyUtils; -import com.fujitsu.dc.test.jersey.box.odatacol.schema.property.PropertyUtils; -import com.fujitsu.dc.test.setup.Setup; -import com.fujitsu.dc.test.unit.core.UrlUtils; +import io.personium.core.PersoniumUnitConfig; +import io.personium.test.jersey.AbstractCase; +import io.personium.test.jersey.PersoniumRequest; +import io.personium.test.jersey.PersoniumResponse; +import io.personium.test.jersey.box.odatacol.schema.complextypeproperty.ComplexTypePropertyUtils; +import io.personium.test.jersey.box.odatacol.schema.property.PropertyUtils; +import io.personium.test.setup.Setup; +import io.personium.test.unit.core.UrlUtils; /** * Odata関連のHttpリクエストドキュメントを利用するユーティリティ. @@ -51,12 +51,12 @@ private UserDataUtils() { * @param complexTypeName コンプレックスタイプ名 * @return レスポンス */ - public static DcResponse createComplexType(final String cellName, + public static PersoniumResponse createComplexType(final String cellName, final String boxName, final String odataSvcPath, final String complexTypeName) { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(UrlUtils.complexType(cellName, boxName, odataSvcPath, null)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.complexType(cellName, boxName, odataSvcPath, null)); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.addJsonBody("Name", complexTypeName); @@ -79,7 +79,7 @@ public static DcResponse createComplexType(final String cellName, * @param uniqueKey ユニークキー * @return レスポンス */ - public static DcResponse createProperty(final String cellName, + public static PersoniumResponse createProperty(final String cellName, final String boxName, final String odataSvcPath, final String propName, @@ -91,7 +91,7 @@ public static DcResponse createProperty(final String cellName, final boolean isKey, final String uniqueKey) { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(UrlUtils.property(cellName, boxName, odataSvcPath, null, null)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.property(cellName, boxName, odataSvcPath, null, null)); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.addJsonBody(PropertyUtils.PROPERTY_NAME_KEY, propName); req.addJsonBody(PropertyUtils.PROPERTY_ENTITYTYPE_NAME_KEY, entityTypeName); @@ -119,7 +119,7 @@ public static DcResponse createProperty(final String cellName, * @param collectionKind 配列指定 * @return レスポンス */ - public static DcResponse createComplexTypeProperty(final String cellName, + public static PersoniumResponse createComplexTypeProperty(final String cellName, final String boxName, final String odataSvcPath, final String propName, @@ -129,7 +129,7 @@ public static DcResponse createComplexTypeProperty(final String cellName, final String defaultValue, final String collectionKind) { // リクエストパラメータ設定 - DcRequest req = DcRequest.post(UrlUtils.complexTypeProperty(cellName, boxName, odataSvcPath, null, null)); + PersoniumRequest req = PersoniumRequest.post(UrlUtils.complexTypeProperty(cellName, boxName, odataSvcPath, null, null)); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_NAME_KEY, propName); req.addJsonBody(ComplexTypePropertyUtils.CT_PROPERTY_COMPLEXTYPE_NAME_KEY, complexTypeName); @@ -325,7 +325,7 @@ public static TResponse listAnyAuthSchema(String cell, * @param code 期待するレスポンスコード * @return レスポンス */ - public static DcResponse listEntities(String cell, + public static PersoniumResponse listEntities(String cell, String box, String col, String entityType, @@ -333,10 +333,10 @@ public static DcResponse listEntities(String cell, String token, int code) { String reqUrl = UrlUtils.userData(cell, box, col, entityType) + query; - DcRequest req = DcRequest.get(reqUrl); + PersoniumRequest req = PersoniumRequest.get(reqUrl); req.header(HttpHeaders.AUTHORIZATION, AbstractCase.BEARER_MASTER_TOKEN); req.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); - DcResponse res = AbstractCase.request(req); + PersoniumResponse res = AbstractCase.request(req); if (-1 != code) { assertEquals(code, res.getStatusCode()); } @@ -1016,7 +1016,7 @@ public static TResponse listLink( .with("colPath", colName) .with("srcPath", sourceEntity + "('" + sourceId + "')") .with("trgPath", targetEntity) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("accept", MediaType.APPLICATION_JSON) .returns() .statusCode(HttpStatus.SC_OK) @@ -1046,7 +1046,7 @@ public static void deleteLinks(String cell, String box, String collection, .with("navProp", "_" + navPropEntity) .with("navKey", navPropId) .with("contentType", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .with("ifMatch", "*") .returns() .statusCode(code); @@ -1105,7 +1105,7 @@ public static TResponse listViaNP(String cell, String box, String collection, .with("entityType", "_" + navPropEntity) .with("query", query) .with("accept", MediaType.APPLICATION_JSON) - .with("token", DcCoreConfig.getMasterToken()) + .with("token", PersoniumUnitConfig.getMasterToken()) .returns() .statusCode(code) .debug(); diff --git a/src/test/java/com/fujitsu/dc/test/utils/package-info.java b/src/test/java/io/personium/test/utils/package-info.java similarity index 92% rename from src/test/java/com/fujitsu/dc/test/utils/package-info.java rename to src/test/java/io/personium/test/utils/package-info.java index fcdf64bf1..759150f91 100644 --- a/src/test/java/com/fujitsu/dc/test/utils/package-info.java +++ b/src/test/java/io/personium/test/utils/package-info.java @@ -17,5 +17,5 @@ /** * 本アプリケーションのテスト用ユーティリティ. */ -package com.fujitsu.dc.test.utils; +package io.personium.test.utils; diff --git a/src/test/resources/dc-config.properties.unit b/src/test/resources/personium-unit-config.properties.unit similarity index 100% rename from src/test/resources/dc-config.properties.unit rename to src/test/resources/personium-unit-config.properties.unit diff --git a/src/test/resources/request/account-create-lastauthenticated.txt b/src/test/resources/request/account-create-lastauthenticated.txt index 422b45b67..8fb3d9084 100644 --- a/src/test/resources/request/account-create-lastauthenticated.txt +++ b/src/test/resources/request/account-create-lastauthenticated.txt @@ -5,6 +5,6 @@ Connection: close Accept: application/json Content-Type: application/json Authorization: Bearer ${token} -X-Dc-Credential: ${password} +X-Personium-Credential: ${password} {"Name":"${username}","LastAuthenticated":"${lastauthenticated}"} diff --git a/src/test/resources/request/account-create-with-type.txt b/src/test/resources/request/account-create-with-type.txt index 956a7a3bd..3ad6291df 100644 --- a/src/test/resources/request/account-create-with-type.txt +++ b/src/test/resources/request/account-create-with-type.txt @@ -5,6 +5,6 @@ Connection: close Accept: application/json Content-Type: application/json Authorization: Bearer ${token} -X-Dc-Credential: ${password} +X-Personium-Credential: ${password} {"Name":"${username}", "Type":"${accountType}"} diff --git a/src/test/resources/request/account-create.txt b/src/test/resources/request/account-create.txt index e7ea7fb37..76ecf0c68 100644 --- a/src/test/resources/request/account-create.txt +++ b/src/test/resources/request/account-create.txt @@ -5,6 +5,6 @@ Connection: close Accept: application/json Content-Type: application/json Authorization: Bearer ${token} -X-Dc-Credential: ${password} +X-Personium-Credential: ${password} {"Name":"${username}"} diff --git a/src/test/resources/request/account-update-lastauthenticated.txt b/src/test/resources/request/account-update-lastauthenticated.txt index f26f85afa..cc92f705a 100644 --- a/src/test/resources/request/account-update-lastauthenticated.txt +++ b/src/test/resources/request/account-update-lastauthenticated.txt @@ -5,7 +5,7 @@ Connection: close Accept: application/json Content-Type: application/json Authorization: Bearer ${token} -X-Dc-Credential: ${password} +X-Personium-Credential: ${password} If-Match: * {"Name":"${newUsername}","LastAuthenticated":${newLastAuthenticated}} diff --git a/src/test/resources/request/account-update-without-body.txt b/src/test/resources/request/account-update-without-body.txt index 891bcebda..e85b8884c 100644 --- a/src/test/resources/request/account-update-without-body.txt +++ b/src/test/resources/request/account-update-without-body.txt @@ -5,7 +5,7 @@ Connection: close Accept: application/json Content-Type: application/json Authorization: Bearer ${token} -X-Dc-Credential: ${password} +X-Personium-Credential: ${password} If-Match: * ${body} \ No newline at end of file diff --git a/src/test/resources/request/account-update.txt b/src/test/resources/request/account-update.txt index 2588dd33d..e7a0bf66d 100644 --- a/src/test/resources/request/account-update.txt +++ b/src/test/resources/request/account-update.txt @@ -5,7 +5,7 @@ Connection: close Accept: application/json Content-Type: application/json Authorization: Bearer ${token} -X-Dc-Credential: ${password} +X-Personium-Credential: ${password} If-Match: * {"Name":"${newUsername}"} \ No newline at end of file diff --git a/src/test/resources/request/authn/issue-cookie-for-refreshToken.txt b/src/test/resources/request/authn/issue-cookie-for-refreshToken.txt index e66116102..8fa66c0d3 100644 --- a/src/test/resources/request/authn/issue-cookie-for-refreshToken.txt +++ b/src/test/resources/request/authn/issue-cookie-for-refreshToken.txt @@ -5,4 +5,4 @@ Content-Length: ? Accept: application/json Connection: close -grant_type=refresh_token&refresh_token=${refresh_token}&dc_cookie=true \ No newline at end of file +grant_type=refresh_token&refresh_token=${refresh_token}&p_cookie=true \ No newline at end of file diff --git a/src/test/resources/request/authn/issue-cookie-with-saml.txt b/src/test/resources/request/authn/issue-cookie-with-saml.txt index 0afe1cc5d..18ecaf880 100644 --- a/src/test/resources/request/authn/issue-cookie-with-saml.txt +++ b/src/test/resources/request/authn/issue-cookie-with-saml.txt @@ -5,4 +5,4 @@ Content-Length: ? Accept: application/json Connection: close -grant_type=urn:ietf:params:oauth:grant-type:saml2-bearer&assertion=${assertion}&dc_cookie=true \ No newline at end of file +grant_type=urn:ietf:params:oauth:grant-type:saml2-bearer&assertion=${assertion}&p_cookie=true \ No newline at end of file diff --git a/src/test/resources/request/authn/issue-cookie-with-target.txt b/src/test/resources/request/authn/issue-cookie-with-target.txt index 53814412b..b04e3da08 100644 --- a/src/test/resources/request/authn/issue-cookie-with-target.txt +++ b/src/test/resources/request/authn/issue-cookie-with-target.txt @@ -4,4 +4,4 @@ Content-Type: application/x-www-form-urlencoded Content-Length: ? Connection: close -grant_type=password&username=${username}&password=${password}&dc_cookie=${dc_cookie}&dc_target=${dc_target} \ No newline at end of file +grant_type=password&username=${username}&password=${password}&p_cookie=${p_cookie}&p_target=${p_target} \ No newline at end of file diff --git a/src/test/resources/request/authn/issue-cookie-without-target.txt b/src/test/resources/request/authn/issue-cookie-without-target.txt index e88ffe630..ca2c5923a 100644 --- a/src/test/resources/request/authn/issue-cookie-without-target.txt +++ b/src/test/resources/request/authn/issue-cookie-without-target.txt @@ -4,4 +4,4 @@ Content-Type: application/x-www-form-urlencoded Content-Length: ? Connection: close -grant_type=password&username=${username}&password=${password}&dc_cookie=${dc_cookie} \ No newline at end of file +grant_type=password&username=${username}&password=${password}&p_cookie=${p_cookie} \ No newline at end of file diff --git a/src/test/resources/request/authn/oidc-auth.txt b/src/test/resources/request/authn/oidc-auth.txt index 7fa15d4cb..286fe4d62 100644 --- a/src/test/resources/request/authn/oidc-auth.txt +++ b/src/test/resources/request/authn/oidc-auth.txt @@ -4,4 +4,4 @@ Content-Type: application/x-www-form-urlencoded Content-Length: ? Connection: close -grant_type=urn:x-dc1:oidc:${id_provider}&id_token=${id_token} \ No newline at end of file +grant_type=urn:x-personium:oidc:${id_provider}&id_token=${id_token} \ No newline at end of file diff --git a/src/test/resources/request/authn/password-tc-c0.txt b/src/test/resources/request/authn/password-tc-c0.txt index 615c57ee6..576514a44 100644 --- a/src/test/resources/request/authn/password-tc-c0.txt +++ b/src/test/resources/request/authn/password-tc-c0.txt @@ -5,4 +5,4 @@ Content-Type: application/xml Content-Length: ? Connection: close -grant_type=password&username=${username}&password=${password}&dc_target=${dc_target} \ No newline at end of file +grant_type=password&username=${username}&password=${password}&p_target=${p_target} \ No newline at end of file diff --git a/src/test/resources/request/authn/password-tc-ch.txt b/src/test/resources/request/authn/password-tc-ch.txt index ccf60abb1..7bb4f371c 100644 --- a/src/test/resources/request/authn/password-tc-ch.txt +++ b/src/test/resources/request/authn/password-tc-ch.txt @@ -6,4 +6,4 @@ Accept: application/json Authorization: Basic ${base64idpw} Connection: close -grant_type=password&username=${username}&password=${password}&dc_target=${dc_target} \ No newline at end of file +grant_type=password&username=${username}&password=${password}&p_target=${p_target} \ No newline at end of file diff --git a/src/test/resources/request/authn/password-tc-cp.txt b/src/test/resources/request/authn/password-tc-cp.txt index 721766dbc..64859c8f5 100644 --- a/src/test/resources/request/authn/password-tc-cp.txt +++ b/src/test/resources/request/authn/password-tc-cp.txt @@ -5,4 +5,4 @@ Content-Length: ? Accept: application/json Connection: close -grant_type=password&username=${username}&password=${password}&client_id=${client_id}&client_secret=${client_secret}&dc_target=${dc_target} \ No newline at end of file +grant_type=password&username=${username}&password=${password}&client_id=${client_id}&client_secret=${client_secret}&p_target=${p_target} \ No newline at end of file diff --git a/src/test/resources/request/authn/refresh-tc.txt b/src/test/resources/request/authn/refresh-tc.txt index 4b7f01566..ee8f09cdd 100644 --- a/src/test/resources/request/authn/refresh-tc.txt +++ b/src/test/resources/request/authn/refresh-tc.txt @@ -5,4 +5,4 @@ Content-Length: ? Accept: application/json Connection: close -grant_type=refresh_token&refresh_token=${refresh_token}&dc_target=${dc_target} \ No newline at end of file +grant_type=refresh_token&refresh_token=${refresh_token}&p_target=${p_target} \ No newline at end of file diff --git a/src/test/resources/request/authn/saml-tc-c0.txt b/src/test/resources/request/authn/saml-tc-c0.txt index 53c0f91f1..c4bb6bb79 100644 --- a/src/test/resources/request/authn/saml-tc-c0.txt +++ b/src/test/resources/request/authn/saml-tc-c0.txt @@ -5,4 +5,4 @@ Content-Length: ? Accept: application/json Connection: close -grant_type=urn:ietf:params:oauth:grant-type:saml2-bearer&assertion=${assertion}&dc_target=${dc_target} \ No newline at end of file +grant_type=urn:ietf:params:oauth:grant-type:saml2-bearer&assertion=${assertion}&p_target=${p_target} \ No newline at end of file diff --git a/src/test/resources/request/authn/saml-tc-ch.txt b/src/test/resources/request/authn/saml-tc-ch.txt index 2842e58cc..672d4e8ad 100644 --- a/src/test/resources/request/authn/saml-tc-ch.txt +++ b/src/test/resources/request/authn/saml-tc-ch.txt @@ -6,4 +6,4 @@ Authorization: Basic ${base64idpw} Accept: application/json Connection: close -grant_type=urn:ietf:params:oauth:grant-type:saml2-bearer&assertion=${assertion}&dc_target=${dc_target} \ No newline at end of file +grant_type=urn:ietf:params:oauth:grant-type:saml2-bearer&assertion=${assertion}&p_target=${p_target} \ No newline at end of file diff --git a/src/test/resources/request/authn/saml-tc-cp.txt b/src/test/resources/request/authn/saml-tc-cp.txt index 9a874e0e2..af6cbb2ba 100644 --- a/src/test/resources/request/authn/saml-tc-cp.txt +++ b/src/test/resources/request/authn/saml-tc-cp.txt @@ -5,4 +5,4 @@ Content-Length: ? Accept: application/json Connection: close -grant_type=urn:ietf:params:oauth:grant-type:saml2-bearer&assertion=${assertion}&dc_target=${dc_target}&client_id=${client_id}&client_secret=${client_secret} \ No newline at end of file +grant_type=urn:ietf:params:oauth:grant-type:saml2-bearer&assertion=${assertion}&p_target=${p_target}&client_id=${client_id}&client_secret=${client_secret} \ No newline at end of file diff --git a/src/test/resources/request/authn/testOperationWithCookie-without-cookie.txt b/src/test/resources/request/authn/testOperationWithCookie-without-cookie.txt index 177c96e62..c923271c8 100644 --- a/src/test/resources/request/authn/testOperationWithCookie-without-cookie.txt +++ b/src/test/resources/request/authn/testOperationWithCookie-without-cookie.txt @@ -1,4 +1,4 @@ -GET /${cellPath}/${boxName}/${colName}/$metadata/EntityType?dc_cookie_peer=${dc_cookie_peer} HTTP/1.1 +GET /${cellPath}/${boxName}/${colName}/$metadata/EntityType?p_cookie_peer=${p_cookie_peer} HTTP/1.1 Host: ? Content-Length: ? Connection: close diff --git a/src/test/resources/request/authn/testOperationWithCookie.txt b/src/test/resources/request/authn/testOperationWithCookie.txt index 31aaa118b..6dc00d1dc 100644 --- a/src/test/resources/request/authn/testOperationWithCookie.txt +++ b/src/test/resources/request/authn/testOperationWithCookie.txt @@ -1,4 +1,4 @@ -GET /${cellPath}/${boxName}/${colName}/$metadata/EntityType?dc_cookie_peer=${dc_cookie_peer} HTTP/1.1 +GET /${cellPath}/${boxName}/${colName}/$metadata/EntityType?p_cookie_peer=${p_cookie_peer} HTTP/1.1 Host: ? Content-Length: ? Connection: close diff --git a/src/test/resources/request/authnUnit/password-uluut.txt b/src/test/resources/request/authnUnit/password-uluut.txt index ed0691fc2..d5b6239fc 100644 --- a/src/test/resources/request/authnUnit/password-uluut.txt +++ b/src/test/resources/request/authnUnit/password-uluut.txt @@ -4,4 +4,4 @@ Content-Type: application/x-www-form-urlencoded Content-Length: ? Connection: close -grant_type=password&username=${username}&password=${password}&dc_owner=true \ No newline at end of file +grant_type=password&username=${username}&password=${password}&p_owner=true \ No newline at end of file diff --git a/src/test/resources/request/authnUnit/refresh-uluut.txt b/src/test/resources/request/authnUnit/refresh-uluut.txt index 1c0454d69..b927d860d 100644 --- a/src/test/resources/request/authnUnit/refresh-uluut.txt +++ b/src/test/resources/request/authnUnit/refresh-uluut.txt @@ -5,4 +5,4 @@ Content-Length: ? Accept: application/json Connection: close -grant_type=refresh_token&refresh_token=${refresh_token}&dc_owner=true \ No newline at end of file +grant_type=refresh_token&refresh_token=${refresh_token}&p_owner=true \ No newline at end of file diff --git a/src/test/resources/request/authnUnit/saml-uluut.txt b/src/test/resources/request/authnUnit/saml-uluut.txt index 29a1fc720..f21ccf005 100644 --- a/src/test/resources/request/authnUnit/saml-uluut.txt +++ b/src/test/resources/request/authnUnit/saml-uluut.txt @@ -5,4 +5,4 @@ Content-Length: ? Accept: application/json Connection: close -grant_type=urn:ietf:params:oauth:grant-type:saml2-bearer&assertion=${assertion}&dc_owner=true \ No newline at end of file +grant_type=urn:ietf:params:oauth:grant-type:saml2-bearer&assertion=${assertion}&p_owner=true \ No newline at end of file diff --git a/src/test/resources/request/box/acl-2role-setting.txt b/src/test/resources/request/box/acl-2role-setting.txt index 561fd2613..d84fa5edd 100644 --- a/src/test/resources/request/box/acl-2role-setting.txt +++ b/src/test/resources/request/box/acl-2role-setting.txt @@ -8,8 +8,8 @@ Authorization: ${token} + xmlns:p="urn:x-personium:xmlns" + p:requireSchemaAuthz="${level}"> ${role1} diff --git a/src/test/resources/request/box/acl-all.txt b/src/test/resources/request/box/acl-all.txt index 58287d906..9b04e3fd1 100644 --- a/src/test/resources/request/box/acl-all.txt +++ b/src/test/resources/request/box/acl-all.txt @@ -8,8 +8,8 @@ Authorization: Bearer ${token} + xmlns:p="urn:x-personium:xmlns" + p:requireSchemaAuthz="${level}"> diff --git a/src/test/resources/request/box/acl-authtest.txt b/src/test/resources/request/box/acl-authtest.txt index 2f9f943d3..a7fcfd3f7 100644 --- a/src/test/resources/request/box/acl-authtest.txt +++ b/src/test/resources/request/box/acl-authtest.txt @@ -8,8 +8,8 @@ Authorization: Bearer ${token} + xmlns:p="urn:x-personium:xmlns" + p:requireSchemaAuthz="${level}"> ${roleBaseUrl}role2 diff --git a/src/test/resources/request/box/acl-authtestProppatch.txt b/src/test/resources/request/box/acl-authtestProppatch.txt index 6b977ea7c..e5945820b 100644 --- a/src/test/resources/request/box/acl-authtestProppatch.txt +++ b/src/test/resources/request/box/acl-authtestProppatch.txt @@ -8,8 +8,8 @@ Authorization: Bearer ${token} + xmlns:p="urn:x-personium:xmlns" + p:requireSchemaAuthz="${level}"> ${roleBaseUrl}roleRead diff --git a/src/test/resources/request/box/acl-default.txt b/src/test/resources/request/box/acl-default.txt index bc3f93be7..5625de6be 100644 --- a/src/test/resources/request/box/acl-default.txt +++ b/src/test/resources/request/box/acl-default.txt @@ -8,8 +8,8 @@ Authorization: Bearer ${token} + xmlns:p="urn:x-personium:xmlns" + p:requireSchemaAuthz="${level}"> ${roleBaseUrl}role1 diff --git a/src/test/resources/request/box/acl-null.txt b/src/test/resources/request/box/acl-null.txt index 69b5289d4..646fd4622 100644 --- a/src/test/resources/request/box/acl-null.txt +++ b/src/test/resources/request/box/acl-null.txt @@ -8,6 +8,6 @@ Authorization: Bearer ${token} + xmlns:p="urn:x-personium:xmlns" + p:requireSchemaAuthz="${level}"> diff --git a/src/test/resources/request/box/acl-role-not-found.txt b/src/test/resources/request/box/acl-role-not-found.txt index 021de3405..288848953 100644 --- a/src/test/resources/request/box/acl-role-not-found.txt +++ b/src/test/resources/request/box/acl-role-not-found.txt @@ -8,8 +8,8 @@ Authorization: Bearer ${token} + xmlns:p="urn:x-personium:xmlns" + p:requireSchemaAuthz="${level}"> ${roleBaseUrl}rolehoge diff --git a/src/test/resources/request/box/acl-service.txt b/src/test/resources/request/box/acl-service.txt index 3ccb20d1a..ee58f6cfd 100644 --- a/src/test/resources/request/box/acl-service.txt +++ b/src/test/resources/request/box/acl-service.txt @@ -8,8 +8,8 @@ Authorization: Bearer ${token} + xmlns:p="urn:x-personium:xmlns" + p:requireSchemaAuthz="${level}"> ${roleBaseUrl}role1 diff --git a/src/test/resources/request/box/acl-setscheme.txt b/src/test/resources/request/box/acl-setscheme.txt index dee1ab4d1..2576a96ef 100644 --- a/src/test/resources/request/box/acl-setscheme.txt +++ b/src/test/resources/request/box/acl-setscheme.txt @@ -8,8 +8,8 @@ Authorization: Bearer ${token} + xmlns:p="urn:x-personium:xmlns" + p:requireSchemaAuthz="${level}"> role2 diff --git a/src/test/resources/request/box/acl-setting-all-role.txt b/src/test/resources/request/box/acl-setting-all-role.txt index 2f0001af2..a314c9d28 100644 --- a/src/test/resources/request/box/acl-setting-all-role.txt +++ b/src/test/resources/request/box/acl-setting-all-role.txt @@ -8,8 +8,8 @@ Authorization: Bearer ${token} + xmlns:p="urn:x-personium:xmlns" + p:requireSchemaAuthz="${level}"> ${role} diff --git a/src/test/resources/request/box/acl-setting-all.txt b/src/test/resources/request/box/acl-setting-all.txt index 302666561..265d20f01 100644 --- a/src/test/resources/request/box/acl-setting-all.txt +++ b/src/test/resources/request/box/acl-setting-all.txt @@ -8,8 +8,8 @@ Authorization: Bearer ${token} + xmlns:p="urn:x-personium:xmlns" + p:requireSchemaAuthz="${level}"> diff --git a/src/test/resources/request/box/acl-setting-baseurl.txt b/src/test/resources/request/box/acl-setting-baseurl.txt index 3771f7ff0..28f957345 100644 --- a/src/test/resources/request/box/acl-setting-baseurl.txt +++ b/src/test/resources/request/box/acl-setting-baseurl.txt @@ -8,8 +8,8 @@ Authorization: Bearer ${token} + xmlns:p="urn:x-personium:xmlns" + p:requireSchemaAuthz="${level}"> ${roleBaseUrl} diff --git a/src/test/resources/request/box/acl-setting.txt b/src/test/resources/request/box/acl-setting.txt index 0b54e32f4..6c95b243e 100644 --- a/src/test/resources/request/box/acl-setting.txt +++ b/src/test/resources/request/box/acl-setting.txt @@ -8,8 +8,8 @@ Authorization: Bearer ${token} + xmlns:p="urn:x-personium:xmlns" + p:requireSchemaAuthz="${level}"> ${role} diff --git a/src/test/resources/request/box/acl.txt b/src/test/resources/request/box/acl.txt index 227f5de83..6211f1fe4 100644 --- a/src/test/resources/request/box/acl.txt +++ b/src/test/resources/request/box/acl.txt @@ -8,8 +8,8 @@ Authorization: Bearer ${token} + xmlns:p="urn:x-personium:xmlns" + p:requireSchemaAuthz="${level}"> ${roleBaseUrl}role1 diff --git a/src/test/resources/request/box/mkcol-normal-anyAuthSchema.txt b/src/test/resources/request/box/mkcol-normal-anyAuthSchema.txt index aeb35e63b..9e3893c8a 100644 --- a/src/test/resources/request/box/mkcol-normal-anyAuthSchema.txt +++ b/src/test/resources/request/box/mkcol-normal-anyAuthSchema.txt @@ -7,7 +7,7 @@ Content-Type: application/xml Authorization: ${token} - + diff --git a/src/test/resources/request/box/mkcol-normal.txt b/src/test/resources/request/box/mkcol-normal.txt index 280be454a..e56410ba1 100644 --- a/src/test/resources/request/box/mkcol-normal.txt +++ b/src/test/resources/request/box/mkcol-normal.txt @@ -7,7 +7,7 @@ Content-Type: application/xml Authorization: Bearer ${token} - + diff --git a/src/test/resources/request/box/mkcol-odata.txt b/src/test/resources/request/box/mkcol-odata.txt index ea3dbdd01..3a5d0bd06 100644 --- a/src/test/resources/request/box/mkcol-odata.txt +++ b/src/test/resources/request/box/mkcol-odata.txt @@ -7,12 +7,12 @@ Content-Type: application/xml Authorization: Bearer ${token} - + - + diff --git a/src/test/resources/request/box/mkcol-service-fullpath.txt b/src/test/resources/request/box/mkcol-service-fullpath.txt index ddfb6559b..b980575df 100644 --- a/src/test/resources/request/box/mkcol-service-fullpath.txt +++ b/src/test/resources/request/box/mkcol-service-fullpath.txt @@ -7,12 +7,12 @@ Content-Type: application/xml Authorization: ${token} - + - + diff --git a/src/test/resources/request/box/mkcol-service.txt b/src/test/resources/request/box/mkcol-service.txt index 563d5d2bf..f2e20fda0 100644 --- a/src/test/resources/request/box/mkcol-service.txt +++ b/src/test/resources/request/box/mkcol-service.txt @@ -7,12 +7,12 @@ Content-Type: application/xml Authorization: Bearer ${token} - + - + diff --git a/src/test/resources/request/box/mkcol.txt b/src/test/resources/request/box/mkcol.txt index c74cd4425..03c87a365 100644 --- a/src/test/resources/request/box/mkcol.txt +++ b/src/test/resources/request/box/mkcol.txt @@ -7,7 +7,7 @@ Content-Type: application/xml Authorization: Bearer ${token} - + diff --git a/src/test/resources/request/box/proppatch-class.txt b/src/test/resources/request/box/proppatch-class.txt index c5ed24d79..7613bd124 100644 --- a/src/test/resources/request/box/proppatch-class.txt +++ b/src/test/resources/request/box/proppatch-class.txt @@ -8,15 +8,15 @@ Authorization: Bearer ${token} - - - - - + + + + + diff --git a/src/test/resources/request/box/proppatch-remove.txt b/src/test/resources/request/box/proppatch-remove.txt index 62104c648..556ad3781 100644 --- a/src/test/resources/request/box/proppatch-remove.txt +++ b/src/test/resources/request/box/proppatch-remove.txt @@ -8,12 +8,12 @@ Authorization: Bearer ${token} - + diff --git a/src/test/resources/request/box/proppatch-set-service-path.txt b/src/test/resources/request/box/proppatch-set-service-path.txt index a8117af34..1798d1538 100644 --- a/src/test/resources/request/box/proppatch-set-service-path.txt +++ b/src/test/resources/request/box/proppatch-set-service-path.txt @@ -8,13 +8,13 @@ Authorization: Bearer ${token} - - - + + + diff --git a/src/test/resources/request/box/proppatch-set-service.txt b/src/test/resources/request/box/proppatch-set-service.txt index 2b6dc0d89..c43243494 100644 --- a/src/test/resources/request/box/proppatch-set-service.txt +++ b/src/test/resources/request/box/proppatch-set-service.txt @@ -8,13 +8,13 @@ Authorization: Bearer ${token} - - - + + + diff --git a/src/test/resources/request/box/proppatch-set.txt b/src/test/resources/request/box/proppatch-set.txt index f5de3c5c4..521ecfb45 100644 --- a/src/test/resources/request/box/proppatch-set.txt +++ b/src/test/resources/request/box/proppatch-set.txt @@ -8,12 +8,12 @@ Authorization: Bearer ${token} ${author1} - ${hoge} + ${hoge} diff --git a/src/test/resources/request/box/proppatch.txt b/src/test/resources/request/box/proppatch.txt index 169fe02bf..7914ee03b 100644 --- a/src/test/resources/request/box/proppatch.txt +++ b/src/test/resources/request/box/proppatch.txt @@ -8,18 +8,18 @@ Authorization: ${token} ${author1} - ${hoge} + ${hoge} - + diff --git a/src/test/resources/request/cell-createWithOwner.txt b/src/test/resources/request/cell-createWithOwner.txt index 1cd606ea5..dfab30085 100644 --- a/src/test/resources/request/cell-createWithOwner.txt +++ b/src/test/resources/request/cell-createWithOwner.txt @@ -5,6 +5,6 @@ Connection: close Accept: application/json Content-Type: application/json Authorization: Bearer ${token} -X-Dc-Unit-User: ${owner} +X-Personium-Unit-User: ${owner} {"Name":"${cellPath}"} diff --git a/src/test/resources/request/cell-deleteWithOwner.txt b/src/test/resources/request/cell-deleteWithOwner.txt index 4d41e0a4a..6299a8a96 100644 --- a/src/test/resources/request/cell-deleteWithOwner.txt +++ b/src/test/resources/request/cell-deleteWithOwner.txt @@ -4,6 +4,6 @@ Content-Length: ? Connection: close Content-Type: application/json Authorization: Bearer ${token} -X-Dc-Unit-User: ${owner} +X-Personium-Unit-User: ${owner} If-Match: * diff --git a/src/test/resources/request/cell-getWithOwner.txt b/src/test/resources/request/cell-getWithOwner.txt index aad2445ad..761aaaa74 100644 --- a/src/test/resources/request/cell-getWithOwner.txt +++ b/src/test/resources/request/cell-getWithOwner.txt @@ -5,5 +5,5 @@ Connection: close Accept: application/json Content-Type: application/json Authorization: Bearer ${token} -X-Dc-Unit-User: ${owner} +X-Personium-Unit-User: ${owner} diff --git a/src/test/resources/request/cell-retrieveWithOwner.txt b/src/test/resources/request/cell-retrieveWithOwner.txt index 1ee9f6216..d483b3340 100644 --- a/src/test/resources/request/cell-retrieveWithOwner.txt +++ b/src/test/resources/request/cell-retrieveWithOwner.txt @@ -5,5 +5,5 @@ Connection: close Accept: application/json Content-Type: application/json Authorization: Bearer ${token} -X-Dc-Unit-User: ${owner} +X-Personium-Unit-User: ${owner} diff --git a/src/test/resources/request/cell-updateWithOwner.txt b/src/test/resources/request/cell-updateWithOwner.txt index 000396cb2..4fdd7957d 100644 --- a/src/test/resources/request/cell-updateWithOwner.txt +++ b/src/test/resources/request/cell-updateWithOwner.txt @@ -6,6 +6,6 @@ Accept: application/json Content-Type: application/json Authorization: Bearer ${token} If-Match: * -X-Dc-Unit-User: ${owner} +X-Personium-Unit-User: ${owner} {"Name":"${cellName}"} diff --git a/src/test/resources/request/cell/acl-authtest.txt b/src/test/resources/request/cell/acl-authtest.txt index de98fefbf..2adf56ea1 100644 --- a/src/test/resources/request/cell/acl-authtest.txt +++ b/src/test/resources/request/cell/acl-authtest.txt @@ -7,13 +7,13 @@ Content-Type: application/xml Authorization: Bearer ${token} - + role10 - + @@ -21,7 +21,7 @@ Authorization: Bearer ${token} role11 - + @@ -29,7 +29,7 @@ Authorization: Bearer ${token} role12 - + @@ -37,7 +37,7 @@ Authorization: Bearer ${token} role13 - + @@ -45,7 +45,7 @@ Authorization: Bearer ${token} role14 - + @@ -53,7 +53,7 @@ Authorization: Bearer ${token} role15 - + @@ -61,7 +61,7 @@ Authorization: Bearer ${token} role17 - + @@ -69,8 +69,8 @@ Authorization: Bearer ${token} role18 - - + + @@ -78,8 +78,8 @@ Authorization: Bearer ${token} role19 - - + + @@ -87,7 +87,7 @@ Authorization: Bearer ${token} role20 - + @@ -95,7 +95,7 @@ Authorization: Bearer ${token} role21 - + @@ -103,7 +103,7 @@ Authorization: Bearer ${token} role22 - + @@ -111,7 +111,7 @@ Authorization: Bearer ${token} role23 - + @@ -119,7 +119,7 @@ Authorization: Bearer ${token} role24 - + @@ -127,7 +127,7 @@ Authorization: Bearer ${token} role25
    - +
    @@ -135,7 +135,7 @@ Authorization: Bearer ${token} role26 - + @@ -143,7 +143,7 @@ Authorization: Bearer ${token} role27 - + @@ -151,8 +151,8 @@ Authorization: Bearer ${token} role28 - - + + @@ -160,7 +160,7 @@ Authorization: Bearer ${token} role29 - + @@ -168,7 +168,7 @@ Authorization: Bearer ${token} role30 - +
    diff --git a/src/test/resources/request/cell/acl-setting-all.txt b/src/test/resources/request/cell/acl-setting-all.txt index 0c669cf66..4ef7f38a4 100644 --- a/src/test/resources/request/cell/acl-setting-all.txt +++ b/src/test/resources/request/cell/acl-setting-all.txt @@ -7,13 +7,13 @@ Content-Type: application/xml Authorization: ${token} - + - + diff --git a/src/test/resources/request/cell/acl-setting-cell-box.txt b/src/test/resources/request/cell/acl-setting-cell-box.txt new file mode 100644 index 000000000..0a85eaea5 --- /dev/null +++ b/src/test/resources/request/cell/acl-setting-cell-box.txt @@ -0,0 +1,29 @@ +ACL /${url} HTTP/1.1 +Host: ? +Content-Length: ? +Connection: close +Accept: application/xml +Content-Type: application/xml +Authorization: Bearer ${token} + + + + + + ${roleBaseUrl}${role1} + + + + + + + + + + ${roleBaseUrl}${role2} + + + + + + \ No newline at end of file diff --git a/src/test/resources/request/cell/acl-setting-cell-none-box.txt b/src/test/resources/request/cell/acl-setting-cell-none-box.txt new file mode 100644 index 000000000..02926ecac --- /dev/null +++ b/src/test/resources/request/cell/acl-setting-cell-none-box.txt @@ -0,0 +1,30 @@ +ACL /${url} HTTP/1.1 +Host: ? +Content-Length: ? +Connection: close +Accept: application/xml +Content-Type: application/xml +Authorization: Bearer ${token} + + + + + + ${roleBaseUrl}${role1} + + + + + + + + + + + ${roleBaseUrl}${role2} + + + + + + \ No newline at end of file diff --git a/src/test/resources/request/cell/acl-setting-request.txt b/src/test/resources/request/cell/acl-setting-request.txt index c329f1b8b..35c04f27d 100644 --- a/src/test/resources/request/cell/acl-setting-request.txt +++ b/src/test/resources/request/cell/acl-setting-request.txt @@ -7,14 +7,15 @@ Content-Type: application/xml Authorization: Bearer ${token} - + ${roleBaseUrl}${role1} - - + + + @@ -22,7 +23,7 @@ Authorization: Bearer ${token} ${roleBaseUrl}${role2} - + diff --git a/src/test/resources/request/cell/cell-bulk-delete.txt b/src/test/resources/request/cell/cell-bulk-delete.txt index 0cc39b611..b9f407eef 100644 --- a/src/test/resources/request/cell/cell-bulk-delete.txt +++ b/src/test/resources/request/cell/cell-bulk-delete.txt @@ -4,5 +4,5 @@ Content-Length: ? Connection: close Accept: application/json Authorization: Bearer ${token} -X-Dc-Recursive: true +X-Personium-Recursive: true diff --git a/src/test/resources/request/cell/cell-event-anyAuthSchema.txt b/src/test/resources/request/cell/cell-event-anyAuthSchema.txt index e7cbfc7bb..0cbb6d759 100644 --- a/src/test/resources/request/cell/cell-event-anyAuthSchema.txt +++ b/src/test/resources/request/cell/cell-event-anyAuthSchema.txt @@ -3,6 +3,6 @@ Host: ? Content-Length: ? Connection: close Authorization: ${authorization} -X-Dc-RequestKey: ${requestKey} +X-Personium-RequestKey: ${requestKey} ${json} \ No newline at end of file diff --git a/src/test/resources/request/cell/cell-event.txt b/src/test/resources/request/cell/cell-event.txt index b8a242175..b2ecaaf60 100644 --- a/src/test/resources/request/cell/cell-event.txt +++ b/src/test/resources/request/cell/cell-event.txt @@ -3,6 +3,6 @@ Host: ? Content-Length: ? Connection: close Authorization: Bearer ${token} -X-Dc-RequestKey: ${requestKey} +X-Personium-RequestKey: ${requestKey} ${json} \ No newline at end of file diff --git a/src/test/resources/request/cell/event-proppacth.txt b/src/test/resources/request/cell/event-proppacth.txt index d19587c86..ea0459201 100644 --- a/src/test/resources/request/cell/event-proppacth.txt +++ b/src/test/resources/request/cell/event-proppacth.txt @@ -8,12 +8,12 @@ Authorization: Bearer ${token} ${author1} - ${hoge} + ${hoge} diff --git a/src/test/resources/request/cell/proppacth-anyAuthSchema.txt b/src/test/resources/request/cell/proppacth-anyAuthSchema.txt index 5892c3f53..9b5e7d0c4 100644 --- a/src/test/resources/request/cell/proppacth-anyAuthSchema.txt +++ b/src/test/resources/request/cell/proppacth-anyAuthSchema.txt @@ -8,7 +8,7 @@ Authorization: ${authorization} diff --git a/src/test/resources/request/cell/proppatch-remove-setPropKey.txt b/src/test/resources/request/cell/proppatch-remove-setPropKey.txt index 468cf8066..0474113b2 100644 --- a/src/test/resources/request/cell/proppatch-remove-setPropKey.txt +++ b/src/test/resources/request/cell/proppatch-remove-setPropKey.txt @@ -8,12 +8,12 @@ Authorization: Bearer ${token} - + diff --git a/src/test/resources/request/cell/proppatch-remove.txt b/src/test/resources/request/cell/proppatch-remove.txt index 9f4630aaf..c71c06332 100644 --- a/src/test/resources/request/cell/proppatch-remove.txt +++ b/src/test/resources/request/cell/proppatch-remove.txt @@ -8,12 +8,12 @@ Authorization: Bearer ${token} - + diff --git a/src/test/resources/request/cell/proppatch-set-setPropKey.txt b/src/test/resources/request/cell/proppatch-set-setPropKey.txt index aa17edfb7..f53e18097 100644 --- a/src/test/resources/request/cell/proppatch-set-setPropKey.txt +++ b/src/test/resources/request/cell/proppatch-set-setPropKey.txt @@ -8,12 +8,12 @@ Authorization: Bearer ${token} ${author1} - ${hoge} + ${hoge} diff --git a/src/test/resources/request/cell/proppatch-set.txt b/src/test/resources/request/cell/proppatch-set.txt index 470e39e01..af6de55ec 100644 --- a/src/test/resources/request/cell/proppatch-set.txt +++ b/src/test/resources/request/cell/proppatch-set.txt @@ -8,12 +8,12 @@ Authorization: Bearer ${token} ${author1} - ${hoge} + ${hoge} diff --git a/src/test/resources/request/cell/proppatch-uluut.txt b/src/test/resources/request/cell/proppatch-uluut.txt index ad6aa75b8..4df76a395 100644 --- a/src/test/resources/request/cell/proppatch-uluut.txt +++ b/src/test/resources/request/cell/proppatch-uluut.txt @@ -7,10 +7,10 @@ Content-Type: application/xml Authorization: Bearer ${token} - + - account1account2 + account1account2 diff --git a/src/test/resources/requestData/barInstall/V1_1_2_bar_90rootprops.bar b/src/test/resources/requestData/barInstall/V1_1_2_bar_90rootprops.bar index 992c84443..0a7052175 100644 Binary files a/src/test/resources/requestData/barInstall/V1_1_2_bar_90rootprops.bar and b/src/test/resources/requestData/barInstall/V1_1_2_bar_90rootprops.bar differ diff --git a/src/test/resources/requestData/barInstall/V1_1_2_bar_service_source.bar b/src/test/resources/requestData/barInstall/V1_1_2_bar_service_source.bar index 9cfb2fa75..f711f8c07 100644 Binary files a/src/test/resources/requestData/barInstall/V1_1_2_bar_service_source.bar and b/src/test/resources/requestData/barInstall/V1_1_2_bar_service_source.bar differ diff --git a/src/test/resources/requestData/barInstall/V1_1_2_bar_webdav_davodatacol.bar b/src/test/resources/requestData/barInstall/V1_1_2_bar_webdav_davodatacol.bar index 9f249ff75..a98c25c0f 100644 Binary files a/src/test/resources/requestData/barInstall/V1_1_2_bar_webdav_davodatacol.bar and b/src/test/resources/requestData/barInstall/V1_1_2_bar_webdav_davodatacol.bar differ diff --git a/src/test/resources/requestData/barInstall/V1_1_2_bar_webdav_odata.bar b/src/test/resources/requestData/barInstall/V1_1_2_bar_webdav_odata.bar index e7f7a9e0a..8ca8d5a60 100644 Binary files a/src/test/resources/requestData/barInstall/V1_1_2_bar_webdav_odata.bar and b/src/test/resources/requestData/barInstall/V1_1_2_bar_webdav_odata.bar differ diff --git a/src/test/resources/requestData/barInstall/V1_3_12_bar_maximum.bar b/src/test/resources/requestData/barInstall/V1_3_12_bar_maximum.bar index cca56841a..c39366e11 100644 Binary files a/src/test/resources/requestData/barInstall/V1_3_12_bar_maximum.bar and b/src/test/resources/requestData/barInstall/V1_3_12_bar_maximum.bar differ diff --git a/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_multi_attr_empty.xml b/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_multi_attr_empty.xml index 15261932b..dcd268ce5 100644 --- a/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_multi_attr_empty.xml +++ b/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_multi_attr_empty.xml @@ -17,7 +17,7 @@ limitations under the License. --> - + diff --git a/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_multi_attr_invalid.xml b/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_multi_attr_invalid.xml index fc84da314..fa7682029 100644 --- a/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_multi_attr_invalid.xml +++ b/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_multi_attr_invalid.xml @@ -17,7 +17,7 @@ limitations under the License. --> - + diff --git a/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_multi_attr_notexist.xml b/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_multi_attr_notexist.xml index a713f2574..494c00429 100644 --- a/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_multi_attr_notexist.xml +++ b/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_multi_attr_notexist.xml @@ -17,7 +17,7 @@ limitations under the License. --> - + diff --git a/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_name_attr_empty.xml b/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_name_attr_empty.xml index eb858a5f7..1e2e2fd7b 100644 --- a/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_name_attr_empty.xml +++ b/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_name_attr_empty.xml @@ -17,7 +17,7 @@ limitations under the License. --> - + diff --git a/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_name_attr_notexist.xml b/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_name_attr_notexist.xml index 6a10a08e2..f1bb1f5b1 100644 --- a/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_name_attr_notexist.xml +++ b/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_name_attr_notexist.xml @@ -17,7 +17,7 @@ limitations under the License. --> - + diff --git a/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_role_attr_empty.xml b/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_role_attr_empty.xml index 97bd181e8..a9ca9c220 100644 --- a/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_role_attr_empty.xml +++ b/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_role_attr_empty.xml @@ -17,7 +17,7 @@ limitations under the License. --> - + diff --git a/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_role_attr_invalid.xml b/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_role_attr_invalid.xml index 64b4989e0..77b158ec1 100644 --- a/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_role_attr_invalid.xml +++ b/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_role_attr_invalid.xml @@ -17,7 +17,7 @@ limitations under the License. --> - + diff --git a/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_role_attr_notexist.xml b/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_role_attr_notexist.xml index 5c1c4bca4..cda573c50 100644 --- a/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_role_attr_notexist.xml +++ b/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_role_attr_notexist.xml @@ -17,7 +17,7 @@ limitations under the License. --> - + diff --git a/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_type_attr_empty.xml b/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_type_attr_empty.xml index 33f53feb4..ccc04fdee 100644 --- a/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_type_attr_empty.xml +++ b/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_type_attr_empty.xml @@ -17,7 +17,7 @@ limitations under the License. --> - + diff --git a/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_type_attr_invalid.xml b/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_type_attr_invalid.xml index 5d82803e2..10080b734 100644 --- a/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_type_attr_invalid.xml +++ b/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_type_attr_invalid.xml @@ -17,7 +17,7 @@ limitations under the License. --> - + diff --git a/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_type_attr_notexist.xml b/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_type_attr_notexist.xml index 3524dd645..d41fc2e4d 100644 --- a/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_type_attr_notexist.xml +++ b/src/test/resources/requestData/barInstallUnit/00_$metadata_associaton_type_attr_notexist.xml @@ -17,7 +17,7 @@ limitations under the License. --> - + diff --git a/src/test/resources/requestData/barInstallUnit/00_$metadata_complex_name_attr_empty.xml b/src/test/resources/requestData/barInstallUnit/00_$metadata_complex_name_attr_empty.xml index 8110142b0..00d7c2a13 100644 --- a/src/test/resources/requestData/barInstallUnit/00_$metadata_complex_name_attr_empty.xml +++ b/src/test/resources/requestData/barInstallUnit/00_$metadata_complex_name_attr_empty.xml @@ -17,7 +17,7 @@ limitations under the License. --> - + diff --git a/src/test/resources/requestData/barInstallUnit/00_$metadata_complex_name_attr_notexist.xml b/src/test/resources/requestData/barInstallUnit/00_$metadata_complex_name_attr_notexist.xml index d0d349743..18c5d3a36 100644 --- a/src/test/resources/requestData/barInstallUnit/00_$metadata_complex_name_attr_notexist.xml +++ b/src/test/resources/requestData/barInstallUnit/00_$metadata_complex_name_attr_notexist.xml @@ -17,7 +17,7 @@ limitations under the License. --> - + diff --git a/src/test/resources/requestData/barInstallUnit/00_$metadata_compprop_nullable_empty.xml b/src/test/resources/requestData/barInstallUnit/00_$metadata_compprop_nullable_empty.xml index 968f0c56c..eb6627ef8 100644 --- a/src/test/resources/requestData/barInstallUnit/00_$metadata_compprop_nullable_empty.xml +++ b/src/test/resources/requestData/barInstallUnit/00_$metadata_compprop_nullable_empty.xml @@ -16,7 +16,7 @@ limitations under the License. --> - + @@ -28,7 +28,7 @@ - + @@ -39,7 +39,7 @@ - + diff --git a/src/test/resources/requestData/barInstallUnit/00_$metadata_compprop_nullable_invalid.xml b/src/test/resources/requestData/barInstallUnit/00_$metadata_compprop_nullable_invalid.xml index ae90886e4..b0d466d91 100644 --- a/src/test/resources/requestData/barInstallUnit/00_$metadata_compprop_nullable_invalid.xml +++ b/src/test/resources/requestData/barInstallUnit/00_$metadata_compprop_nullable_invalid.xml @@ -16,7 +16,7 @@ limitations under the License. --> - + @@ -28,7 +28,7 @@ - + @@ -39,7 +39,7 @@ - + diff --git a/src/test/resources/requestData/barInstallUnit/00_$metadata_compprop_type_attr_invalid.xml b/src/test/resources/requestData/barInstallUnit/00_$metadata_compprop_type_attr_invalid.xml index 1bf427189..ecf626af2 100644 --- a/src/test/resources/requestData/barInstallUnit/00_$metadata_compprop_type_attr_invalid.xml +++ b/src/test/resources/requestData/barInstallUnit/00_$metadata_compprop_type_attr_invalid.xml @@ -16,7 +16,7 @@ limitations under the License. --> - + @@ -28,7 +28,7 @@ - + @@ -39,7 +39,7 @@ - + diff --git a/src/test/resources/requestData/barInstallUnit/00_$metadata_compprop_type_circular_ref.xml b/src/test/resources/requestData/barInstallUnit/00_$metadata_compprop_type_circular_ref.xml index 168324d71..7a39ea03f 100644 --- a/src/test/resources/requestData/barInstallUnit/00_$metadata_compprop_type_circular_ref.xml +++ b/src/test/resources/requestData/barInstallUnit/00_$metadata_compprop_type_circular_ref.xml @@ -17,7 +17,7 @@ limitations under the License. --> - + @@ -28,7 +28,7 @@ - + @@ -36,7 +36,7 @@ - + diff --git a/src/test/resources/requestData/barInstallUnit/00_$metadata_compprop_type_notexist.xml b/src/test/resources/requestData/barInstallUnit/00_$metadata_compprop_type_notexist.xml index a3e8bbbec..78ce410e2 100644 --- a/src/test/resources/requestData/barInstallUnit/00_$metadata_compprop_type_notexist.xml +++ b/src/test/resources/requestData/barInstallUnit/00_$metadata_compprop_type_notexist.xml @@ -17,7 +17,7 @@ limitations under the License. --> - + @@ -28,7 +28,7 @@ - + @@ -36,7 +36,7 @@ - + diff --git a/src/test/resources/requestData/barInstallUnit/00_$metadata_entity_name_attr_empty.xml b/src/test/resources/requestData/barInstallUnit/00_$metadata_entity_name_attr_empty.xml index 3f50f1db9..09497de6b 100644 --- a/src/test/resources/requestData/barInstallUnit/00_$metadata_entity_name_attr_empty.xml +++ b/src/test/resources/requestData/barInstallUnit/00_$metadata_entity_name_attr_empty.xml @@ -17,14 +17,14 @@ limitations under the License. --> - + - + @@ -32,7 +32,7 @@ - + diff --git a/src/test/resources/requestData/barInstallUnit/00_$metadata_entity_name_attr_notexist.xml b/src/test/resources/requestData/barInstallUnit/00_$metadata_entity_name_attr_notexist.xml index 58dba7326..b7aa5816e 100644 --- a/src/test/resources/requestData/barInstallUnit/00_$metadata_entity_name_attr_notexist.xml +++ b/src/test/resources/requestData/barInstallUnit/00_$metadata_entity_name_attr_notexist.xml @@ -17,14 +17,14 @@ limitations under the License. --> - + - + @@ -32,7 +32,7 @@ - + diff --git a/src/test/resources/requestData/barInstallUnit/00_$metadata_entity_notexist.xml b/src/test/resources/requestData/barInstallUnit/00_$metadata_entity_notexist.xml index f00646139..68f575162 100644 --- a/src/test/resources/requestData/barInstallUnit/00_$metadata_entity_notexist.xml +++ b/src/test/resources/requestData/barInstallUnit/00_$metadata_entity_notexist.xml @@ -17,7 +17,7 @@ limitations under the License. --> - + diff --git a/src/test/resources/requestData/barInstallUnit/00_$metadata_invalid_tag.xml b/src/test/resources/requestData/barInstallUnit/00_$metadata_invalid_tag.xml index e407c589c..af5db2a5c 100644 --- a/src/test/resources/requestData/barInstallUnit/00_$metadata_invalid_tag.xml +++ b/src/test/resources/requestData/barInstallUnit/00_$metadata_invalid_tag.xml @@ -17,14 +17,14 @@ limitations under the License. --> - + - + @@ -32,7 +32,7 @@ - + diff --git a/src/test/resources/requestData/barInstallUnit/00_$metadata_property_nullable_empty.xml b/src/test/resources/requestData/barInstallUnit/00_$metadata_property_nullable_empty.xml index ec5e4deae..8bd2f6b79 100644 --- a/src/test/resources/requestData/barInstallUnit/00_$metadata_property_nullable_empty.xml +++ b/src/test/resources/requestData/barInstallUnit/00_$metadata_property_nullable_empty.xml @@ -16,7 +16,7 @@ limitations under the License. --> - + @@ -24,7 +24,7 @@ - + @@ -34,7 +34,7 @@ - + diff --git a/src/test/resources/requestData/barInstallUnit/00_$metadata_property_nullable_invalid.xml b/src/test/resources/requestData/barInstallUnit/00_$metadata_property_nullable_invalid.xml index 298e5a0a8..410b296f8 100644 --- a/src/test/resources/requestData/barInstallUnit/00_$metadata_property_nullable_invalid.xml +++ b/src/test/resources/requestData/barInstallUnit/00_$metadata_property_nullable_invalid.xml @@ -16,7 +16,7 @@ limitations under the License. --> - + @@ -24,7 +24,7 @@ - + @@ -34,7 +34,7 @@ - + diff --git a/src/test/resources/requestData/barInstallUnit/00_$metadata_property_type_attr_invalid.xml b/src/test/resources/requestData/barInstallUnit/00_$metadata_property_type_attr_invalid.xml index a9f6b47a5..15caf58ae 100644 --- a/src/test/resources/requestData/barInstallUnit/00_$metadata_property_type_attr_invalid.xml +++ b/src/test/resources/requestData/barInstallUnit/00_$metadata_property_type_attr_invalid.xml @@ -16,7 +16,7 @@ limitations under the License. --> - + @@ -24,7 +24,7 @@ - + @@ -34,7 +34,7 @@ - + diff --git a/src/test/resources/requestData/barInstallUnit/00_$metadata_property_type_notexist.xml b/src/test/resources/requestData/barInstallUnit/00_$metadata_property_type_notexist.xml index ad962df53..473b8c2c3 100644 --- a/src/test/resources/requestData/barInstallUnit/00_$metadata_property_type_notexist.xml +++ b/src/test/resources/requestData/barInstallUnit/00_$metadata_property_type_notexist.xml @@ -17,14 +17,14 @@ limitations under the License. --> - + - + @@ -34,7 +34,7 @@ - +