提交 67be3184 编写于 作者: 武汉红喜's avatar 武汉红喜

delete mongodb

上级 9dbad483
......@@ -14,12 +14,6 @@
<name>${project.artifactId}</name>
<url>http://maven.apache.org</url>
<properties>
<querydsl.version>2.9.0</querydsl.version>
<hamcrest.version>1.3</hamcrest.version>
<spring-mongodb.version>1.2.0.RELEASE</spring-mongodb.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
......@@ -43,12 +37,6 @@
<artifactId>javax.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb</artifactId>
<version>${spring-mongodb.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
......@@ -58,14 +46,6 @@
<artifactId>aspectjtools</artifactId>
</dependency>
<!-- Querydsl -->
<dependency>
<groupId>com.mysema.querydsl</groupId>
<artifactId>querydsl-mongodb</artifactId>
<version>${querydsl.version}</version>
</dependency>
<!-- logging -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
......@@ -83,24 +63,9 @@
<artifactId>logback-classic</artifactId>
</dependency>
<!-- test -->
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>${hamcrest.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>${hamcrest.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit-dep</artifactId>
<version>4.10</version>
<scope>test</scope>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
......
......@@ -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;
......
/*
* 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()));
}
}
/*
* 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 <T> Matcher<T> with(Matcher<T> matcher) {
return matcher;
}
/**
* Matches if the {@link Product} has the given name.
*
* @param name must not be {@literal null}.
* @return
*/
public static Matcher<Product> named(String name) {
return hasProperty("name", is(name));
}
}
/*
* 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 <T> Matcher<Iterable<? super T>> containsOrder(Matcher<? super T> 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<Order> LineItem(Matcher<LineItem> 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<LineItem> Product(Matcher<Product> matcher) {
return hasProperty("product", matcher);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册