Unverified Commit ff18c728 authored by Gregory Cage's avatar Gregory Cage Committed by GitHub
Browse files

Merge pull request #3 from eclipse/next

Next
parents 1ae7dae1 dd3d5f82
......@@ -23,6 +23,33 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.processAnnotations=disabled
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.source=11
......@@ -5,21 +5,39 @@
<groupId>org.eclipse.ice</groupId>
<artifactId>org.eclipse.ice.data</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>org.eclipse.ice.data</name>
<url>https://www.eclipse.org/ice</url>
<properties>
<java.version>11</java.version>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.release>11</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.2</version>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.6.2</version>
<scope>test</scope>
</dependency>
......
package org.eclipse.ice.dev.annotations;
/******************************************************************************
* Copyright (c) 2020- UT-Battelle, LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Initial API and implementation and/or initial documentation -
* Daniel Bluhm
*****************************************************************************/
package org.eclipse.ice.data;
import java.util.UUID;
......
package org.eclipse.ice.dev.annotations;
/******************************************************************************
* Copyright (c) 2020- UT-Battelle, LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Initial API and implementation and/or initial documentation -
* Daniel Bluhm
*****************************************************************************/
package org.eclipse.ice.data;
import java.util.UUID;
......
......@@ -9,7 +9,7 @@
* Initial API and implementation and/or initial documentation -
* Jay Jay Billings
*******************************************************************************/
package org.eclipse.ice.dev.annotations;
package org.eclipse.ice.data;
import java.io.Serializable;
import javax.script.Invocable;
......
......@@ -11,7 +11,9 @@
*****************************************************************************/
package org.eclipse.ice.tests.data;
import static org.junit.Assert.*;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
import org.apache.jena.ontology.OntModel;
import org.apache.jena.ontology.OntModelSpec;
......@@ -21,8 +23,6 @@ import org.apache.jena.rdf.model.Resource;
import org.apache.jena.util.FileManager;
import org.eclipse.ice.data.ComponentBuilder;
import org.eclipse.ice.data.ICEDataConstants;
import org.junit.BeforeClass;
import org.junit.Test;
/**
* This class tests {@link ComponentBuilder}.
......@@ -46,7 +46,7 @@ public class ComponentBuilderTest {
/**
* @throws java.lang.Exception
*/
@BeforeClass
@BeforeAll
public static void setUpBeforeClass() throws Exception {
// Load the ontology
Model baseModel = FileManager.get().loadModel("data/org.eclipse.ice.data.owl.ttl", null, "TURTLE");
......
......@@ -11,22 +11,24 @@
*****************************************************************************/
package org.eclipse.ice.tests.data;
import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
* This class tests {@link CompositeBuilder}.
* @author Jay Jay Billings
*
*/
@Disabled
public class CompositeBuilderTest {
/**
* @throws java.lang.Exception
*/
@BeforeClass
@BeforeAll
public static void setUpBeforeClass() throws Exception {
}
......
......@@ -11,13 +11,13 @@
*****************************************************************************/
package org.eclipse.ice.tests.data;
import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;
import org.apache.jena.rdf.model.Model;
import org.eclipse.ice.data.ComponentBuilder;
import org.eclipse.ice.data.ICEModelFactory;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
/**
* This class tests the ModelFactory used to build ICE's data structures.
......@@ -30,7 +30,7 @@ public class ICEModelFactoryTest {
/**
* @throws java.lang.Exception
*/
@BeforeClass
@BeforeAll
public static void setUpBeforeClass() throws Exception {
}
......
......@@ -11,10 +11,11 @@
*****************************************************************************/
package org.eclipse.ice.tests.data;
import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
* This class is responsible for insuring that the ModelValidator can correctly
......@@ -23,12 +24,13 @@ import org.junit.Test;
* @author Jay Jay Billings
*
*/
@Disabled
public class ModelValidatorTest {
/**
* @throws java.lang.Exception
*/
@BeforeClass
@BeforeAll
public static void setUpBeforeClass() throws Exception {
}
......
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.ice.dev</groupId>
......@@ -78,5 +80,11 @@
<artifactId>org.eclipse.ice.dev.annotations</artifactId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.eclipse.ice</groupId>
<artifactId>org.eclipse.ice.data</artifactId>
<version>3.0.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
......@@ -13,7 +13,7 @@ package org.eclipse.ice.dev.annotations.proxytest;
import static org.junit.jupiter.api.Assertions.*;
import org.eclipse.ice.dev.annotations.JavascriptValidator;
import org.eclipse.ice.data.JavascriptValidator;
import org.junit.jupiter.api.Test;
/**
......
......@@ -2,7 +2,7 @@ package org.eclipse.ice.dev.annotations.proxytest;
import static org.junit.jupiter.api.Assertions.*;
import org.eclipse.ice.dev.annotations.JavascriptValidator;
import org.eclipse.ice.data.JavascriptValidator;
import org.junit.jupiter.api.Test;
/**
......
......@@ -96,6 +96,12 @@
<artifactId>mongo-java-driver</artifactId>
<version>3.12.2</version>
</dependency>
<dependency>
<groupId>org.eclipse.ice</groupId>
<artifactId>org.eclipse.ice.data</artifactId>
<version>3.0.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
<parent>
......
/******************************************************************************
* Copyright (c) 2020- UT-Battelle, LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Initial API and implementation and/or initial documentation -
* Jay Jay Billings, Daniel Bluhm
*****************************************************************************/
package org.eclipse.ice.dev.annotations;
import java.lang.annotation.Retention;
......@@ -38,9 +49,10 @@ import java.lang.annotation.RetentionPolicy;
* {@code PersonImplementation}) that fulfills that interface.
*
*
* @see org.eclipse.ice.dev.annotations.IDataElement
* @see org.eclipse.ice.data.IDataElement
* @see org.eclipse.ice.dev.annotations.DataField
* @author Daniel Bluhm
* @author Jay Jay Billings
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.SOURCE)
......
/******************************************************************************
* Copyright (c) 2020- UT-Battelle, LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Initial API and implementation and/or initial documentation -
* Jay Jay Billings, Daniel Bluhm
*****************************************************************************/
package org.eclipse.ice.dev.annotations;
import java.lang.annotation.ElementType;
......@@ -11,6 +22,7 @@ import java.lang.annotation.Target;
* @see org.eclipse.ice.dev.annotations.DataElement
* @see org.eclipse.ice.dev.annotations.DataField.Default
* @author Daniel Bluhm
* @author Jay Jay Billings
*/
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.SOURCE)
......@@ -34,7 +46,7 @@ public @interface DataField {
/**
* Flag whether this field should be included in
* {@link org.eclipse.ice.dev.annotations.IDataElement#matches(Object)}.
* {@link org.eclipse.ice.data.IDataElement#matches(Object)}.
* @return match annotation value
* @see org.eclipse.ice.dev.annotations.processors.Field#match
*/
......@@ -53,10 +65,10 @@ public @interface DataField {
* Flag whether this field should be searchable in a collection.
* This causes persistence retrieval methods to be generated for this
* field.
* @return search annotation value
* @see org.eclipse.ice.dev.annotations.processors.Field#search
* @return searchable annotation value
* @see org.eclipse.ice.dev.annotations.processors.Field#searchable
*/
boolean search() default true;
boolean searchable() default true;
/**
* Flag whether this field can have a value of null. This causes
......
......@@ -174,6 +174,7 @@ public class DataElementProcessor extends AbstractProcessor {
.packageName(element.getPackageName())
.elementInterface(element.getName())
.className(element.getPersistenceHandlerName())
.interfaceName(element.getPersistenceHandlerInterfaceName())
.implementation(element.getImplName())
.collection(collectionName)
.fields(fields)
......
/******************************************************************************
* Copyright (c) 2019- UT-Battelle, LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Initial API and implementation and/or initial documentation -
* Daniel Bluhm
*****************************************************************************/
package org.eclipse.ice.dev.annotations.processors;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
......@@ -11,6 +21,7 @@ import javax.lang.model.element.ElementKind;
import javax.lang.model.element.TypeElement;
import javax.lang.model.util.Elements;
import org.eclipse.ice.data.IPersistenceHandler;
import org.eclipse.ice.dev.annotations.DataElement;
import org.eclipse.ice.dev.annotations.DataFieldJson;
import org.eclipse.ice.dev.annotations.Persisted;
......@@ -179,4 +190,15 @@ public class DataElementSpec extends AnnotatedElement {
.map(jsons -> Arrays.asList(jsons.value()))
.orElse(Collections.emptyList());
}
/**
* Get the interface name of the persistence handler.
*
* Right now, this is simply the IPersistenceHandler interface. In the future
* this will be a data element specific interface.
* @return Interface name of the Persistence Handler
*/
public String getPersistenceHandlerInterfaceName() {
return org.eclipse.ice.data.IPersistenceHandler.class.getSimpleName();
}
}
......@@ -138,7 +138,7 @@ public class DataFieldSpec extends AnnotatedElement {
.setter(fieldInfo.setter())
.match(fieldInfo.match())
.unique(fieldInfo.unique())
.search(fieldInfo.search())
.searchable(fieldInfo.searchable())
.nullable(fieldInfo.nullable())
.build();
}
......
......@@ -4,7 +4,7 @@ import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import org.eclipse.ice.dev.annotations.JavascriptValidator;
import org.eclipse.ice.data.JavascriptValidator;
/**
* Aggregation of fields generated and included in <code>@DataElement</code>
......@@ -117,7 +117,7 @@ public class DefaultFields {
.docString("The validator used to check the correctness of the data.")
.nullable(true)
.defaultField(true)
.search(false)
.searchable(false)
.build();
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment