Skip to content

Commit

Permalink
fix for MID-1232
Browse files Browse the repository at this point in the history
updated bundled mysql connector, minor code improvement.
  • Loading branch information
1azyman committed Mar 22, 2013
1 parent 5c25af2 commit 3fc7685
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build-system/pom.xml
Expand Up @@ -70,7 +70,7 @@
<hibernate.version>4.1.7.Final</hibernate.version>
<h2.version>1.3.168</h2.version>
<jdbc.postgres>9.1-901.jdbc4</jdbc.postgres>
<jdbc.mysql>5.1.23</jdbc.mysql>
<jdbc.mysql>5.1.24</jdbc.mysql>
<wicket.version>1.5.9</wicket.version>
<groovy.version>1.8.6</groovy.version>
<activiti-engine.version>5.10-p1</activiti-engine.version>
Expand Down
2 changes: 0 additions & 2 deletions gui/admin-gui/pom.xml
Expand Up @@ -122,12 +122,10 @@
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.1-901.jdbc4</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.21</version>
</dependency>

<!-- MIDPOINT -->
Expand Down
Expand Up @@ -26,6 +26,7 @@
import com.evolveum.midpoint.prism.delta.ItemDelta;
import com.evolveum.midpoint.prism.delta.ObjectDelta;
import com.evolveum.midpoint.prism.delta.ReferenceDelta;
import com.evolveum.midpoint.repo.sql.type.XMLGregorianCalendarType;
import com.evolveum.midpoint.schema.processor.ResourceSchema;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.schema.util.ResourceObjectShadowUtil;
Expand All @@ -34,6 +35,7 @@
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.xml.ns._public.common.common_2a.*;
import com.evolveum.prism.xml.ns._public.types_2.PolyStringType;
import org.hibernate.stat.Statistics;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
Expand All @@ -43,6 +45,7 @@
import javax.xml.namespace.QName;
import java.io.File;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
Expand Down Expand Up @@ -344,5 +347,26 @@ public void addGetSystemConfigFile() throws Exception {
}
}


@Test
public void addGetSyncDescription() throws Exception {
PrismObjectDefinition accDef = prismContext.getSchemaRegistry()
.findObjectDefinitionByCompileTimeClass(AccountShadowType.class);
PrismObject<AccountShadowType> shadow = accDef.instantiate();
final Date TIME = new Date();
AccountShadowType shadowType = shadow.asObjectable();
shadowType.setName(new PolyStringType("sync desc test"));
SynchronizationSituationDescriptionType desc = new SynchronizationSituationDescriptionType();
desc.setChannel("channel");
desc.setSituation(SynchronizationSituationType.LINKED);
desc.setTimestamp(XMLGregorianCalendarType.asXMLGregorianCalendar(TIME));
shadowType.getSynchronizationSituationDescription().add(desc);

OperationResult result = new OperationResult("sync desc test");
String oid = repositoryService.addObject(shadowType.asPrismObject(), result);

shadow = repositoryService.getObject(AccountShadowType.class, oid, result);
shadowType = shadow.asObjectable();
desc = shadowType.getSynchronizationSituationDescription().get(0);
AssertJUnit.assertEquals("Times don't match", TIME, XMLGregorianCalendarType.asDate(desc.getTimestamp()));
}
}
Expand Up @@ -77,4 +77,14 @@ public int hashCode() {
result = 31 * result + (checksum != null ? checksum.hashCode() : 0);
return result;
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("RSynchronizationSituationDescriptionId{shadowOid='").append(shadowOid).append('\'');
sb.append(", shadowId=").append(shadowId);
sb.append(", checksum='").append(checksum).append("'}");

return sb.toString();
}
}

0 comments on commit 3fc7685

Please sign in to comment.