target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void getAnnotations() throws Exception { EdmAnnotatable annotatable = associationEndProv; EdmAnnotations annotations = annotatable.getAnnotations(); assertNull(annotations.getAnnotationAttributes()); assertNull(annotations.getAnnotationElements()); } | @Override public EdmAnnotations getAnnotations() throws EdmException { return new EdmAnnotationsImplProv(associationEnd.getAnnotationAttributes(), associationEnd.getAnnotationElements()); } | EdmAssociationEndImplProv implements EdmAssociationEnd, EdmAnnotatable { @Override public EdmAnnotations getAnnotations() throws EdmException { return new EdmAnnotationsImplProv(associationEnd.getAnnotationAttributes(), associationEnd.getAnnotationElements()); } } | EdmAssociationEndImplProv implements EdmAssociationEnd, EdmAnnotatable { @Override public EdmAnnotations getAnnotations() throws EdmException { return new EdmAnnotationsImplProv(associationEnd.getAnnotationAttributes(), associationEnd.getAnnotationElements()); } EdmAssociationEndImplProv(final EdmImplProv edm, final As... | EdmAssociationEndImplProv implements EdmAssociationEnd, EdmAnnotatable { @Override public EdmAnnotations getAnnotations() throws EdmException { return new EdmAnnotationsImplProv(associationEnd.getAnnotationAttributes(), associationEnd.getAnnotationElements()); } EdmAssociationEndImplProv(final EdmImplProv edm, final As... | EdmAssociationEndImplProv implements EdmAssociationEnd, EdmAnnotatable { @Override public EdmAnnotations getAnnotations() throws EdmException { return new EdmAnnotationsImplProv(associationEnd.getAnnotationAttributes(), associationEnd.getAnnotationElements()); } EdmAssociationEndImplProv(final EdmImplProv edm, final As... |
@Test public void testEntityTypeCache() throws EdmException { assertEquals(edm.getEntityType("foo", "bar"), edm.getEntityType("foo", "bar")); assertNotSame(edm.getEntityType("foo", "bar"), edm.getEntityType("bar", "foo")); } | @Override public EdmEntityType getEntityType(final String namespace, final String name) throws EdmException { FullQualifiedName fqName = new FullQualifiedName(namespace, name); if (edmEntityTypes.containsKey(fqName)) { return edmEntityTypes.get(fqName); } EdmEntityType edmEntityType = null; try { edmEntityType = create... | EdmImpl implements Edm { @Override public EdmEntityType getEntityType(final String namespace, final String name) throws EdmException { FullQualifiedName fqName = new FullQualifiedName(namespace, name); if (edmEntityTypes.containsKey(fqName)) { return edmEntityTypes.get(fqName); } EdmEntityType edmEntityType = null; try... | EdmImpl implements Edm { @Override public EdmEntityType getEntityType(final String namespace, final String name) throws EdmException { FullQualifiedName fqName = new FullQualifiedName(namespace, name); if (edmEntityTypes.containsKey(fqName)) { return edmEntityTypes.get(fqName); } EdmEntityType edmEntityType = null; try... | EdmImpl implements Edm { @Override public EdmEntityType getEntityType(final String namespace, final String name) throws EdmException { FullQualifiedName fqName = new FullQualifiedName(namespace, name); if (edmEntityTypes.containsKey(fqName)) { return edmEntityTypes.get(fqName); } EdmEntityType edmEntityType = null; try... | EdmImpl implements Edm { @Override public EdmEntityType getEntityType(final String namespace, final String name) throws EdmException { FullQualifiedName fqName = new FullQualifiedName(namespace, name); if (edmEntityTypes.containsKey(fqName)) { return edmEntityTypes.get(fqName); } EdmEntityType edmEntityType = null; try... |
@Test public void testComplexTypeCache() throws EdmException { assertEquals(edm.getComplexType("foo", "bar"), edm.getComplexType("foo", "bar")); assertNotSame(edm.getComplexType("foo", "bar"), edm.getComplexType("bar", "foo")); } | @Override public EdmComplexType getComplexType(final String namespace, final String name) throws EdmException { FullQualifiedName fqName = new FullQualifiedName(namespace, name); if (edmComplexTypes.containsKey(fqName)) { return edmComplexTypes.get(fqName); } EdmComplexType edmComplexType = null; try { edmComplexType =... | EdmImpl implements Edm { @Override public EdmComplexType getComplexType(final String namespace, final String name) throws EdmException { FullQualifiedName fqName = new FullQualifiedName(namespace, name); if (edmComplexTypes.containsKey(fqName)) { return edmComplexTypes.get(fqName); } EdmComplexType edmComplexType = nul... | EdmImpl implements Edm { @Override public EdmComplexType getComplexType(final String namespace, final String name) throws EdmException { FullQualifiedName fqName = new FullQualifiedName(namespace, name); if (edmComplexTypes.containsKey(fqName)) { return edmComplexTypes.get(fqName); } EdmComplexType edmComplexType = nul... | EdmImpl implements Edm { @Override public EdmComplexType getComplexType(final String namespace, final String name) throws EdmException { FullQualifiedName fqName = new FullQualifiedName(namespace, name); if (edmComplexTypes.containsKey(fqName)) { return edmComplexTypes.get(fqName); } EdmComplexType edmComplexType = nul... | EdmImpl implements Edm { @Override public EdmComplexType getComplexType(final String namespace, final String name) throws EdmException { FullQualifiedName fqName = new FullQualifiedName(namespace, name); if (edmComplexTypes.containsKey(fqName)) { return edmComplexTypes.get(fqName); } EdmComplexType edmComplexType = nul... |
@Test public void testAssociationCache() throws EdmException { assertEquals(edm.getAssociation("foo", "bar"), edm.getAssociation("foo", "bar")); assertNotSame(edm.getAssociation("foo", "bar"), edm.getAssociation("bar", "foo")); } | @Override public EdmAssociation getAssociation(final String namespace, final String name) throws EdmException { FullQualifiedName fqName = new FullQualifiedName(namespace, name); if (edmAssociations.containsKey(fqName)) { return edmAssociations.get(fqName); } EdmAssociation edmAssociation = null; try { edmAssociation =... | EdmImpl implements Edm { @Override public EdmAssociation getAssociation(final String namespace, final String name) throws EdmException { FullQualifiedName fqName = new FullQualifiedName(namespace, name); if (edmAssociations.containsKey(fqName)) { return edmAssociations.get(fqName); } EdmAssociation edmAssociation = nul... | EdmImpl implements Edm { @Override public EdmAssociation getAssociation(final String namespace, final String name) throws EdmException { FullQualifiedName fqName = new FullQualifiedName(namespace, name); if (edmAssociations.containsKey(fqName)) { return edmAssociations.get(fqName); } EdmAssociation edmAssociation = nul... | EdmImpl implements Edm { @Override public EdmAssociation getAssociation(final String namespace, final String name) throws EdmException { FullQualifiedName fqName = new FullQualifiedName(namespace, name); if (edmAssociations.containsKey(fqName)) { return edmAssociations.get(fqName); } EdmAssociation edmAssociation = nul... | EdmImpl implements Edm { @Override public EdmAssociation getAssociation(final String namespace, final String name) throws EdmException { FullQualifiedName fqName = new FullQualifiedName(namespace, name); if (edmAssociations.containsKey(fqName)) { return edmAssociations.get(fqName); } EdmAssociation edmAssociation = nul... |
@Test public void test() throws XMLStreamException, EntityProviderException { int i = 0; EdmParser parser = new EdmParser(); XMLStreamReader reader = createStreamReader(xml); DataServices result = parser.readMetadata(reader, true); assertEquals("2.0", result.getDataServiceVersion()); for (Schema schema : result.getSche... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test public void testBaseType() throws XMLStreamException, EntityProviderException { int i = 0; EdmParser parser = new EdmParser(); XMLStreamReader reader = createStreamReader(xmlWithBaseType); DataServices result = parser.readMetadata(reader, true); assertEquals("2.0", result.getDataServiceVersion()); for (Schema sch... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test public void testMapJPAPersistenceUnit() { assertEquals(PERSISTENCE_UNIT_NAME_EDM, objJPAEdmMappingModelServiceTest.mapJPAPersistenceUnit(PERSISTENCE_UNIT_NAME_JPA)); } | @Override public String mapJPAPersistenceUnit(final String persistenceUnitName) { JPAPersistenceUnitMapType persistenceUnit = mappingModel .getPersistenceUnit(); if (persistenceUnit.getName().equals(persistenceUnitName)) { return persistenceUnit.getEDMSchemaNamespace(); } return null; } | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAPersistenceUnit(final String persistenceUnitName) { JPAPersistenceUnitMapType persistenceUnit = mappingModel .getPersistenceUnit(); if (persistenceUnit.getName().equals(persistenceUnitName)) { return persistenceUnit.getEDMSche... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAPersistenceUnit(final String persistenceUnitName) { JPAPersistenceUnitMapType persistenceUnit = mappingModel .getPersistenceUnit(); if (persistenceUnit.getName().equals(persistenceUnitName)) { return persistenceUnit.getEDMSche... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAPersistenceUnit(final String persistenceUnitName) { JPAPersistenceUnitMapType persistenceUnit = mappingModel .getPersistenceUnit(); if (persistenceUnit.getName().equals(persistenceUnitName)) { return persistenceUnit.getEDMSche... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAPersistenceUnit(final String persistenceUnitName) { JPAPersistenceUnitMapType persistenceUnit = mappingModel .getPersistenceUnit(); if (persistenceUnit.getName().equals(persistenceUnitName)) { return persistenceUnit.getEDMSche... |
@Test public void testComplexTypeWithBaseType() throws XMLStreamException, EntityProviderException { final String xml = "<edmx:Edmx Version=\"1.0\" xmlns:edmx=\"" + Edm.NAMESPACE_EDMX_2007_06 + "\">" + "<edmx:DataServices m:DataServiceVersion=\"2.0\" xmlns:m=\"" + Edm.NAMESPACE_M_2007_08 + "\">" + "<Schema Namespace=\"... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test(expected = EntityProviderException.class) public void testComplexTypeWithInvalidBaseType() throws XMLStreamException, EntityProviderException { final String xml = "<edmx:Edmx Version=\"1.0\" xmlns:edmx=\"" + Edm.NAMESPACE_EDMX_2007_06 + "\">" + "<edmx:DataServices m:DataServiceVersion=\"2.0\" xmlns:m=\"" + Edm.NA... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test(expected = EntityProviderException.class) public void testComplexTypeWithInvalidBaseType2() throws XMLStreamException, EntityProviderException { final String xml = "<edmx:Edmx Version=\"1.0\" xmlns:edmx=\"" + Edm.NAMESPACE_EDMX_2007_06 + "\">" + "<edmx:DataServices m:DataServiceVersion=\"2.0\" xmlns:m=\"" + Edm.N... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test public void testAssociation() throws XMLStreamException, EntityProviderException { EdmParser parser = new EdmParser(); XMLStreamReader reader = createStreamReader(xmlWithAssociation); DataServices result = parser.readMetadata(reader, true); assertEquals("2.0", result.getDataServiceVersion()); for (Schema schema :... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test public void testTwoSchemas() throws XMLStreamException, EntityProviderException { int i = 0; String schemasNs[] = { NAMESPACE, NAMESPACE2 }; EdmParser parser = new EdmParser(); XMLStreamReader reader = createStreamReader(xmlWithTwoSchemas); DataServices result = parser.readMetadata(reader, true); assertEquals("2.... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test public void testProperties() throws EntityProviderException, XMLStreamException { EdmParser parser = new EdmParser(); XMLStreamReader reader = createStreamReader(xmlWithTwoSchemas); DataServices result = parser.readMetadata(reader, true); for (Schema schema : result.getSchemas()) { for (EntityType entityType : sc... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test public void testEntitySet() throws XMLStreamException, EntityProviderException { final String xmWithEntityContainer = "<edmx:Edmx Version=\"1.0\" xmlns:edmx=\"" + Edm.NAMESPACE_EDMX_2007_06 + "\">" + "<edmx:DataServices m:DataServiceVersion=\"2.0\" xmlns:m=\"" + Edm.NAMESPACE_M_2007_08 + "\">" + "<Schema Namespac... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test public void testAssociationSet() throws XMLStreamException, EntityProviderException { EdmParser parser = new EdmParser(); XMLStreamReader reader = createStreamReader(xmlWithAssociation); DataServices result = parser.readMetadata(reader, true); for (Schema schema : result.getSchemas()) { for (EntityContainer conta... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test public void testFunctionImport() throws XMLStreamException, EntityProviderException { final String xmWithEntityContainer = "<edmx:Edmx Version=\"1.0\" xmlns:edmx=\"" + Edm.NAMESPACE_EDMX_2007_06 + "\">" + "<edmx:DataServices m:DataServiceVersion=\"2.0\" xmlns:m=\"" + Edm.NAMESPACE_M_2007_08 + "\">" + "<Schema Nam... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test() public void testAlias() throws XMLStreamException, EntityProviderException { final String xml = "<edmx:Edmx Version=\"1.0\" xmlns:edmx=\"" + Edm.NAMESPACE_EDMX_2007_06 + "\">" + "<edmx:DataServices m:DataServiceVersion=\"2.0\" xmlns:m=\"" + Edm.NAMESPACE_M_2007_08 + "\">" + "<Schema Namespace=\"" + NAMESPACE + ... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test public void testMapJPAPersistenceUnitNegative() { assertNull(objJPAEdmMappingModelServiceTest.mapJPAPersistenceUnit(PERSISTENCE_UNIT_NAME_EDM)); } | @Override public String mapJPAPersistenceUnit(final String persistenceUnitName) { JPAPersistenceUnitMapType persistenceUnit = mappingModel .getPersistenceUnit(); if (persistenceUnit.getName().equals(persistenceUnitName)) { return persistenceUnit.getEDMSchemaNamespace(); } return null; } | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAPersistenceUnit(final String persistenceUnitName) { JPAPersistenceUnitMapType persistenceUnit = mappingModel .getPersistenceUnit(); if (persistenceUnit.getName().equals(persistenceUnitName)) { return persistenceUnit.getEDMSche... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAPersistenceUnit(final String persistenceUnitName) { JPAPersistenceUnitMapType persistenceUnit = mappingModel .getPersistenceUnit(); if (persistenceUnit.getName().equals(persistenceUnitName)) { return persistenceUnit.getEDMSche... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAPersistenceUnit(final String persistenceUnitName) { JPAPersistenceUnitMapType persistenceUnit = mappingModel .getPersistenceUnit(); if (persistenceUnit.getName().equals(persistenceUnitName)) { return persistenceUnit.getEDMSche... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAPersistenceUnit(final String persistenceUnitName) { JPAPersistenceUnitMapType persistenceUnit = mappingModel .getPersistenceUnit(); if (persistenceUnit.getName().equals(persistenceUnitName)) { return persistenceUnit.getEDMSche... |
@Test(expected = EntityProviderException.class) public void testEntityTypeWithoutKeys() throws XMLStreamException, EntityProviderException { final String xmlWithoutKeys = "<Schema Namespace=\"" + NAMESPACE + "\" xmlns=\"" + Edm.NAMESPACE_EDM_2008_09 + "\">" + "<EntityType Name= \"Employee\">" + "<Property Name=\"" + pr... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test(expected = EntityProviderException.class) public void testInvalidBaseType() throws XMLStreamException, EntityProviderException { final String xmlWithInvalidBaseType = "<Schema Namespace=\"" + NAMESPACE + "\" xmlns=\"" + Edm.NAMESPACE_EDM_2008_09 + "\">" + "<EntityType Name= \"Manager\" BaseType=\"Employee\" m:Has... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test(expected = EntityProviderException.class) public void testInvalidRole() throws XMLStreamException, EntityProviderException { final String xmlWithInvalidAssociation = "<edmx:Edmx Version=\"1.0\" xmlns:edmx=\"" + Edm.NAMESPACE_EDMX_2007_06 + "\">" + "<edmx:DataServices m:DataServiceVersion=\"2.0\" xmlns:m=\"" + Edm... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test(expected = EntityProviderException.class) public void testInvalidRelationship() throws XMLStreamException, EntityProviderException { final String xmlWithInvalidAssociation = "<edmx:Edmx Version=\"1.0\" xmlns:edmx=\"" + Edm.NAMESPACE_EDMX_2007_06 + "\">" + "<edmx:DataServices m:DataServiceVersion=\"2.0\" xmlns:m=\... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test(expected = EntityProviderException.class) public void testMissingRelationship() throws Exception { final String xmlWithInvalidAssociation = "<edmx:Edmx Version=\"1.0\" xmlns:edmx=\"" + Edm.NAMESPACE_EDMX_2007_06 + "\">" + "<edmx:DataServices m:DataServiceVersion=\"2.0\" xmlns:m=\"" + Edm.NAMESPACE_M_2007_08 + "\"... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test(expected = EntityProviderException.class) public void testMissingEntityType() throws Exception { final String xmlWithInvalidAssociation = "<edmx:Edmx Version=\"1.0\" xmlns:edmx=\"" + Edm.NAMESPACE_EDMX_2007_06 + "\">" + "<edmx:DataServices m:DataServiceVersion=\"2.0\" xmlns:m=\"" + Edm.NAMESPACE_M_2007_08 + "\">"... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test(expected = EntityProviderException.class) public void testMissingType() throws Exception { final String xmlWithInvalidAssociation = "<edmx:Edmx Version=\"1.0\" xmlns:edmx=\"" + Edm.NAMESPACE_EDMX_2007_06 + "\">" + "<edmx:DataServices m:DataServiceVersion=\"2.0\" xmlns:m=\"" + Edm.NAMESPACE_M_2007_08 + "\">" + "<S... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test(expected = EntityProviderException.class) public void testMissingTypeAtAssociation() throws Exception { final String xmlWithInvalidAssociation = "<edmx:Edmx Version=\"1.0\" xmlns:edmx=\"" + Edm.NAMESPACE_EDMX_2007_06 + "\">" + "<edmx:DataServices m:DataServiceVersion=\"2.0\" xmlns:m=\"" + Edm.NAMESPACE_M_2007_08 ... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test(expected = EntityProviderException.class) public void testMissingTypeAtFunctionImport() throws Exception { final String xml = "<edmx:Edmx Version=\"1.0\" xmlns:edmx=\"" + Edm.NAMESPACE_EDMX_2007_06 + "\">" + "<edmx:DataServices m:DataServiceVersion=\"2.0\" xmlns:m=\"" + Edm.NAMESPACE_M_2007_08 + "\">" + "<Schema ... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test(expected = EntityProviderException.class) public void testMissingAssociation() throws Exception { final String xmlWithAssociation = "<edmx:Edmx Version=\"1.0\" xmlns:edmx=\"" + Edm.NAMESPACE_EDMX_2007_06 + "\">" + "<edmx:DataServices m:DataServiceVersion=\"2.0\" xmlns:m=\"" + Edm.NAMESPACE_M_2007_08 + "\">" + "<S... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test public void testMapJPAEntityType() { assertEquals(ENTITY_TYPE_NAME_EDM, objJPAEdmMappingModelServiceTest.mapJPAEntityType(ENTITY_TYPE_NAME_JPA)); } | @Override public String mapJPAEntityType(final String jpaEntityTypeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null) { return jpaEntityTypeMap.getEDMEntityType(); } else { return null; } } | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAEntityType(final String jpaEntityTypeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null) { return jpaEntityTypeMap.getEDMEntityType(); } else { return nu... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAEntityType(final String jpaEntityTypeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null) { return jpaEntityTypeMap.getEDMEntityType(); } else { return nu... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAEntityType(final String jpaEntityTypeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null) { return jpaEntityTypeMap.getEDMEntityType(); } else { return nu... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAEntityType(final String jpaEntityTypeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null) { return jpaEntityTypeMap.getEDMEntityType(); } else { return nu... |
@Test(expected = EntityProviderException.class) public void testInvalidAssociation() throws XMLStreamException, EntityProviderException { final String xmlWithInvalidAssociationSet = "<edmx:Edmx Version=\"1.0\" xmlns:edmx=\"" + Edm.NAMESPACE_EDMX_2007_06 + "\">" + "<edmx:DataServices m:DataServiceVersion=\"2.0\" xmlns:m... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test(expected = EntityProviderException.class) public void testInvalidAssociationEnd() throws XMLStreamException, EntityProviderException { final String employees = "r_Employees"; final String manager = "r_Manager"; final String xmlWithInvalidAssociationSetEnd = "<edmx:Edmx Version=\"1.0\" xmlns:edmx=\"" + Edm.NAMESPA... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test(expected = EntityProviderException.class) public void testInvalidAssociationEnd2() throws XMLStreamException, EntityProviderException { final String employees = "r_Employees"; final String manager = "r_Manager"; final String xmlWithInvalidAssociationSetEnd = "<edmx:Edmx Version=\"1.0\" xmlns:edmx=\"" + Edm.NAMESP... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test(expected = EntityProviderException.class) public void testInvalidEntitySet() throws XMLStreamException, EntityProviderException { final String xmWithEntityContainer = "<edmx:Edmx Version=\"1.0\" xmlns:edmx=\"" + Edm.NAMESPACE_EDMX_2007_06 + "\">" + "<edmx:DataServices m:DataServiceVersion=\"2.0\" xmlns:m=\"" + Ed... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test public void testEntityTypeInOtherSchema() throws XMLStreamException, EntityProviderException { final String xmWithEntityContainer = "<edmx:Edmx Version=\"1.0\" xmlns:edmx=\"" + Edm.NAMESPACE_EDMX_2007_06 + "\">" + "<edmx:DataServices m:DataServiceVersion=\"2.0\" xmlns:m=\"" + Edm.NAMESPACE_M_2007_08 + "\">" + "<S... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test public void scenarioTest() throws XMLStreamException, EntityProviderException { final String ASSOCIATION2 = "TeamEmployees"; final String xml = "<edmx:Edmx Version=\"1.0\" xmlns:edmx=\"" + Edm.NAMESPACE_EDMX_2007_06 + "\">" + "<edmx:DataServices m:DataServiceVersion=\"2.0\" xmlns:m=\"" + Edm.NAMESPACE_M_2007_08 +... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test public void testRefScenario() throws Exception { EdmProvider testProvider = new EdmTestProvider(); ODataResponse response = EntityProvider.writeMetadata(testProvider.getSchemas(), null); String stream = StringHelper.inputStreamToString((InputStream) response.getEntity()); EdmParser parser = new EdmParser(); DataS... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test public void testAnnotations() throws XMLStreamException, EntityProviderException { final String xmlWithAnnotations = "<edmx:Edmx Version=\"1.0\" xmlns:edmx=\"" + Edm.NAMESPACE_EDMX_2007_06 + "\">" + "<edmx:DataServices m:DataServiceVersion=\"2.0\" xmlns:m=\"" + Edm.NAMESPACE_M_2007_08 + "\">" + "<Schema Namespace... | public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX_2007_06.equ... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... | EdmParser { public DataServices readMetadata(final XMLStreamReader reader, final boolean validate) throws EntityProviderException { try { initialize(); DataServices dataServices = new DataServices(); List<Schema> schemas = new ArrayList<Schema>(); while (reader.hasNext() && !(reader.isEndElement() && Edm.NAMESPACE_EDMX... |
@Test public void testEntityType() throws EntityProviderException, ODataException, XMLStreamException { Edm edm = createEdm(); assertNotNull(edm); FullQualifiedName fqNameEmployee = new FullQualifiedName("RefScenario", "Employee"); EdmProvider testProvider = new EdmTestProvider(); EdmImplProv edmImpl = (EdmImplProv) ed... | @Override public EntityType getEntityType(final FullQualifiedName edmFQName) throws ODataException { for (Schema schema : dataServices.getSchemas()) { if (schema.getNamespace().equals(edmFQName.getNamespace())) { for (EntityType entityType : schema.getEntityTypes()) { if (entityType.getName().equals(edmFQName.getName()... | EdmxProvider extends EdmProvider { @Override public EntityType getEntityType(final FullQualifiedName edmFQName) throws ODataException { for (Schema schema : dataServices.getSchemas()) { if (schema.getNamespace().equals(edmFQName.getNamespace())) { for (EntityType entityType : schema.getEntityTypes()) { if (entityType.g... | EdmxProvider extends EdmProvider { @Override public EntityType getEntityType(final FullQualifiedName edmFQName) throws ODataException { for (Schema schema : dataServices.getSchemas()) { if (schema.getNamespace().equals(edmFQName.getNamespace())) { for (EntityType entityType : schema.getEntityTypes()) { if (entityType.g... | EdmxProvider extends EdmProvider { @Override public EntityType getEntityType(final FullQualifiedName edmFQName) throws ODataException { for (Schema schema : dataServices.getSchemas()) { if (schema.getNamespace().equals(edmFQName.getNamespace())) { for (EntityType entityType : schema.getEntityTypes()) { if (entityType.g... | EdmxProvider extends EdmProvider { @Override public EntityType getEntityType(final FullQualifiedName edmFQName) throws ODataException { for (Schema schema : dataServices.getSchemas()) { if (schema.getNamespace().equals(edmFQName.getNamespace())) { for (EntityType entityType : schema.getEntityTypes()) { if (entityType.g... |
@Test public void testAssociation() throws EntityProviderException, ODataException, XMLStreamException { Edm edm = createEdm(); assertNotNull(edm); FullQualifiedName fqNameAssociation = new FullQualifiedName("RefScenario", "BuildingRooms"); EdmProvider testProvider = new EdmTestProvider(); EdmImplProv edmImpl = (EdmImp... | @Override public Association getAssociation(final FullQualifiedName edmFQName) throws ODataException { for (Schema schema : dataServices.getSchemas()) { if (schema.getNamespace().equals(edmFQName.getNamespace())) { for (Association association : schema.getAssociations()) { if (association.getName().equals(edmFQName.get... | EdmxProvider extends EdmProvider { @Override public Association getAssociation(final FullQualifiedName edmFQName) throws ODataException { for (Schema schema : dataServices.getSchemas()) { if (schema.getNamespace().equals(edmFQName.getNamespace())) { for (Association association : schema.getAssociations()) { if (associa... | EdmxProvider extends EdmProvider { @Override public Association getAssociation(final FullQualifiedName edmFQName) throws ODataException { for (Schema schema : dataServices.getSchemas()) { if (schema.getNamespace().equals(edmFQName.getNamespace())) { for (Association association : schema.getAssociations()) { if (associa... | EdmxProvider extends EdmProvider { @Override public Association getAssociation(final FullQualifiedName edmFQName) throws ODataException { for (Schema schema : dataServices.getSchemas()) { if (schema.getNamespace().equals(edmFQName.getNamespace())) { for (Association association : schema.getAssociations()) { if (associa... | EdmxProvider extends EdmProvider { @Override public Association getAssociation(final FullQualifiedName edmFQName) throws ODataException { for (Schema schema : dataServices.getSchemas()) { if (schema.getNamespace().equals(edmFQName.getNamespace())) { for (Association association : schema.getAssociations()) { if (associa... |
@Test public void testMapJPAEntityTypeNegative() { assertNull(objJPAEdmMappingModelServiceTest.mapJPAEntityType(ENTITY_TYPE_NAME_JPA_WRONG)); } | @Override public String mapJPAEntityType(final String jpaEntityTypeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null) { return jpaEntityTypeMap.getEDMEntityType(); } else { return null; } } | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAEntityType(final String jpaEntityTypeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null) { return jpaEntityTypeMap.getEDMEntityType(); } else { return nu... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAEntityType(final String jpaEntityTypeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null) { return jpaEntityTypeMap.getEDMEntityType(); } else { return nu... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAEntityType(final String jpaEntityTypeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null) { return jpaEntityTypeMap.getEDMEntityType(); } else { return nu... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAEntityType(final String jpaEntityTypeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null) { return jpaEntityTypeMap.getEDMEntityType(); } else { return nu... |
@Test public void testSchema() throws EntityProviderException, ODataException, XMLStreamException { EdmProvider testProvider = new EdmTestProvider(); Edm edm = createEdm(); assertNotNull(edm); EdmImplProv edmImpl = (EdmImplProv) edm; List<Schema> schemas = edmImpl.getEdmProvider().getSchemas(); List<Schema> testSchemas... | @Override public List<Schema> getSchemas() throws ODataException { return dataServices.getSchemas(); } | EdmxProvider extends EdmProvider { @Override public List<Schema> getSchemas() throws ODataException { return dataServices.getSchemas(); } } | EdmxProvider extends EdmProvider { @Override public List<Schema> getSchemas() throws ODataException { return dataServices.getSchemas(); } } | EdmxProvider extends EdmProvider { @Override public List<Schema> getSchemas() throws ODataException { return dataServices.getSchemas(); } EdmxProvider parse(final InputStream in, final boolean validate); @Override EntityContainerInfo getEntityContainerInfo(final String name); @Override EntityType getEntityType(final F... | EdmxProvider extends EdmProvider { @Override public List<Schema> getSchemas() throws ODataException { return dataServices.getSchemas(); } EdmxProvider parse(final InputStream in, final boolean validate); @Override EntityContainerInfo getEntityContainerInfo(final String name); @Override EntityType getEntityType(final F... |
@Test public void testContainer() throws EntityProviderException, ODataException, XMLStreamException { EdmProvider testProvider = new EdmTestProvider(); Edm edm = createEdm(); assertNotNull(edm); EdmImplProv edmImpl = (EdmImplProv) edm; EntityContainerInfo container = edmImpl.getEdmProvider().getEntityContainerInfo("Co... | @Override public EntityContainerInfo getEntityContainerInfo(final String name) throws ODataException { if (name != null) { for (Schema schema : dataServices.getSchemas()) { for (EntityContainer container : schema.getEntityContainers()) { if (container.getName().equals(name)) { return container; } } } } else { for (Sche... | EdmxProvider extends EdmProvider { @Override public EntityContainerInfo getEntityContainerInfo(final String name) throws ODataException { if (name != null) { for (Schema schema : dataServices.getSchemas()) { for (EntityContainer container : schema.getEntityContainers()) { if (container.getName().equals(name)) { return ... | EdmxProvider extends EdmProvider { @Override public EntityContainerInfo getEntityContainerInfo(final String name) throws ODataException { if (name != null) { for (Schema schema : dataServices.getSchemas()) { for (EntityContainer container : schema.getEntityContainers()) { if (container.getName().equals(name)) { return ... | EdmxProvider extends EdmProvider { @Override public EntityContainerInfo getEntityContainerInfo(final String name) throws ODataException { if (name != null) { for (Schema schema : dataServices.getSchemas()) { for (EntityContainer container : schema.getEntityContainers()) { if (container.getName().equals(name)) { return ... | EdmxProvider extends EdmProvider { @Override public EntityContainerInfo getEntityContainerInfo(final String name) throws ODataException { if (name != null) { for (Schema schema : dataServices.getSchemas()) { for (EntityContainer container : schema.getEntityContainers()) { if (container.getName().equals(name)) { return ... |
@Test public void asciiCharacters() { final String s = "azAZ019"; assertEquals(s, Encoder.encode(s)); assertEquals(s, Encoder.encode(s)); } | public static String encode(final String value) { return encoder.encodeInternal(value); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); static String encode(final String value); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); static String encode(final String value); } |
@Test public void asciiControl() { assertEquals("%08%09%0A%0D", Encoder.encode("\b\t\n\r")); } | public static String encode(final String value) { return encoder.encodeInternal(value); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); static String encode(final String value); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); static String encode(final String value); } |
@Test public void unsafe() { assertEquals("%3C%3E%25%26", Encoder.encode("<>%&")); assertEquals("%22%5C%60%7B%7D%7C", Encoder.encode("\"\\`{}|")); } | public static String encode(final String value) { return encoder.encodeInternal(value); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); static String encode(final String value); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); static String encode(final String value); } |
@Test public void rfc3986Unreserved() { assertEquals(RFC3986_UNRESERVED, Encoder.encode(RFC3986_UNRESERVED)); } | public static String encode(final String value) { return encoder.encodeInternal(value); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); static String encode(final String value); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); static String encode(final String value); } |
@Test public void rfc3986GenDelims() { assertEquals("%3A%2F%3F%23%5B%5D%40", Encoder.encode(RFC3986_GEN_DELIMS)); } | public static String encode(final String value) { return encoder.encodeInternal(value); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); static String encode(final String value); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); static String encode(final String value); } |
@Test public void rfc3986SubDelims() { assertEquals("%21%24%26'%28%29%2A%2B%2C%3B%3D", Encoder.encode(RFC3986_SUB_DELIMS)); } | public static String encode(final String value) { return encoder.encodeInternal(value); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); static String encode(final String value); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); static String encode(final String value); } |
@Test public void rfc3986Reserved() { assertEquals("%3A%2F%3F%23%5B%5D%40%21%24%26'%28%29%2A%2B%2C%3B%3D", Encoder.encode(RFC3986_RESERVED)); } | public static String encode(final String value) { return encoder.encodeInternal(value); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); static String encode(final String value); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); static String encode(final String value); } |
@Test public void unicodeCharacters() { assertEquals("%E2%82%AC", Encoder.encode("€")); assertEquals("%EF%B7%BC", Encoder.encode("\uFDFC")); } | public static String encode(final String value) { return encoder.encodeInternal(value); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); static String encode(final String value); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); static String encode(final String value); } |
@Test public void testMapJPAEntitySet() { assertEquals(ENTITY_SET_NAME_EDM, objJPAEdmMappingModelServiceTest.mapJPAEntitySet(ENTITY_TYPE_NAME_JPA)); } | @Override public String mapJPAEntitySet(final String jpaEntityTypeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null) { return jpaEntityTypeMap.getEDMEntitySet(); } else { return null; } } | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAEntitySet(final String jpaEntityTypeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null) { return jpaEntityTypeMap.getEDMEntitySet(); } else { return null... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAEntitySet(final String jpaEntityTypeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null) { return jpaEntityTypeMap.getEDMEntitySet(); } else { return null... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAEntitySet(final String jpaEntityTypeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null) { return jpaEntityTypeMap.getEDMEntitySet(); } else { return null... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAEntitySet(final String jpaEntityTypeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null) { return jpaEntityTypeMap.getEDMEntitySet(); } else { return null... |
@Test public void charactersOutsideBmp() { final String s = String.valueOf(Character.toChars(0x1F603)); assertEquals("%F0%9F%98%83", Encoder.encode(s)); } | public static String encode(final String value) { return encoder.encodeInternal(value); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); static String encode(final String value); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); static String encode(final String value); } |
@Test public void uriDecoding() throws URISyntaxException { final String decodedValue = RFC3986_UNRESERVED + RFC3986_RESERVED + "0..1..a..z..A..Z..@" + "\u2323\uFDFC" + String.valueOf(Character.toChars(0x1F603)); final String encodedPath = Encoder.encode(decodedValue) + "/" + Encoder.encode(decodedValue); final String ... | public static String encode(final String value) { return encoder.encodeInternal(value); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); static String encode(final String value); } | Encoder { public static String encode(final String value) { return encoder.encodeInternal(value); } private Encoder(final String unencoded); static String encode(final String value); } |
@Test public void testMe() { MediaType t = new MediaType("*", "xml"); assertNotNull(t); assertTrue(t.isCompatible(new MediaType("app", "xml"))); } | public boolean isCompatible(final ContentType obj) { Boolean compatible = isEqualWithoutParameters(obj); if (compatible == null) { return true; } return compatible.booleanValue(); } | ContentType { public boolean isCompatible(final ContentType obj) { Boolean compatible = isEqualWithoutParameters(obj); if (compatible == null) { return true; } return compatible.booleanValue(); } } | ContentType { public boolean isCompatible(final ContentType obj) { Boolean compatible = isEqualWithoutParameters(obj); if (compatible == null) { return true; } return compatible.booleanValue(); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype,... | ContentType { public boolean isCompatible(final ContentType obj) { Boolean compatible = isEqualWithoutParameters(obj); if (compatible == null) { return true; } return compatible.booleanValue(); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype,... | ContentType { public boolean isCompatible(final ContentType obj) { Boolean compatible = isEqualWithoutParameters(obj); if (compatible == null) { return true; } return compatible.booleanValue(); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype,... |
@Test public void parseable() { assertTrue(ContentType.isParseable("application/xml")); assertTrue(ContentType.isParseable("text/plain")); assertTrue(ContentType.isParseable("application/atom+xml; charset=UTF-8")); assertFalse(ContentType.isParseable("application/ atom+xml; charset=UTF-8")); assertFalse(ContentType.isP... | public static boolean isParseable(final String format) { try { return ContentType.create(format) != null; } catch (IllegalArgumentException e) { return false; } } | ContentType { public static boolean isParseable(final String format) { try { return ContentType.create(format) != null; } catch (IllegalArgumentException e) { return false; } } } | ContentType { public static boolean isParseable(final String format) { try { return ContentType.create(format) != null; } catch (IllegalArgumentException e) { return false; } } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat ... | ContentType { public static boolean isParseable(final String format) { try { return ContentType.create(format) != null; } catch (IllegalArgumentException e) { return false; } } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat ... | ContentType { public static boolean isParseable(final String format) { try { return ContentType.create(format) != null; } catch (IllegalArgumentException e) { return false; } } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat ... |
@Test(expected = IllegalArgumentException.class) public void testContentTypeCreationWildcardType() { ContentType.create("*", "subtype"); } | public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } } | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... |
@Test(expected = IllegalArgumentException.class) public void testContentTypeCreationWildcardTypeSingleFormat() { ContentType.create("*/subtype"); } | public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } } | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... |
@Test(expected = IllegalArgumentException.class) public void testContentTypeCreationFromStringsFail() { List<ContentType> types = ContentType.create(Arrays.asList("type/subtype", "application/xml", "application/json/FAIL;key=value")); assertEquals(3, types.size()); } | public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } } | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... |
@Test(expected = IllegalArgumentException.class) public void testFormatParserInvalidParameterWithSpaces() { ContentType.create("aaa/bbb;x= y;a"); } | public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } } | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... |
@Test(expected = IllegalArgumentException.class) public void testFormatParserInvalidParameterWithLineFeed() { ContentType.create("aaa/bbb;x=\ny;a"); } | public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } } | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... |
@Test(expected = IllegalArgumentException.class) public void testFormatParserInvalidParameterWithCarriageReturn() { ContentType.create("aaa/bbb;x=\ry;a"); } | public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } } | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... |
@Test public void testMapJPAEntitySetNegative() { assertNull(objJPAEdmMappingModelServiceTest.mapJPAEntitySet(ENTITY_TYPE_NAME_JPA_WRONG)); } | @Override public String mapJPAEntitySet(final String jpaEntityTypeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null) { return jpaEntityTypeMap.getEDMEntitySet(); } else { return null; } } | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAEntitySet(final String jpaEntityTypeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null) { return jpaEntityTypeMap.getEDMEntitySet(); } else { return null... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAEntitySet(final String jpaEntityTypeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null) { return jpaEntityTypeMap.getEDMEntitySet(); } else { return null... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAEntitySet(final String jpaEntityTypeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null) { return jpaEntityTypeMap.getEDMEntitySet(); } else { return null... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAEntitySet(final String jpaEntityTypeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null) { return jpaEntityTypeMap.getEDMEntitySet(); } else { return null... |
@Test(expected = IllegalArgumentException.class) public void testFormatParserInvalidParameterWithTabs() { ContentType.create("aaa/bbb;x=\ty;a"); } | public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } } | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... |
@Test(expected = IllegalArgumentException.class) public void testFormatParserInvalidParameterWithAllLws() { ContentType.create("aaa/bbb;x=\t \n \ry;a"); } | public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } } | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... |
@Test(expected = IllegalArgumentException.class) public void testFormatParserInvalidParameterWithAllLws2() { ContentType.create("aaa/bbb;x=\n \ry;a= \tbla "); } | public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } } | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... |
@Test public void testSimpleEqual() { ContentType t1 = ContentType.create("aaa/bbb"); ContentType t2 = ContentType.create("aaa/bbb"); assertEquals(t1, t2); } | public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } } | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... |
@Test(expected = IllegalArgumentException.class) public void testIllegalSubTypeWildcardSubtype() { ContentType t1 = ContentType.create("*/bbb"); assertNull(t1); } | public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } } | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... | ContentType { public static ContentType create(final String type, final String subtype) { return new ContentType(type, subtype, mapToODataFormat(type, subtype), null); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFo... |
@Test public void testIsWildcard() { assertFalse(ContentType.create("aaa/bbb;x=y;a").isWildcard()); assertFalse(ContentType.create("aaa*;x=y;a").isWildcard()); assertTrue(ContentType.create("*/*").isWildcard()); } | public boolean isWildcard() { return (MEDIA_TYPE_WILDCARD.equals(type) && MEDIA_TYPE_WILDCARD.equals(subtype)); } | ContentType { public boolean isWildcard() { return (MEDIA_TYPE_WILDCARD.equals(type) && MEDIA_TYPE_WILDCARD.equals(subtype)); } } | ContentType { public boolean isWildcard() { return (MEDIA_TYPE_WILDCARD.equals(type) && MEDIA_TYPE_WILDCARD.equals(subtype)); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFormat); private ContentType(final String t... | ContentType { public boolean isWildcard() { return (MEDIA_TYPE_WILDCARD.equals(type) && MEDIA_TYPE_WILDCARD.equals(subtype)); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFormat); private ContentType(final String t... | ContentType { public boolean isWildcard() { return (MEDIA_TYPE_WILDCARD.equals(type) && MEDIA_TYPE_WILDCARD.equals(subtype)); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFormat); private ContentType(final String t... |
@Test public void testHasWildcard() { assertFalse(ContentType.create("aaa/bbb;x=y;a").hasWildcard()); assertTrue(ContentType.create("aaa*;x=y;a").hasWildcard()); assertTrue(ContentType.create("*/*").hasWildcard()); } | public boolean hasWildcard() { return (MEDIA_TYPE_WILDCARD.equals(type) || MEDIA_TYPE_WILDCARD.equals(subtype)); } | ContentType { public boolean hasWildcard() { return (MEDIA_TYPE_WILDCARD.equals(type) || MEDIA_TYPE_WILDCARD.equals(subtype)); } } | ContentType { public boolean hasWildcard() { return (MEDIA_TYPE_WILDCARD.equals(type) || MEDIA_TYPE_WILDCARD.equals(subtype)); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFormat); private ContentType(final String ... | ContentType { public boolean hasWildcard() { return (MEDIA_TYPE_WILDCARD.equals(type) || MEDIA_TYPE_WILDCARD.equals(subtype)); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFormat); private ContentType(final String ... | ContentType { public boolean hasWildcard() { return (MEDIA_TYPE_WILDCARD.equals(type) || MEDIA_TYPE_WILDCARD.equals(subtype)); } private ContentType(final String type, final String subtype); private ContentType(final String type, final String subtype, final ODataFormat odataFormat); private ContentType(final String ... |
@Test public void asciiCharacters() { assertNull(Decoder.decode(null)); String s = "azAZ019"; assertEquals(s, Decoder.decode(s)); s = "\"\\`{}|"; assertEquals(s, Decoder.decode(s)); } | public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') { if (encod... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... |
@Test public void asciiControl() { assertEquals("\u0000\b\t\n\r", Decoder.decode("%00%08%09%0a%0d")); } | public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') { if (encod... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... |
@Test public void asciiEncoded() { assertEquals("<>%&", Decoder.decode("%3c%3e%25%26")); assertEquals(":/?#[]@", Decoder.decode("%3a%2f%3f%23%5b%5d%40")); assertEquals(" !\"$'()*+,-.", Decoder.decode("%20%21%22%24%27%28%29%2A%2B%2C%2D%2E")); } | public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') { if (encod... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... |
@Test public void testMapJPAAttribute() { assertEquals(ATTRIBUTE_NAME_EDM, objJPAEdmMappingModelServiceTest.mapJPAAttribute(ENTITY_TYPE_NAME_JPA, ATTRIBUTE_NAME_JPA)); } | @Override public String mapJPAAttribute(final String jpaEntityTypeName, final String jpaAttributeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null && jpaEntityTypeMap.getJPAAttributes() != null) { for (JPAAttribute jpaAttribute : jpaEntityTypeMap... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAAttribute(final String jpaEntityTypeName, final String jpaAttributeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null && jpaEntityTypeMap.getJPAAttribute... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAAttribute(final String jpaEntityTypeName, final String jpaAttributeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null && jpaEntityTypeMap.getJPAAttribute... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAAttribute(final String jpaEntityTypeName, final String jpaAttributeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null && jpaEntityTypeMap.getJPAAttribute... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAAttribute(final String jpaEntityTypeName, final String jpaAttributeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null && jpaEntityTypeMap.getJPAAttribute... |
@Test public void unicodeCharacters() { assertEquals("€", Decoder.decode("%E2%82%AC")); assertEquals("\uFDFC", Decoder.decode("%EF%B7%BC")); } | public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') { if (encod... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... |
@Test public void charactersOutsideBmp() { assertEquals(String.valueOf(Character.toChars(0x1F603)), Decoder.decode("%f0%9f%98%83")); } | public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') { if (encod... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... |
@Test(expected = IllegalArgumentException.class) public void wrongCharacter() { Decoder.decode("%20ä"); } | public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') { if (encod... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... |
@Test(expected = NumberFormatException.class) public void wrongPercentNumber() { Decoder.decode("%-3"); } | public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') { if (encod... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... |
@Test(expected = IllegalArgumentException.class) public void wrongPercentPercent() { Decoder.decode("%%a"); } | public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') { if (encod... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... |
@Test(expected = IllegalArgumentException.class) public void unfinishedPercent() { Decoder.decode("%a"); } | public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') { if (encod... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... |
@Test(expected = IllegalArgumentException.class) public void nullByte() { Decoder.decode("%\u0000ff"); } | public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') { if (encod... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... | Decoder { public static String decode(final String value) throws IllegalArgumentException, NumberFormatException { if (value == null) { return value; } byte[] result = new byte[value.length()]; int position = 0; byte encodedPart = -2; for (final char c : value.toCharArray()) { if (c <= Byte.MAX_VALUE) { if (c == '%') {... |
@Test public void minimal() throws Exception { final ODataContext context = mockContext(ODataHttpMethod.PUT); final ODataResponse wrappedResponse = mockResponse(HttpStatusCodes.NO_CONTENT, null, null); final ODataResponse response = new ODataDebugResponseWrapper(context, wrappedResponse, mock(UriInfo.class), null, ODat... | public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should not happen", e); } catch (f... | ODataDebugResponseWrapper { public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should... | ODataDebugResponseWrapper { public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should... | ODataDebugResponseWrapper { public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should... | ODataDebugResponseWrapper { public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should... |
@Test public void body() throws Exception { final ODataContext context = mockContext(ODataHttpMethod.GET); ODataResponse wrappedResponse = mockResponse(HttpStatusCodes.OK, "\"test\"", HttpContentType.APPLICATION_JSON); ODataResponse response = new ODataDebugResponseWrapper(context, wrappedResponse, mock(UriInfo.class),... | public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should not happen", e); } catch (f... | ODataDebugResponseWrapper { public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should... | ODataDebugResponseWrapper { public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should... | ODataDebugResponseWrapper { public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should... | ODataDebugResponseWrapper { public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should... |
@Test public void headers() throws Exception { ODataContext context = mockContext(ODataHttpMethod.GET); Map<String, List<String>> headers = new HashMap<String, List<String>>(); headers.put(HttpHeaders.CONTENT_TYPE, Arrays.asList(HttpContentType.APPLICATION_JSON)); when(context.getRequestHeaders()).thenReturn(headers); ... | public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should not happen", e); } catch (f... | ODataDebugResponseWrapper { public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should... | ODataDebugResponseWrapper { public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should... | ODataDebugResponseWrapper { public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should... | ODataDebugResponseWrapper { public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should... |
@Test public void testMapJPAAttributeNegative() { assertNull(objJPAEdmMappingModelServiceTest.mapJPAAttribute(ENTITY_TYPE_NAME_JPA, ATTRIBUTE_NAME_JPA + "AA")); } | @Override public String mapJPAAttribute(final String jpaEntityTypeName, final String jpaAttributeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null && jpaEntityTypeMap.getJPAAttributes() != null) { for (JPAAttribute jpaAttribute : jpaEntityTypeMap... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAAttribute(final String jpaEntityTypeName, final String jpaAttributeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null && jpaEntityTypeMap.getJPAAttribute... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAAttribute(final String jpaEntityTypeName, final String jpaAttributeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null && jpaEntityTypeMap.getJPAAttribute... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAAttribute(final String jpaEntityTypeName, final String jpaAttributeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null && jpaEntityTypeMap.getJPAAttribute... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPAAttribute(final String jpaEntityTypeName, final String jpaAttributeName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null && jpaEntityTypeMap.getJPAAttribute... |
@Test public void uri() throws Exception { final ODataContext context = mockContext(ODataHttpMethod.GET); final ODataResponse wrappedResponse = mockResponse(HttpStatusCodes.OK, null, null); UriInfo uriInfo = mock(UriInfo.class); final FilterExpression filter = UriParser.parseFilter(null, null, "true"); when(uriInfo.get... | public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should not happen", e); } catch (f... | ODataDebugResponseWrapper { public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should... | ODataDebugResponseWrapper { public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should... | ODataDebugResponseWrapper { public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should... | ODataDebugResponseWrapper { public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should... |
@Test public void uriWithException() throws Exception { final ODataContext context = mockContext(ODataHttpMethod.GET); final ODataResponse wrappedResponse = mockResponse(HttpStatusCodes.OK, null, null); UriInfo uriInfo = mock(UriInfo.class); FilterExpression filter = mock(FilterExpression.class); when(filter.getExpress... | public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should not happen", e); } catch (f... | ODataDebugResponseWrapper { public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should... | ODataDebugResponseWrapper { public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should... | ODataDebugResponseWrapper { public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should... | ODataDebugResponseWrapper { public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should... |
@Test public void runtime() throws Exception { ODataContext context = mockContext(ODataHttpMethod.GET); List<RuntimeMeasurement> runtimeMeasurements = new ArrayList<RuntimeMeasurement>(); runtimeMeasurements.add(mockRuntimeMeasurement("method", 1000, 42000)); runtimeMeasurements.add(mockRuntimeMeasurement("inner", 2000... | public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should not happen", e); } catch (f... | ODataDebugResponseWrapper { public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should... | ODataDebugResponseWrapper { public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should... | ODataDebugResponseWrapper { public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should... | ODataDebugResponseWrapper { public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should... |
@Test public void exception() throws Exception { final ODataContext context = mockContext(ODataHttpMethod.GET); final ODataResponse wrappedResponse = mockResponse(HttpStatusCodes.BAD_REQUEST, null, null); ODataMessageException exception = mock(ODataMessageException.class); when(exception.getMessageReference()).thenRetu... | public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should not happen", e); } catch (f... | ODataDebugResponseWrapper { public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should... | ODataDebugResponseWrapper { public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should... | ODataDebugResponseWrapper { public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should... | ODataDebugResponseWrapper { public ODataResponse wrapResponse() { try { return ODataResponse.status(HttpStatusCodes.OK) .entity(isJson ? wrapInJson(createParts()) : null) .contentHeader(isJson ? HttpContentType.APPLICATION_JSON : null) .build(); } catch (final ODataException e) { throw new ODataRuntimeException("Should... |
@Test public void jsonStringContent() throws Exception { ODataResponse response = mock(ODataResponse.class); when(response.getEntity()).thenReturn(STRING_CONTENT); when(response.getContentHeader()).thenReturn(HttpContentType.APPLICATION_OCTET_STREAM); assertEquals(STRING_CONTENT_JSON, appendJson(response)); when(respon... | @Override public void appendJson(final JsonStreamWriter jsonStreamWriter) throws IOException { final String contentType = response.getContentHeader(); if (contentType.startsWith("image/")) { if (response.getEntity() instanceof InputStream) { jsonStreamWriter.stringValueRaw(Base64.encodeBase64String(getBinaryFromInputSt... | DebugInfoBody implements DebugInfo { @Override public void appendJson(final JsonStreamWriter jsonStreamWriter) throws IOException { final String contentType = response.getContentHeader(); if (contentType.startsWith("image/")) { if (response.getEntity() instanceof InputStream) { jsonStreamWriter.stringValueRaw(Base64.en... | DebugInfoBody implements DebugInfo { @Override public void appendJson(final JsonStreamWriter jsonStreamWriter) throws IOException { final String contentType = response.getContentHeader(); if (contentType.startsWith("image/")) { if (response.getEntity() instanceof InputStream) { jsonStreamWriter.stringValueRaw(Base64.en... | DebugInfoBody implements DebugInfo { @Override public void appendJson(final JsonStreamWriter jsonStreamWriter) throws IOException { final String contentType = response.getContentHeader(); if (contentType.startsWith("image/")) { if (response.getEntity() instanceof InputStream) { jsonStreamWriter.stringValueRaw(Base64.en... | DebugInfoBody implements DebugInfo { @Override public void appendJson(final JsonStreamWriter jsonStreamWriter) throws IOException { final String contentType = response.getContentHeader(); if (contentType.startsWith("image/")) { if (response.getEntity() instanceof InputStream) { jsonStreamWriter.stringValueRaw(Base64.en... |
@Test public void jsonInputStreamContent() throws Exception { ODataResponse response = mock(ODataResponse.class); ByteArrayInputStream in = new ByteArrayInputStream(STRING_CONTENT.getBytes()); when(response.getEntity()).thenReturn(in); when(response.getContentHeader()).thenReturn(HttpContentType.APPLICATION_OCTET_STREA... | @Override public void appendJson(final JsonStreamWriter jsonStreamWriter) throws IOException { final String contentType = response.getContentHeader(); if (contentType.startsWith("image/")) { if (response.getEntity() instanceof InputStream) { jsonStreamWriter.stringValueRaw(Base64.encodeBase64String(getBinaryFromInputSt... | DebugInfoBody implements DebugInfo { @Override public void appendJson(final JsonStreamWriter jsonStreamWriter) throws IOException { final String contentType = response.getContentHeader(); if (contentType.startsWith("image/")) { if (response.getEntity() instanceof InputStream) { jsonStreamWriter.stringValueRaw(Base64.en... | DebugInfoBody implements DebugInfo { @Override public void appendJson(final JsonStreamWriter jsonStreamWriter) throws IOException { final String contentType = response.getContentHeader(); if (contentType.startsWith("image/")) { if (response.getEntity() instanceof InputStream) { jsonStreamWriter.stringValueRaw(Base64.en... | DebugInfoBody implements DebugInfo { @Override public void appendJson(final JsonStreamWriter jsonStreamWriter) throws IOException { final String contentType = response.getContentHeader(); if (contentType.startsWith("image/")) { if (response.getEntity() instanceof InputStream) { jsonStreamWriter.stringValueRaw(Base64.en... | DebugInfoBody implements DebugInfo { @Override public void appendJson(final JsonStreamWriter jsonStreamWriter) throws IOException { final String contentType = response.getContentHeader(); if (contentType.startsWith("image/")) { if (response.getEntity() instanceof InputStream) { jsonStreamWriter.stringValueRaw(Base64.en... |
@Test(expected = ClassCastException.class) public void jsonUnsupportedContent() throws Exception { ODataResponse response = mock(ODataResponse.class); when(response.getEntity()).thenReturn(new Object()); when(response.getContentHeader()).thenReturn(HttpContentType.APPLICATION_OCTET_STREAM); appendJson(response); } | @Override public void appendJson(final JsonStreamWriter jsonStreamWriter) throws IOException { final String contentType = response.getContentHeader(); if (contentType.startsWith("image/")) { if (response.getEntity() instanceof InputStream) { jsonStreamWriter.stringValueRaw(Base64.encodeBase64String(getBinaryFromInputSt... | DebugInfoBody implements DebugInfo { @Override public void appendJson(final JsonStreamWriter jsonStreamWriter) throws IOException { final String contentType = response.getContentHeader(); if (contentType.startsWith("image/")) { if (response.getEntity() instanceof InputStream) { jsonStreamWriter.stringValueRaw(Base64.en... | DebugInfoBody implements DebugInfo { @Override public void appendJson(final JsonStreamWriter jsonStreamWriter) throws IOException { final String contentType = response.getContentHeader(); if (contentType.startsWith("image/")) { if (response.getEntity() instanceof InputStream) { jsonStreamWriter.stringValueRaw(Base64.en... | DebugInfoBody implements DebugInfo { @Override public void appendJson(final JsonStreamWriter jsonStreamWriter) throws IOException { final String contentType = response.getContentHeader(); if (contentType.startsWith("image/")) { if (response.getEntity() instanceof InputStream) { jsonStreamWriter.stringValueRaw(Base64.en... | DebugInfoBody implements DebugInfo { @Override public void appendJson(final JsonStreamWriter jsonStreamWriter) throws IOException { final String contentType = response.getContentHeader(); if (contentType.startsWith("image/")) { if (response.getEntity() instanceof InputStream) { jsonStreamWriter.stringValueRaw(Base64.en... |
@Test public void dispatch() throws Exception { checkDispatch(ODataHttpMethod.GET, UriType.URI0, "readServiceDocument"); checkDispatch(ODataHttpMethod.GET, UriType.URI1, "readEntitySet"); checkDispatch(ODataHttpMethod.POST, UriType.URI1, "createEntity"); checkDispatch(ODataHttpMethod.GET, UriType.URI2, "readEntity"); c... | public ODataResponse dispatch(final ODataHttpMethod method, final UriInfoImpl uriInfo, final InputStream content, final String requestContentType, final String contentType) throws ODataException { switch (uriInfo.getUriType()) { case URI0: if (method == ODataHttpMethod.GET) { return service.getServiceDocumentProcessor(... | Dispatcher { public ODataResponse dispatch(final ODataHttpMethod method, final UriInfoImpl uriInfo, final InputStream content, final String requestContentType, final String contentType) throws ODataException { switch (uriInfo.getUriType()) { case URI0: if (method == ODataHttpMethod.GET) { return service.getServiceDocum... | Dispatcher { public ODataResponse dispatch(final ODataHttpMethod method, final UriInfoImpl uriInfo, final InputStream content, final String requestContentType, final String contentType) throws ODataException { switch (uriInfo.getUriType()) { case URI0: if (method == ODataHttpMethod.GET) { return service.getServiceDocum... | Dispatcher { public ODataResponse dispatch(final ODataHttpMethod method, final UriInfoImpl uriInfo, final InputStream content, final String requestContentType, final String contentType) throws ODataException { switch (uriInfo.getUriType()) { case URI0: if (method == ODataHttpMethod.GET) { return service.getServiceDocum... | Dispatcher { public ODataResponse dispatch(final ODataHttpMethod method, final UriInfoImpl uriInfo, final InputStream content, final String requestContentType, final String contentType) throws ODataException { switch (uriInfo.getUriType()) { case URI0: if (method == ODataHttpMethod.GET) { return service.getServiceDocum... |
@Test public void escape() throws Exception { final String outsideBMP = String.valueOf(Character.toChars(0x1F603)); StringWriter writer = new StringWriter(); JsonStreamWriter jsonStreamWriter = new JsonStreamWriter(writer); jsonStreamWriter.beginObject() .namedStringValue("normal", "abc / ? \u007F € \uFDFC").separator(... | protected void escape(final String value) throws IOException { for (int i = 0; i < value.length(); i++) { final char c = value.charAt(i); switch (c) { case '\\': writer.append('\\').append(c); break; case '"': writer.append('\\').append(c); break; case '\b': writer.append('\\').append('b'); break; case '\t': writer.app... | JsonStreamWriter { protected void escape(final String value) throws IOException { for (int i = 0; i < value.length(); i++) { final char c = value.charAt(i); switch (c) { case '\\': writer.append('\\').append(c); break; case '"': writer.append('\\').append(c); break; case '\b': writer.append('\\').append('b'); break; ca... | JsonStreamWriter { protected void escape(final String value) throws IOException { for (int i = 0; i < value.length(); i++) { final char c = value.charAt(i); switch (c) { case '\\': writer.append('\\').append(c); break; case '"': writer.append('\\').append(c); break; case '\b': writer.append('\\').append('b'); break; ca... | JsonStreamWriter { protected void escape(final String value) throws IOException { for (int i = 0; i < value.length(); i++) { final char c = value.charAt(i); switch (c) { case '\\': writer.append('\\').append(c); break; case '"': writer.append('\\').append(c); break; case '\b': writer.append('\\').append('b'); break; ca... | JsonStreamWriter { protected void escape(final String value) throws IOException { for (int i = 0; i < value.length(); i++) { final char c = value.charAt(i); switch (c) { case '\\': writer.append('\\').append(c); break; case '"': writer.append('\\').append(c); break; case '\b': writer.append('\\').append('b'); break; ca... |
@Test public void readIntegerProperty() throws Exception { String xml = "<Age xmlns=\"" + Edm.NAMESPACE_D_2007_08 + "\">67</Age>"; XMLStreamReader reader = createReaderForTest(xml, true); final EdmProperty property = (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Employee").getProperty("Age"); Map<... | public Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, final boolean merge) throws EntityProviderException { return readProperty(reader, property, merge, null); } | XmlPropertyConsumer { public Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, final boolean merge) throws EntityProviderException { return readProperty(reader, property, merge, null); } } | XmlPropertyConsumer { public Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, final boolean merge) throws EntityProviderException { return readProperty(reader, property, merge, null); } } | XmlPropertyConsumer { public Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, final boolean merge) throws EntityProviderException { return readProperty(reader, property, merge, null); } Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, ... | XmlPropertyConsumer { public Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, final boolean merge) throws EntityProviderException { return readProperty(reader, property, merge, null); } Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, ... |
@Test public void testMapJPARelationship() { assertEquals(RELATIONSHIP_NAME_EDM, objJPAEdmMappingModelServiceTest.mapJPARelationship(ENTITY_TYPE_NAME_JPA, RELATIONSHIP_NAME_JPA)); } | @Override public String mapJPARelationship(final String jpaEntityTypeName, final String jpaRelationshipName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null) { for (JPARelationship jpaRealtionship : jpaEntityTypeMap .getJPARelationships().getJPARelat... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPARelationship(final String jpaEntityTypeName, final String jpaRelationshipName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null) { for (JPARelationship jpaRe... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPARelationship(final String jpaEntityTypeName, final String jpaRelationshipName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null) { for (JPARelationship jpaRe... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPARelationship(final String jpaEntityTypeName, final String jpaRelationshipName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null) { for (JPARelationship jpaRe... | JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public String mapJPARelationship(final String jpaEntityTypeName, final String jpaRelationshipName) { JPAEntityTypeMapType jpaEntityTypeMap = searchJPAEntityTypeMapType(jpaEntityTypeName); if (jpaEntityTypeMap != null) { for (JPARelationship jpaRe... |
@Test public void testEmployees() { Team team1 = new Team(1, VALUE_NAME); Employee employee1 = new Employee(1, null); Employee employee2 = new Employee(2, null); List<Employee> testList = Arrays.asList(employee1, employee2); team1.getEmployees().addAll(testList); for (Employee emp : testList) { emp.setTeam(team1); } as... | public List<Employee> getEmployees() { return employees; } | Team { public List<Employee> getEmployees() { return employees; } } | Team { public List<Employee> getEmployees() { return employees; } Team(final int id, final String name); } | Team { public List<Employee> getEmployees() { return employees; } Team(final int id, final String name); String getId(); String getName(); void setName(final String name); boolean isScrumTeam(); void setScrumTeam(final boolean isScrumTeam); List<Employee> getEmployees(); @Override int hashCode(); @Override boolean equa... | Team { public List<Employee> getEmployees() { return employees; } Team(final int id, final String name); String getId(); String getName(); void setName(final String name); boolean isScrumTeam(); void setScrumTeam(final boolean isScrumTeam); List<Employee> getEmployees(); @Override int hashCode(); @Override boolean equa... |
@Test public void readIntegerPropertyAsLong() throws Exception { String xml = "<Age xmlns=\"" + Edm.NAMESPACE_D_2007_08 + "\">67</Age>"; XMLStreamReader reader = createReaderForTest(xml, true); final EdmProperty property = (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Employee").getProperty("Age")... | public Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, final boolean merge) throws EntityProviderException { return readProperty(reader, property, merge, null); } | XmlPropertyConsumer { public Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, final boolean merge) throws EntityProviderException { return readProperty(reader, property, merge, null); } } | XmlPropertyConsumer { public Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, final boolean merge) throws EntityProviderException { return readProperty(reader, property, merge, null); } } | XmlPropertyConsumer { public Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, final boolean merge) throws EntityProviderException { return readProperty(reader, property, merge, null); } Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, ... | XmlPropertyConsumer { public Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, final boolean merge) throws EntityProviderException { return readProperty(reader, property, merge, null); } Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, ... |
@Test public void readIntegerPropertyWithNullMapping() throws Exception { String xml = "<Age xmlns=\"" + Edm.NAMESPACE_D_2007_08 + "\">67</Age>"; XMLStreamReader reader = createReaderForTest(xml, true); final EdmProperty property = (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Employee").getProper... | public Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, final boolean merge) throws EntityProviderException { return readProperty(reader, property, merge, null); } | XmlPropertyConsumer { public Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, final boolean merge) throws EntityProviderException { return readProperty(reader, property, merge, null); } } | XmlPropertyConsumer { public Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, final boolean merge) throws EntityProviderException { return readProperty(reader, property, merge, null); } } | XmlPropertyConsumer { public Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, final boolean merge) throws EntityProviderException { return readProperty(reader, property, merge, null); } Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, ... | XmlPropertyConsumer { public Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, final boolean merge) throws EntityProviderException { return readProperty(reader, property, merge, null); } Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, ... |
@Test public void readIntegerPropertyWithEmptyMapping() throws Exception { String xml = "<Age xmlns=\"" + Edm.NAMESPACE_D_2007_08 + "\">67</Age>"; XMLStreamReader reader = createReaderForTest(xml, true); final EdmProperty property = (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Employee").getPrope... | public Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, final boolean merge) throws EntityProviderException { return readProperty(reader, property, merge, null); } | XmlPropertyConsumer { public Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, final boolean merge) throws EntityProviderException { return readProperty(reader, property, merge, null); } } | XmlPropertyConsumer { public Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, final boolean merge) throws EntityProviderException { return readProperty(reader, property, merge, null); } } | XmlPropertyConsumer { public Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, final boolean merge) throws EntityProviderException { return readProperty(reader, property, merge, null); } Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, ... | XmlPropertyConsumer { public Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, final boolean merge) throws EntityProviderException { return readProperty(reader, property, merge, null); } Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, ... |
@Test public void readStringProperty() throws Exception { String xml = "<EmployeeName xmlns=\"" + Edm.NAMESPACE_D_2007_08 + "\">Max Mustermann</EmployeeName>"; XMLStreamReader reader = createReaderForTest(xml, true); final EdmProperty property = (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Employ... | public Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, final boolean merge) throws EntityProviderException { return readProperty(reader, property, merge, null); } | XmlPropertyConsumer { public Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, final boolean merge) throws EntityProviderException { return readProperty(reader, property, merge, null); } } | XmlPropertyConsumer { public Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, final boolean merge) throws EntityProviderException { return readProperty(reader, property, merge, null); } } | XmlPropertyConsumer { public Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, final boolean merge) throws EntityProviderException { return readProperty(reader, property, merge, null); } Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, ... | XmlPropertyConsumer { public Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, final boolean merge) throws EntityProviderException { return readProperty(reader, property, merge, null); } Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.