svnno****@sourc*****
svnno****@sourc*****
2008年 11月 13日 (木) 00:57:43 JST
Revision: 2137 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=jiemamy&view=rev&rev=2137 Author: daisuke_m Date: 2008-11-13 00:57:43 +0900 (Thu, 13 Nov 2008) Log Message: ----------- [CORE-81] S2FactoryStrategyTest追加。 Modified Paths: -------------- zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/creator/FactoryStrategy.java Added Paths: ----------- artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/S2FactoryStrategyTest.java -------------- next part -------------- Added: artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/S2FactoryStrategyTest.java =================================================================== --- artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/S2FactoryStrategyTest.java (rev 0) +++ artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/S2FactoryStrategyTest.java 2008-11-12 15:57:43 UTC (rev 2137) @@ -0,0 +1,69 @@ +/* + * Copyright 2007-2008 MIYAMOTO Daisuke, jiemamy.org and the Others. + * Created on 2008/11/13 + * + * This file is part of Jiemamy. + * + * 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 org.jiemamy.core; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import org.jiemamy.spec.exception.JiemamyRuntimeException; +import org.jiemamy.spec.model.RootModel; + +/** + * TODO for daisuke + * @author daisuke + */ +public class S2FactoryStrategyTest { + + private S2FactoryStrategy strategy; + + + /** + * setup + * @throws java.lang.Exception + */ + @Before + public void setUp() throws Exception { + strategy = new S2FactoryStrategy("jiemamy-core.dicon"); + } + + /** + * teardown + * @throws java.lang.Exception + */ + @After + public void tearDown() throws Exception { + strategy = null; + } + + /** + * Jiemamyクラスは生成でき_その他クラスは生成できない。 + * @throws Exception + */ + @Test + public void test01_Jiemamyクラスは生成でき_その他クラスは生成できない() throws Exception { + strategy.create(RootModel.class); + + try { + strategy.create(Object.class); + } catch (JiemamyRuntimeException e) { + // success + } + } +} Property changes on: artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/S2FactoryStrategyTest.java ___________________________________________________________________ Name: svn:mime-type + text/plain Modified: zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/creator/FactoryStrategy.java =================================================================== --- zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/creator/FactoryStrategy.java 2008-11-12 15:51:32 UTC (rev 2136) +++ zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/creator/FactoryStrategy.java 2008-11-12 15:57:43 UTC (rev 2137) @@ -27,7 +27,7 @@ /** * Jiemamy関連クラスのインスタンスを生成する。 * @param <T> - * @param clazz + * @param clazz 要求するJiemamy関連クラス * @return Jiemamy関連クラスのインスタンス */ <T>T create(Class<T> clazz);