diff --git a/whatsmars-spring/pom.xml b/whatsmars-spring/pom.xml index 9977c9bd693d71212ff4fe5cea596bf13b77e5b9..f61c75a05645752c295693d27901c5a72ab1ebc0 100644 --- a/whatsmars-spring/pom.xml +++ b/whatsmars-spring/pom.xml @@ -14,12 +14,6 @@ ${project.artifactId} http://maven.apache.org - - 2.9.0 - 1.3 - 1.2.0.RELEASE - - org.springframework @@ -43,12 +37,6 @@ javax.servlet-api - - org.springframework.data - spring-data-mongodb - ${spring-mongodb.version} - - org.aspectj aspectjweaver @@ -58,14 +46,6 @@ aspectjtools - - - com.mysema.querydsl - querydsl-mongodb - ${querydsl.version} - - - log4j log4j @@ -83,24 +63,9 @@ logback-classic - - - org.hamcrest - hamcrest-library - ${hamcrest.version} - test - - - org.hamcrest - hamcrest-core - ${hamcrest.version} - test - junit - junit-dep - 4.10 - test + junit org.springframework diff --git a/whatsmars-spring/src/test/java/org/hongxi/whatsmars/spring/XxDemo.java b/whatsmars-spring/src/test/java/org/hongxi/whatsmars/spring/SpringTest.java similarity index 95% rename from whatsmars-spring/src/test/java/org/hongxi/whatsmars/spring/XxDemo.java rename to whatsmars-spring/src/test/java/org/hongxi/whatsmars/spring/SpringTest.java index 40aff4e447bf7052280718c0dedb718d06700371..e0fee8927cd5b1853893f4d8a1260b6f9ffdd0a7 100644 --- a/whatsmars-spring/src/test/java/org/hongxi/whatsmars/spring/XxDemo.java +++ b/whatsmars-spring/src/test/java/org/hongxi/whatsmars/spring/SpringTest.java @@ -12,7 +12,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; */ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("/spring-context.xml") -public class XxDemo { +public class SpringTest { @Autowired private Mars mars; diff --git a/whatsmars-spring/src/test/java/org/hongxi/whatsmars/spring/data/mongodb/ApplicationConfigTest.java b/whatsmars-spring/src/test/java/org/hongxi/whatsmars/spring/data/mongodb/ApplicationConfigTest.java deleted file mode 100644 index f9fbd9dfda65194e54e09da241841b735d1b0f93..0000000000000000000000000000000000000000 --- a/whatsmars-spring/src/test/java/org/hongxi/whatsmars/spring/data/mongodb/ApplicationConfigTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2012 the original author or authors. - * - * 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.hongxi.whatsmars.spring.data.mongodb; - -import org.junit.Test; -import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.AnnotationConfigApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.junit.Assert.assertThat; - -/** - * Integration test bootstrapping an {@link ApplicationContext} from both XML and JavaConfig to assure the general setup - * is working. - * - * @author Oliver Gierke - */ -public class ApplicationConfigTest { - - //@Test - public void bootstrapAppFromJavaConfig() { - - ApplicationContext context = new AnnotationConfigApplicationContext(ApplicationConfig.class); - assertThat(context, is(notNullValue())); - } - - //@Test - public void bootstrapAppFromXml() { - - ApplicationContext context = new ClassPathXmlApplicationContext("META-INF/spring/application-context.xml"); - assertThat(context, is(notNullValue())); - } -} diff --git a/whatsmars-spring/src/test/java/org/hongxi/whatsmars/spring/data/mongodb/core/CoreMatchers.java b/whatsmars-spring/src/test/java/org/hongxi/whatsmars/spring/data/mongodb/core/CoreMatchers.java deleted file mode 100644 index 2e9226e5d5e30f29c3bc94b3c0c14abbc8089c81..0000000000000000000000000000000000000000 --- a/whatsmars-spring/src/test/java/org/hongxi/whatsmars/spring/data/mongodb/core/CoreMatchers.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2012 the original author or authors. - * - * 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.hongxi.whatsmars.spring.data.mongodb.core; - -import org.hamcrest.Matcher; - -import static org.hamcrest.Matchers.hasProperty; -import static org.hamcrest.Matchers.is; - -/** - * Custom matchers to ease assertions on our domain classes. - * - * @author Oliver Gierke - */ -public class CoreMatchers { - - /** - * Syntactic sugar to make Matchers more readable. - * - * @param matcher must not be {@literal null}. - * @return - */ - public static Matcher with(Matcher matcher) { - return matcher; - } - - /** - * Matches if the {@link Product} has the given name. - * - * @param name must not be {@literal null}. - * @return - */ - public static Matcher named(String name) { - return hasProperty("name", is(name)); - } -} diff --git a/whatsmars-spring/src/test/java/org/hongxi/whatsmars/spring/data/mongodb/order/OrderMatchers.java b/whatsmars-spring/src/test/java/org/hongxi/whatsmars/spring/data/mongodb/order/OrderMatchers.java deleted file mode 100644 index 2e7055863b5757eb91cd7b1090434c87c42455fc..0000000000000000000000000000000000000000 --- a/whatsmars-spring/src/test/java/org/hongxi/whatsmars/spring/data/mongodb/order/OrderMatchers.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2012 the original author or authors. - * - * 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.hongxi.whatsmars.spring.data.mongodb.order; - -import org.hongxi.whatsmars.spring.data.mongodb.core.Product; -import org.hamcrest.Matcher; - -import static org.hamcrest.Matchers.hasItem; -import static org.hamcrest.Matchers.hasProperty; - -/** - * Matchers to ease assertions on found {@link Order}s. - * - * @author Oliver Gierke - */ -public class OrderMatchers { - - /** - * Matches if the source {@link Iterable} has an {@link Order} that matches the given {@link Matcher}. - * - * @param matcher must not be {@literal null}. - * @return - */ - public static Matcher> containsOrder(Matcher matcher) { - return hasItem(matcher); - } - - /** - * Matches if the {@link Order} has a {@link LineItem} matching the given {@link Matcher}. - * - * @param matcher must not be {@literal null}. - * @return - */ - public static Matcher LineItem(Matcher matcher) { - return hasProperty("lineItems", hasItem(matcher)); - } - - /** - * Matches if the {@link LineItem} refers to a {@link Product} that matches the given {@link Matcher}. - * - * @param matcher must not be {@literal null}. - * @return - */ - public static Matcher Product(Matcher matcher) { - return hasProperty("product", matcher); - } -}