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 @@ ...@@ -23,6 +23,33 @@
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </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"/> <classpathentry kind="output" path="target/classes"/>
</classpath> </classpath>
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 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.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 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.release=disabled
org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.compiler.source=11
...@@ -5,21 +5,39 @@ ...@@ -5,21 +5,39 @@
<groupId>org.eclipse.ice</groupId> <groupId>org.eclipse.ice</groupId>
<artifactId>org.eclipse.ice.data</artifactId> <artifactId>org.eclipse.ice.data</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>3.0.0-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>org.eclipse.ice.data</name> <name>org.eclipse.ice.data</name>
<url>https://www.eclipse.org/ice</url> <url>https://www.eclipse.org/ice</url>
<properties> <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> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties> </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> <dependencies>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>org.junit.jupiter</groupId>
<artifactId>junit</artifactId> <artifactId>junit-jupiter</artifactId>
<version>4.12</version> <version>5.6.2</version>
<scope>test</scope> <scope>test</scope>
</dependency> </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; 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; import java.util.UUID;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* Initial API and implementation and/or initial documentation - * Initial API and implementation and/or initial documentation -
* Jay Jay Billings * Jay Jay Billings
*******************************************************************************/ *******************************************************************************/
package org.eclipse.ice.dev.annotations; package org.eclipse.ice.data;
import java.io.Serializable; import java.io.Serializable;
import javax.script.Invocable; import javax.script.Invocable;
......
...@@ -11,7 +11,9 @@ ...@@ -11,7 +11,9 @@
*****************************************************************************/ *****************************************************************************/
package org.eclipse.ice.tests.data; 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.OntModel;
import org.apache.jena.ontology.OntModelSpec; import org.apache.jena.ontology.OntModelSpec;
...@@ -21,8 +23,6 @@ import org.apache.jena.rdf.model.Resource; ...@@ -21,8 +23,6 @@ import org.apache.jena.rdf.model.Resource;
import org.apache.jena.util.FileManager; import org.apache.jena.util.FileManager;
import org.eclipse.ice.data.ComponentBuilder; import org.eclipse.ice.data.ComponentBuilder;
import org.eclipse.ice.data.ICEDataConstants; import org.eclipse.ice.data.ICEDataConstants;
import org.junit.BeforeClass;
import org.junit.Test;
/** /**
* This class tests {@link ComponentBuilder}. * This class tests {@link ComponentBuilder}.
...@@ -46,7 +46,7 @@ public class ComponentBuilderTest { ...@@ -46,7 +46,7 @@ public class ComponentBuilderTest {
/** /**
* @throws java.lang.Exception * @throws java.lang.Exception
*/ */
@BeforeClass @BeforeAll
public static void setUpBeforeClass() throws Exception { public static void setUpBeforeClass() throws Exception {
// Load the ontology // Load the ontology
Model baseModel = FileManager.get().loadModel("data/org.eclipse.ice.data.owl.ttl", null, "TURTLE"); Model baseModel = FileManager.get().loadModel("data/org.eclipse.ice.data.owl.ttl", null, "TURTLE");
......
...@@ -11,22 +11,24 @@ ...@@ -11,22 +11,24 @@
*****************************************************************************/ *****************************************************************************/
package org.eclipse.ice.tests.data; 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.jupiter.api.BeforeAll;
import org.junit.Test; import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/** /**
* This class tests {@link CompositeBuilder}. * This class tests {@link CompositeBuilder}.
* @author Jay Jay Billings * @author Jay Jay Billings
* *
*/ */
@Disabled
public class CompositeBuilderTest { public class CompositeBuilderTest {
/** /**
* @throws java.lang.Exception * @throws java.lang.Exception
*/ */
@BeforeClass @BeforeAll
public static void setUpBeforeClass() throws Exception { public static void setUpBeforeClass() throws Exception {
} }
......
...@@ -11,13 +11,13 @@ ...@@ -11,13 +11,13 @@
*****************************************************************************/ *****************************************************************************/
package org.eclipse.ice.tests.data; 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.apache.jena.rdf.model.Model;
import org.eclipse.ice.data.ComponentBuilder; import org.eclipse.ice.data.ComponentBuilder;
import org.eclipse.ice.data.ICEModelFactory; import org.eclipse.ice.data.ICEModelFactory;
import org.junit.BeforeClass; import org.junit.jupiter.api.BeforeAll;
import org.junit.Test; import org.junit.jupiter.api.Test;
/** /**
* This class tests the ModelFactory used to build ICE's data structures. * This class tests the ModelFactory used to build ICE's data structures.
...@@ -30,7 +30,7 @@ public class ICEModelFactoryTest { ...@@ -30,7 +30,7 @@ public class ICEModelFactoryTest {
/** /**
* @throws java.lang.Exception * @throws java.lang.Exception
*/ */
@BeforeClass @BeforeAll
public static void setUpBeforeClass() throws Exception { public static void setUpBeforeClass() throws Exception {
} }
......
...@@ -11,10 +11,11 @@ ...@@ -11,10 +11,11 @@
*****************************************************************************/ *****************************************************************************/
package org.eclipse.ice.tests.data; 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.jupiter.api.BeforeAll;
import org.junit.Test; import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/** /**
* This class is responsible for insuring that the ModelValidator can correctly * This class is responsible for insuring that the ModelValidator can correctly
...@@ -23,12 +24,13 @@ import org.junit.Test; ...@@ -23,12 +24,13 @@ import org.junit.Test;
* @author Jay Jay Billings * @author Jay Jay Billings
* *
*/ */
@Disabled
public class ModelValidatorTest { public class ModelValidatorTest {
/** /**
* @throws java.lang.Exception * @throws java.lang.Exception
*/ */
@BeforeClass @BeforeAll
public static void setUpBeforeClass() throws Exception { 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> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.eclipse.ice.dev</groupId> <groupId>org.eclipse.ice.dev</groupId>
...@@ -78,5 +80,11 @@ ...@@ -78,5 +80,11 @@
<artifactId>org.eclipse.ice.dev.annotations</artifactId> <artifactId>org.eclipse.ice.dev.annotations</artifactId>
<version>3.0.0-SNAPSHOT</version> <version>3.0.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency>
<groupId>org.eclipse.ice</groupId>
<artifactId>org.eclipse.ice.data</artifactId>
<version>3.0.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
...@@ -13,7 +13,7 @@ package org.eclipse.ice.dev.annotations.proxytest; ...@@ -13,7 +13,7 @@ package org.eclipse.ice.dev.annotations.proxytest;
import static org.junit.jupiter.api.Assertions.*; 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; import org.junit.jupiter.api.Test;
/** /**
......
...@@ -2,7 +2,7 @@ package org.eclipse.ice.dev.annotations.proxytest; ...@@ -2,7 +2,7 @@ package org.eclipse.ice.dev.annotations.proxytest;
import static org.junit.jupiter.api.Assertions.*; 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; import org.junit.jupiter.api.Test;
/** /**
......
...@@ -96,6 +96,12 @@ ...@@ -96,6 +96,12 @@
<artifactId>mongo-java-driver</artifactId> <artifactId>mongo-java-driver</artifactId>
<version>3.12.2</version> <version>3.12.2</version>
</dependency> </dependency>
<dependency>
<groupId>org.eclipse.ice</groupId>
<artifactId>org.eclipse.ice.data</artifactId>
<version>3.0.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
<parent> <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; package org.eclipse.ice.dev.annotations;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
...@@ -38,9 +49,10 @@ import java.lang.annotation.RetentionPolicy; ...@@ -38,9 +49,10 @@ import java.lang.annotation.RetentionPolicy;
* {@code PersonImplementation}) that fulfills that interface. * {@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 * @see org.eclipse.ice.dev.annotations.DataField
* @author Daniel Bluhm * @author Daniel Bluhm
* @author Jay Jay Billings
*/ */
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
@Retention(RetentionPolicy.SOURCE) @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; package org.eclipse.ice.dev.annotations;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
...@@ -11,6 +22,7 @@ import java.lang.annotation.Target; ...@@ -11,6 +22,7 @@ import java.lang.annotation.Target;
* @see org.eclipse.ice.dev.annotations.DataElement * @see org.eclipse.ice.dev.annotations.DataElement
* @see org.eclipse.ice.dev.annotations.DataField.Default * @see org.eclipse.ice.dev.annotations.DataField.Default
* @author Daniel Bluhm * @author Daniel Bluhm
* @author Jay Jay Billings
*/ */
@Target(ElementType.FIELD) @Target(ElementType.FIELD)
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
...@@ -34,7 +46,7 @@ public @interface DataField { ...@@ -34,7 +46,7 @@ public @interface DataField {
/** /**
* Flag whether this field should be included in * 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 * @return match annotation value
* @see org.eclipse.ice.dev.annotations.processors.Field#match * @see org.eclipse.ice.dev.annotations.processors.Field#match
*/ */
...@@ -53,10 +65,10 @@ public @interface DataField { ...@@ -53,10 +65,10 @@ public @interface DataField {
* Flag whether this field should be searchable in a collection. * Flag whether this field should be searchable in a collection.
* This causes persistence retrieval methods to be generated for this * This causes persistence retrieval methods to be generated for this
* field. * field.
* @return search annotation value * @return searchable annotation value
* @see org.eclipse.ice.dev.annotations.processors.Field#search * @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 * Flag whether this field can have a value of null. This causes
......
...@@ -174,6 +174,7 @@ public class DataElementProcessor extends AbstractProcessor { ...@@ -174,6 +174,7 @@ public class DataElementProcessor extends AbstractProcessor {
.packageName(element.getPackageName()) .packageName(element.getPackageName())
.elementInterface(element.getName()) .elementInterface(element.getName())
.className(element.getPersistenceHandlerName()) .className(element.getPersistenceHandlerName())
.interfaceName(element.getPersistenceHandlerInterfaceName())
.implementation(element.getImplName()) .implementation(element.getImplName())
.collection(collectionName) .collection(collectionName)
.fields(fields) .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; package org.eclipse.ice.dev.annotations.processors;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -11,6 +21,7 @@ import javax.lang.model.element.ElementKind; ...@@ -11,6 +21,7 @@ import javax.lang.model.element.ElementKind;
import javax.lang.model.element.TypeElement; import javax.lang.model.element.TypeElement;
import javax.lang.model.util.Elements; 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.DataElement;
import org.eclipse.ice.dev.annotations.DataFieldJson; import org.eclipse.ice.dev.annotations.DataFieldJson;
import org.eclipse.ice.dev.annotations.Persisted; import org.eclipse.ice.dev.annotations.Persisted;
...@@ -179,4 +190,15 @@ public class DataElementSpec extends AnnotatedElement { ...@@ -179,4 +190,15 @@ public class DataElementSpec extends AnnotatedElement {
.map(jsons -> Arrays.asList(jsons.value())) .map(jsons -> Arrays.asList(jsons.value()))
.orElse(Collections.emptyList()); .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