Commit 27c0217d authored by Peter Harrison's avatar Peter Harrison

#38 Cache List Invalidation issue resolved - invalidation of lists had a

bug,found while getting unit tests working again.
parent 26d299fc
......@@ -32,6 +32,7 @@ import nz.net.orcon.kanban.automation.CacheInvalidationInterface;
import nz.net.orcon.kanban.model.Card;
import nz.net.orcon.kanban.model.Condition;
import nz.net.orcon.kanban.model.Filter;
import nz.net.orcon.kanban.tools.CardTools;
import nz.net.orcon.kanban.tools.IdentifierTools;
import nz.net.orcon.kanban.tools.ListTools;
import nz.net.orcon.kanban.tools.OcmMapperFactory;
......@@ -66,6 +67,9 @@ public class FilterController {
@Autowired
private ListTools listTools;
@Autowired
CardTools cardTools;
@PreAuthorize("hasPermission(#boardId, 'BOARD', 'ADMIN')")
@RequestMapping(value = "", method=RequestMethod.POST)
......@@ -191,6 +195,10 @@ public class FilterController {
try {
cards = listTools.query(boardId, null, filterId, ocm);
for(Card card : cards){
card.setFields(this.cardTools.getFieldsForCard(card,"full",ocm));
}
} finally {
ocm.logout();
}
......
......@@ -150,6 +150,6 @@
<bean id="awsAutomationAction" class="nz.net.orcon.kanban.automation.actions.AwsAutomationAction"/>
<!-- Cluster Management -->
<bean id="clusterManager" class="nz.net.orcon.kanban.automation.ClusterManager"/>
<bean id="clusterManager" class="nz.net.orcon.kanban.automation.ClusterManagerImpl"/>
</beans>
......@@ -27,11 +27,7 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
......@@ -41,10 +37,6 @@ import nz.net.orcon.kanban.model.Card;
import nz.net.orcon.kanban.model.CardEvent;
import nz.net.orcon.kanban.model.CardTask;
import org.codehaus.jackson.JsonGenerationException;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.ObjectWriter;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
......@@ -144,6 +136,9 @@ public class CardControllerTest {
assertEquals("Create Test",foundCard.getFields().get("name"));
Object balance = foundCard.getFields().get("balance");
System.out.println( "Balance Class:" + balance.getClass().getName());
assertEquals("300.0", balance.toString());
controller.deleteCard(TestBoardTool.BOARD_ID,
......@@ -160,6 +155,8 @@ public class CardControllerTest {
}
}
@Test
public void testUpdateField() throws Exception {
......@@ -191,7 +188,7 @@ public class CardControllerTest {
String cardId = cardList.keySet().iterator().next();
Card card = controller.getCard(TestBoardTool.BOARD_ID, TestBoardTool.PHASE_ID, cardId, null);
return card;
}
}
@Test
public void testGetHistoryList() throws Exception {
......
......@@ -64,7 +64,6 @@ public class FilterControllerTest {
@Test
public void testCreateUpdateAndDeleteFilter() throws Exception {
Filter filter = getTestFilter("Test Filter "+ BoardControllerTest.RND.nextInt(9999999), "name", Operation.EQUALTO, "Smith");
Filter newFilter = controller.createFilter(TestBoardTool.BOARD_ID, filter);
String filterId = TestBoardTool.getIdFromPath(newFilter.getPath());
......@@ -88,7 +87,6 @@ public class FilterControllerTest {
@Test
public void testEquals() throws Exception {
Collection<Card> cards = controller.executeFilter(TestBoardTool.BOARD_ID, "equalsfilter");
assertNotNull(cards);
assertEquals(1,cards.size());
......@@ -176,9 +174,7 @@ public class FilterControllerTest {
}
private void checkTestFilters() throws Exception{
Map<String, String> listFilters = controller.listFilters(TestBoardTool.BOARD_ID);
Collection<Filter> f = new ArrayList<Filter>();
f.add(getTestFilter( "containsfilter", "name", Operation.CONTAINS, "Smi" ));
f.add(getTestFilter( "equalsfilter", "name", Operation.EQUALTO, "Smith" ));
......
......@@ -33,7 +33,7 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:spring/test-automation.xml"})
@ContextConfiguration(locations = { "/spring/test-automation.xml"})
public class DateInterpreterTest {
@Autowired
......
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:jms="http://www.springframework.org/schema/jms"
xmlns:util="http://www.springframework.org/schema/util" xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:jms="http://www.springframework.org/schema/jms"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx
......@@ -16,7 +19,7 @@
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<bean id="kanbanConfiguration"
<!-- <bean id="kanbanConfiguration"
class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="location" value="file:///etc/kanban.conf" />
</bean>
......@@ -24,6 +27,7 @@
<tx:annotation-driven />
<context:property-placeholder properties-ref="kanbanConfiguration"/>
-->
<bean id="variableInterpreter" class="nz.net.orcon.kanban.automation.VariableInterpreter"/>
......@@ -41,8 +45,9 @@
</property>
</bean>
<!--
<bean id="emailSenderAction" class="nz.net.orcon.kanban.automation.actions.EmailSenderAction" />
<bean id="emailReceiverAction" class="nz.net.orcon.kanban.automation.actions.EmailReceiverAction" />
-->
</beans>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment