This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<beans> | |
<bean id="testAssembly" class="de.o2.bic.nbaa.postpaid. | |
compositemodel.assembly.TestAssembly"> | |
<constructor-arg ref="testAssemblyFlow"/> | |
<constructor-arg> | |
<bean id="testComponentAServices" class="java.util. | |
ArrayList"> | |
<constructor-arg> | |
<list> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding='utf-8'?> | |
<service xmlns="http://www.w3.org/2007/app" | |
xmlns:atom="http://www.w3.org/2005/Atom"> | |
<workspace> | |
<atom:title>My Pictures</atom:title> | |
<collection | |
href="http://example.org/pic" > | |
<atom:title>Pictures</atom:title> | |
<accept>image/png</accept> | |
<accept>image/jpeg</accept> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version=”1.0″ encoding=”UTF-8″ ?> | |
<record> | |
<name>Vasil</name> | |
<lastname>Remeniuk</lastname> | |
<email>[email protected]</email> | |
<address>Minsk, Belarus</address> | |
</record> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<mapper namespace="com.vasilrem.ideabox.model.TopicMapper"> | |
<resultMap id="topicResult" type="com.vasilrem.ideabox.model.Topic"> | |
<constructor> | |
<idArg column="id" javaType="String"/> | |
<arg column="name" javaType="String"/> | |
</constructor> | |
</resultMap> | |
<select id="getTopic" parameterType="String" resultMap="topicResult"> | |
SELECT ID, NAME FROM IDEA_TOPIC WHERE ID = #{value} | |
</select> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configuration> | |
<properties resource="properties/SqlMapConfig.properties" /> | |
<environments default="development"> | |
<environment id="development"> | |
<transactionManager type="JDBC"/> | |
<dataSource type="POOLED"> | |
<property name="driver" value="${driver}"/> | |
<property name="url" value="${url}"/> | |
<property name="username" value="${username}"/> | |
<property name="password" value="${password}"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IdeaBoxComponentSpecTest extends JUnit4(IdeaBoxAssemblySpec) | |
object IdeaBoxComponentSpecRunner extends ConsoleRunner(IdeaBoxAssemblySpec) | |
object IdeaBoxAssemblySpec extends Specification{ | |
"Search for a topic by a valid ID" should{ | |
"return topic instance" in { | |
IdeaBoxAssembly.getTopicById("1") must notBeNull | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait IdeaBoxService{ | |
val ideaBoxDao:IdeaBoxDao | |
def getTopicById(id: String): Topic = { | |
ideaBoxDao.getTopicById(id) | |
} | |
} | |
object IdeaBoxAssembly extends IdeaBoxService{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait IdeaBoxDao { | |
def getTopicById(id:String):Topic | |
} | |
class IdeaBoxDaoImpl extends IdeaBoxDao{ | |
val sqlMap = new SqlSessionFactoryBuilder().build( | |
Resources.getResourceAsReader("ibatis/SqlMapConfig.xml")) | |
def getTopicById(id:String):Topic = { | |
val session = sqlMap.openSession() | |
try{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait DomainClass{ | |
def isNotEmptyString(str: String) = str != null && str.length > 0 | |
} | |
case class Topic(id: String, name: String) extends DomainClass{ | |
assume(isNotEmptyString(id)) | |
assume(isNotEmptyString(name)) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val ideaJSON = """{"author":{"id":"1","name":"John Smith"},"body":"Dummy idea body","date":"1267605359042","id":"Dummy Idea ID","subject":"Dummy Idea","topic":{"id":"1","name":"General"}}""" | |
"New idea, submitted via REST-service (PUT idea to resource location) " should{ | |
"appear in the list of ideas (GET ideas from resource location)" in{ | |
ideaResource.addIdeaToTopic(null, ideaJSON.getBytes) | |
ideasResource.getIdeas("1") must eventually(include(""""id":"Dummy Idea ID","subject":"Dummy Idea","topic":{"id":"1","name":"General"}}""")) | |
} | |
} |