Skip to content

Commit

Permalink
Reorganized DB tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmihajlovski committed Jan 17, 2015
1 parent 6f3f40c commit b5a0155
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 13 deletions.
@@ -1,9 +1,8 @@
package org.rapidoid.db.entity;
package org.rapidoid.db;

import java.util.concurrent.ConcurrentMap;

import org.rapidoid.db.DB;
import org.rapidoid.db.DbTestCommons;
import org.rapidoid.db.imodel.Task;
import org.rapidoid.db.impl.DbProxy;
import org.rapidoid.util.U;
import org.testng.annotations.Test;
Expand Down Expand Up @@ -41,7 +40,7 @@ public void testDbProxy() {

final Task t = DbProxy.create(Task.class, map);
notNull(t);

U.benchmarkMT(100, "ops", 1000000, new Runnable() {
@Override
public void run() {
Expand Down
@@ -1,4 +1,4 @@
package org.rapidoid.db.entity;
package org.rapidoid.db.imodel;

import org.rapidoid.annotation.Relation;
import org.rapidoid.db.DbColumn;
Expand Down Expand Up @@ -26,7 +26,7 @@
* #L%
*/

interface Comment extends Entity {
public interface Comment extends Entity {

DbColumn<String> content();

Expand Down
@@ -1,4 +1,4 @@
package org.rapidoid.db.entity;
package org.rapidoid.db.imodel;

/*
* #%L
Expand Down
@@ -1,4 +1,4 @@
package org.rapidoid.db.entity;
package org.rapidoid.db.imodel;

/*
* #%L
Expand Down
@@ -1,4 +1,4 @@
package org.rapidoid.db.entity;
package org.rapidoid.db.imodel;

import org.rapidoid.annotation.Optional;
import org.rapidoid.annotation.Relation;
Expand Down Expand Up @@ -29,7 +29,7 @@
* #L%
*/

interface Task extends Entity, Commentable {
public interface Task extends Entity, Commentable {

DbDsl<Task> DSL = DB.dsl(Task.class);

Expand Down
@@ -1,4 +1,4 @@
package org.rapidoid.db.entity;
package org.rapidoid.db.imodel;

/*
* #%L
Expand Down Expand Up @@ -29,7 +29,7 @@
import org.rapidoid.db.DbSet;
import org.rapidoid.db.Entity;

interface User extends Entity {
public interface User extends Entity {

DbDsl<User> DSL = DB.dsl(User.class);

Expand Down
@@ -1,5 +1,7 @@
package org.rapidoid.db.model;

import org.rapidoid.db.AbstractEntity;

/*
* #%L
* rapidoid-db-tests
Expand All @@ -20,8 +22,11 @@
* #L%
*/

public class Company {
@SuppressWarnings("serial")
public class Company extends AbstractEntity {

public String name;

public Profile profile;

@Override
Expand Down
@@ -0,0 +1,32 @@
package org.rapidoid.db.model;

import org.rapidoid.db.DbColumn;
import org.rapidoid.db.Entity;

/*
* #%L
* rapidoid-db-tests
* %%
* Copyright (C) 2014 - 2015 Nikolche Mihajlovski
* %%
* 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.
* #L%
*/

public interface ICompany extends Entity {

DbColumn<String> name();

DbColumn<IProfile> profile();

}

0 comments on commit b5a0155

Please sign in to comment.