+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.argeo.jcr;
-
-import java.io.File;
-
-import javax.jcr.Repository;
-
-import org.apache.jackrabbit.core.TransientRepository;
-import org.argeo.jcr.unit.AbstractJcrTestCase;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-
-/** Factorizes configuration of an in memory transient repository */
-public abstract class AbstractInternalJackrabbitTestCase extends
- AbstractJcrTestCase {
- protected File getRepositoryFile() throws Exception {
- Resource res = new ClassPathResource(
- "org/argeo/server/jcr/repository-memory.xml");
- return res.getFile();
- }
-
- protected Repository createRepository() throws Exception {
- Repository repository = new TransientRepository(getRepositoryFile(),
- getHomeDir());
- return repository;
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.argeo.jcr;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class CollectionsObject {
- private String id;
- private String label;
- private SimpleObject simpleObject;
- private List<String> stringList = new ArrayList<String>();
- private Map<String, Float> floatMap = new HashMap<String, Float>();
- private Map<SimpleObject, String> objectMap = new HashMap<SimpleObject, String>();
- private Map<String, Map<String, String>> mapOfMaps = new HashMap<String, Map<String, String>>();
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getLabel() {
- return label;
- }
-
- public void setLabel(String label) {
- this.label = label;
- }
-
- public SimpleObject getSimpleObject() {
- return simpleObject;
- }
-
- public void setSimpleObject(SimpleObject simpleObject) {
- this.simpleObject = simpleObject;
- }
-
- public List<String> getStringList() {
- return stringList;
- }
-
- public void setStringList(List<String> stringList) {
- this.stringList = stringList;
- }
-
- public Map<String, Float> getFloatMap() {
- return floatMap;
- }
-
- public void setFloatMap(Map<String, Float> floatMap) {
- this.floatMap = floatMap;
- }
-
- public Map<SimpleObject, String> getObjectMap() {
- return objectMap;
- }
-
- public void setObjectMap(Map<SimpleObject, String> objectMap) {
- this.objectMap = objectMap;
- }
-
- public Map<String, Map<String, String>> getMapOfMaps() {
- return mapOfMaps;
- }
-
- public void setMapOfMaps(Map<String, Map<String, String>> mapOfMaps) {
- this.mapOfMaps = mapOfMaps;
- }
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.argeo.jcr;
-
-import javax.jcr.Node;
-
-import org.argeo.jcr.spring.BeanNodeMapper;
-
-@Deprecated
-public class MapperTest extends AbstractInternalJackrabbitTestCase {
- public void testSimpleObject() throws Exception {
- SimpleObject mySo = new SimpleObject();
- mySo.setInteger(100);
- mySo.setString("hello world");
-
- OtherObject oo1 = new OtherObject();
- oo1.setKey("someKey");
- oo1.setValue("stringValue");
- mySo.setOtherObject(oo1);
-
- OtherObject oo2 = new OtherObject();
- oo2.setKey("anotherSimpleObject");
- oo2.setValue(new SimpleObject());
- mySo.setAnotherObject(oo2);
-
- BeanNodeMapper bnm = new BeanNodeMapper();
-
- Node node = bnm.save(session(), mySo);
- session().save();
- JcrUtils.debug(node);
- }
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.argeo.jcr;
-
-public class OtherObject {
- private String key;
- private Object value;
-
- public String getKey() {
- return key;
- }
-
- public void setKey(String key) {
- this.key = key;
- }
-
- public Object getValue() {
- return value;
- }
-
- public void setValue(Object value) {
- this.value = value;
- }
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.argeo.jcr;
-
-import java.util.UUID;
-
-public class SimpleObject {
- private String string;
- private String uuid = UUID.randomUUID().toString();
- private Integer integer;
- private OtherObject otherObject;
- private OtherObject anotherObject;
-
- public String getString() {
- return string;
- }
-
- public void setString(String sting) {
- this.string = sting;
- }
-
- public Integer getInteger() {
- return integer;
- }
-
- public void setInteger(Integer integer) {
- this.integer = integer;
- }
-
- public OtherObject getOtherObject() {
- return otherObject;
- }
-
- public void setOtherObject(OtherObject otherObject) {
- this.otherObject = otherObject;
- }
-
- public OtherObject getAnotherObject() {
- return anotherObject;
- }
-
- public void setAnotherObject(OtherObject anotherObject) {
- this.anotherObject = anotherObject;
- }
-
- @Override
- public boolean equals(Object obj) {
- return string.equals(((SimpleObject) obj).string);
- }
-
- @Override
- public int hashCode() {
- return string.hashCode();
- }
-
- public void setUuid(String uuid) {
- this.uuid = uuid;
- }
-
- public String getUuid() {
- return uuid;
- }
-
-}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.argeo.jcr.spring;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class CollectionsObject {
+ private String id;
+ private String label;
+ private SimpleObject simpleObject;
+ private List<String> stringList = new ArrayList<String>();
+ private Map<String, Float> floatMap = new HashMap<String, Float>();
+ private Map<SimpleObject, String> objectMap = new HashMap<SimpleObject, String>();
+ private Map<String, Map<String, String>> mapOfMaps = new HashMap<String, Map<String, String>>();
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public void setLabel(String label) {
+ this.label = label;
+ }
+
+ public SimpleObject getSimpleObject() {
+ return simpleObject;
+ }
+
+ public void setSimpleObject(SimpleObject simpleObject) {
+ this.simpleObject = simpleObject;
+ }
+
+ public List<String> getStringList() {
+ return stringList;
+ }
+
+ public void setStringList(List<String> stringList) {
+ this.stringList = stringList;
+ }
+
+ public Map<String, Float> getFloatMap() {
+ return floatMap;
+ }
+
+ public void setFloatMap(Map<String, Float> floatMap) {
+ this.floatMap = floatMap;
+ }
+
+ public Map<SimpleObject, String> getObjectMap() {
+ return objectMap;
+ }
+
+ public void setObjectMap(Map<SimpleObject, String> objectMap) {
+ this.objectMap = objectMap;
+ }
+
+ public Map<String, Map<String, String>> getMapOfMaps() {
+ return mapOfMaps;
+ }
+
+ public void setMapOfMaps(Map<String, Map<String, String>> mapOfMaps) {
+ this.mapOfMaps = mapOfMaps;
+ }
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.argeo.jcr.spring;
+
+import javax.jcr.Node;
+
+import org.argeo.jackrabbit.unit.AbstractJackrabbitTestCase;
+import org.argeo.jcr.JcrUtils;
+import org.argeo.jcr.spring.BeanNodeMapper;
+
+@Deprecated
+public class MapperTest extends AbstractJackrabbitTestCase {
+ public void testSimpleObject() throws Exception {
+ SimpleObject mySo = new SimpleObject();
+ mySo.setInteger(100);
+ mySo.setString("hello world");
+
+ OtherObject oo1 = new OtherObject();
+ oo1.setKey("someKey");
+ oo1.setValue("stringValue");
+ mySo.setOtherObject(oo1);
+
+ OtherObject oo2 = new OtherObject();
+ oo2.setKey("anotherSimpleObject");
+ oo2.setValue(new SimpleObject());
+ mySo.setAnotherObject(oo2);
+
+ BeanNodeMapper bnm = new BeanNodeMapper();
+
+ Node node = bnm.save(session(), mySo);
+ session().save();
+ JcrUtils.debug(node);
+ }
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.argeo.jcr.spring;
+
+public class OtherObject {
+ private String key;
+ private Object value;
+
+ public String getKey() {
+ return key;
+ }
+
+ public void setKey(String key) {
+ this.key = key;
+ }
+
+ public Object getValue() {
+ return value;
+ }
+
+ public void setValue(Object value) {
+ this.value = value;
+ }
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.argeo.jcr.spring;
+
+import java.util.UUID;
+
+public class SimpleObject {
+ private String string;
+ private String uuid = UUID.randomUUID().toString();
+ private Integer integer;
+ private OtherObject otherObject;
+ private OtherObject anotherObject;
+
+ public String getString() {
+ return string;
+ }
+
+ public void setString(String sting) {
+ this.string = sting;
+ }
+
+ public Integer getInteger() {
+ return integer;
+ }
+
+ public void setInteger(Integer integer) {
+ this.integer = integer;
+ }
+
+ public OtherObject getOtherObject() {
+ return otherObject;
+ }
+
+ public void setOtherObject(OtherObject otherObject) {
+ this.otherObject = otherObject;
+ }
+
+ public OtherObject getAnotherObject() {
+ return anotherObject;
+ }
+
+ public void setAnotherObject(OtherObject anotherObject) {
+ this.anotherObject = anotherObject;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ return string.equals(((SimpleObject) obj).string);
+ }
+
+ @Override
+ public int hashCode() {
+ return string.hashCode();
+ }
+
+ public void setUuid(String uuid) {
+ this.uuid = uuid;
+ }
+
+ public String getUuid() {
+ return uuid;
+ }
+
+}
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.jackrabbit.commons.cnd.CndImporter;
-import org.argeo.jcr.AbstractInternalJackrabbitTestCase;
+import org.argeo.jackrabbit.unit.AbstractJackrabbitTestCase;
import org.argeo.jcr.ArgeoNames;
import org.argeo.jcr.ArgeoTypes;
import org.argeo.util.tabular.TabularColumn;
import org.argeo.util.tabular.TabularRowIterator;
import org.argeo.util.tabular.TabularWriter;
-public class JcrTabularTest extends AbstractInternalJackrabbitTestCase {
+public class JcrTabularTest extends AbstractJackrabbitTestCase {
private final static Log log = LogFactory.getLog(JcrTabularTest.class);
public void testWriteReadCsv() throws Exception {
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.argeo.jcr.AbstractInternalJackrabbitTestCase;
+import org.argeo.jackrabbit.unit.AbstractJackrabbitTestCase;
import org.argeo.jcr.JcrResourceAdapter;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
-public class JcrResourceAdapterTest extends AbstractInternalJackrabbitTestCase {
+public class JcrResourceAdapterTest extends AbstractJackrabbitTestCase {
private static SimpleDateFormat sdf = new SimpleDateFormat(
"yyyyMMdd:hhmmss.SSS");
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.argeo.jackrabbit.unit;
+
+import java.io.File;
+
+import javax.jcr.Repository;
+
+import org.apache.jackrabbit.core.TransientRepository;
+import org.argeo.jcr.unit.AbstractJcrTestCase;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.Resource;
+
+/** Factorizes configuration of an in memory transient repository */
+public abstract class AbstractJackrabbitTestCase extends
+ AbstractJcrTestCase {
+ protected File getRepositoryFile() throws Exception {
+ Resource res = new ClassPathResource(
+ "org/argeo/server/jcr/repository-memory.xml");
+ return res.getFile();
+ }
+
+ protected Repository createRepository() throws Exception {
+ Repository repository = new TransientRepository(getRepositoryFile(),
+ getHomeDir());
+ return repository;
+ }
+
+}