Permalink
Browse files

Changed from junit to testng. Changed occi4java namespaces. Fixed log…

…ging problem.
  • Loading branch information...
1 parent d70a309 commit 3e792f585efae168326854498e38c214203ec450 @sebastianlaag sebastianlaag committed May 31, 2011
View
@@ -2,3 +2,4 @@
.classpath
.project
target
+test-output
View
@@ -72,6 +72,11 @@ If you have already build the project you will find a /conf folder where you can
Changelog
---------
+0.3.1
+
+ * Overworked namespaces
+ * Changed from junit to testng
+
0.3
* Integrated process to make a deb file
View
@@ -3,14 +3,14 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>occi</artifactId>
- <groupId>edu.udo.irf.pg547</groupId>
- <version>0.3</version>
+ <artifactId>occi4java</artifactId>
+ <groupId>de.occi</groupId>
+ <version>0.3.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
- <groupId>edu.udo.irf.pg547</groupId>
- <artifactId>core</artifactId>
+ <groupId>de.occi</groupId>
+ <artifactId>occi4java.core</artifactId>
<version>0.2</version>
<name>Core</name>
@@ -16,8 +16,7 @@
# limitations under the License.
#
-log4j.rootLogger=INFO, stdout, A1
-#log4j.appender.A1=org.apache.log4j.ConsoleAppender
+log4j.rootLogger=INFO, A1, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
@@ -0,0 +1,25 @@
+#
+# Copyright (C) 2010-2011 Sebastian Heckmann, Sebastian Laag
+#
+# Contact Email: <sebastian.heckmann@udo.edu>, <sebastian.laag@udo.edu>
+#
+# Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, Version 3.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.gnu.org/licenses/lgpl-3.0.txt
+#
+# 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.
+#
+
+log4j.rootLogger=INFO, stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
+
+# Print only messages of level WARN or above in the package com.foo.
+log4j.logger.occi=INFO
@@ -1,3 +1,4 @@
+package occi.test;
/**
* Copyright (C) 2010-2011 Sebastian Heckmann, Sebastian Laag
*
@@ -16,10 +17,11 @@
* limitations under the License.
*/
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
import occi.config.OcciConfig;
-import org.junit.Assert;
-import org.junit.Test;
/**
* Test class for the Occi Config. Tests if some necessary config properties are
@@ -1,3 +1,4 @@
+package occi.test;
/**
* Copyright (C) 2010-2011 Sebastian Heckmann, Sebastian Laag
*
@@ -20,6 +21,9 @@
import javax.naming.directory.SchemaViolationException;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
import occi.core.Action;
import occi.core.Category;
import occi.core.Entity;
@@ -29,9 +33,6 @@
import occi.core.Mixin;
import occi.core.Resource;
-import org.junit.Assert;
-import org.junit.Test;
-
/**
* Test class for all core classes.
*
@@ -50,7 +51,7 @@ public void testOcciCoreClasses() {
Assert.assertNotNull(Mixin.class);
Assert.assertNotNull(Resource.class);
}
-
+
@Test
public void testOcciCategory() {
Category category = null;
@@ -1,3 +1,11 @@
+occi4java (0.3.1) unstable; urgency=low
+
+ * Overworked namespaces
+ * Changed from junit to testng
+
+ -- occi4java <sebastian.laag@googlemail.com> Tue, 31 May 2011 18:24:22 +0200
+
+
occi4java (0.3) unstable; urgency=low
* Integrated process to make a deb file
@@ -21,4 +29,4 @@ occi4java (0.1) unstable; urgency=low
* Initial release
- -- occi4java <sebastian.laag@googlemail.com> Sat, 02 Apr 2011 09:12:20 +0200
+ -- occi4java <sebastian.laag@googlemail.com> Sat, 02 Apr 2011 09:12:20 +0200
@@ -38,6 +38,9 @@
<fileSet>
<directory>../core/src/main/resources</directory>
<outputDirectory></outputDirectory>
+ <excludes>
+ <exclude>**/log4jTest.properties</exclude>
+ </excludes>
<includes>
<include>**</include>
</includes>
View
@@ -1,14 +1,16 @@
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
+
<parent>
- <artifactId>occi</artifactId>
- <groupId>edu.udo.irf.pg547</groupId>
- <version>0.3</version>
+ <artifactId>occi4java</artifactId>
+ <groupId>de.occi</groupId>
+ <version>0.3.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
- <groupId>edu.udo.irf.pg547</groupId>
- <artifactId>distribution</artifactId>
+
+ <groupId>de.occi</groupId>
+ <artifactId>occi4java.distribution</artifactId>
<version>0.3</version>
<name>Distribution</name>
@@ -69,19 +71,19 @@
<dependencies>
<dependency>
- <groupId>edu.udo.irf.pg547</groupId>
- <artifactId>core</artifactId>
+ <groupId>de.occi</groupId>
+ <artifactId>occi4java.core</artifactId>
<version>0.2</version>
</dependency>
<dependency>
- <groupId>edu.udo.irf.pg547</groupId>
- <artifactId>infrastructure</artifactId>
+ <groupId>de.occi</groupId>
+ <artifactId>occi4java.infrastructure</artifactId>
<version>0.2</version>
</dependency>
<dependency>
- <groupId>edu.udo.irf.pg547</groupId>
- <artifactId>http</artifactId>
- <version>0.2</version>
+ <groupId>de.occi</groupId>
+ <artifactId>occi4java.http</artifactId>
+ <version>0.2.1</version>
</dependency>
</dependencies>
</project>
View
@@ -5,15 +5,15 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>occi</artifactId>
- <groupId>edu.udo.irf.pg547</groupId>
- <version>0.3</version>
+ <artifactId>occi4java</artifactId>
+ <groupId>de.occi</groupId>
+ <version>0.3.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
- <groupId>edu.udo.irf.pg547</groupId>
- <artifactId>http</artifactId>
- <version>0.2</version>
+ <groupId>de.occi</groupId>
+ <artifactId>occi4java.http</artifactId>
+ <version>0.2.1</version>
<name>Http</name>
<repositories>
@@ -26,13 +26,13 @@
<dependencies>
<dependency>
- <groupId>edu.udo.irf.pg547</groupId>
- <artifactId>core</artifactId>
+ <groupId>de.occi</groupId>
+ <artifactId>occi4java.core</artifactId>
<version>0.2</version>
</dependency>
<dependency>
- <groupId>edu.udo.irf.pg547</groupId>
- <artifactId>infrastructure</artifactId>
+ <groupId>de.occi</groupId>
+ <artifactId>occi4java.infrastructure</artifactId>
<version>0.2</version>
</dependency>
<dependency>
@@ -1,62 +0,0 @@
-/**
- * Copyright (C) 2010-2011 Sebastian Heckmann, Sebastian Laag
- *
- * Contact Email: <sebastian.heckmann@udo.edu>, <sebastian.laag@udo.edu>
- *
- * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, Version 3.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.gnu.org/licenses/lgpl-3.0.txt
- *
- * 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 occi.http;
-
-import java.io.BufferedReader;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-
-import org.restlet.data.MediaType;
-import org.restlet.representation.Representation;
-import org.restlet.representation.StringRepresentation;
-import org.restlet.resource.Get;
-import org.restlet.resource.ServerResource;
-
-public class OcciRestTest extends ServerResource {
- @Get
- public String getOCCIRequest() {
- StringBuffer fileData = new StringBuffer(1000);
- BufferedReader reader = null;
- try {
- reader = new BufferedReader(new FileReader("../../../resources/test.html"));
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- }
- char[] buf = new char[1024];
- int numRead = 0;
- try {
- while ((numRead = reader.read(buf)) != -1) {
- String readData = String.valueOf(buf, 0, numRead);
- fileData.append(readData);
- buf = new char[1024];
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
- try {
- reader.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- Representation representation = new StringRepresentation(fileData.toString(), MediaType.TEXT_HTML);
- getResponse().setEntity(representation);
- return " ";
- }
-}
@@ -36,7 +36,7 @@ public static void main(String[] args) throws Exception {
if (new File("conf/log4j.properties").exists())
PropertyConfigurator.configure("conf/log4j.properties");
else
- PropertyConfigurator.configure("../core/src/main/resources/conf/log4j.properties");
+ PropertyConfigurator.configure("../core/src/main/resources/conf/log4jTest.properties");
// Create the HTTP server and listen on port 8182
comp.getServers().add(Protocol.HTTP,
OcciConfig.getInstance().config.getInt("occi.server.port"));
@@ -67,7 +67,6 @@ public static void main(String[] args) throws Exception {
OcciRestNetworkInterface.class);
// Returns all storage instances
comp.getDefaultHost().attach("/network/", OcciRestNetworks.class);
- comp.getDefaultHost().attach("/test", OcciRestTest.class);
// Router for all available mixin instances. Returns mixin information.
comp.getDefaultHost().attach("/{mixin}", OcciRestMixin.class);
// start occi api
Oops, something went wrong.

0 comments on commit 3e792f5

Please sign in to comment.